Wednesday, August 22, 2012

Limit the Size of the default-web-access.log


Applies to: Oracle Application Server 10g Enterprise Edition - Version: 10.1.2.0.0

Out of the box, the default-web-access.log will continue to grow until it is removed.

The default-web-site.xml file can be modified to allow for the logs to be cycled automatically and prevent default-web-access.log from growing too large and exhausting the disk storage.

Solution

To allow for the default-web-access.log file to be automatically cycled add the "split" variable to the default-web-site.xml logging parameter.

split: Specifies how often to begin a new access log. Supported values are "none" (never, which is the default), "hour", "day", "week", or "month". For a value other than "none", logs are named according to the suffix attribute. NOTE: the values are case sensitive and must be contained within double quotes. The suffix attribute is not needed if default naming is acceptable.

To make the change, change the final line in your default-web-site.xml

From:
access-log path="../log/default-web-access.log" /

to
access-log path="../log/default-web-access.log" split ="week"/

Note: all greater than and less than symbols have been removed in the example. Please be sure to leave them intact in the file mentioned.

This change will cause a new file to be created each week for the default-web-access.log. Old files can be removed from the directory and archived. Feel free to use the "month" parameter instead, if this meets your needs.

Source : Oracle Metalink Doc ID 572213.1

1 comment:

  1. Do I need to restart some services after I modify this parameter?

    ReplyDelete