Wednesday, August 22, 2012

How to Automate Splitting OC4J log Files for Web Sites (default-web-access.log)


How to Automate Splitting OC4J log Files for Web Sites (default-web-access.log) [ID 764085.1]

Applies to:
Oracle Containers for J2EE - Version: 10.1.3.0.0 to 10.1.3.4.0
Oracle Containers for J2EE - Version: 10.1.2.0.0 to 10.1.2.3.0

Goal
How to automate log file splitting on text-based OC4J log file default-web-access.log located in $ORACLE_HOME/j2ee//log/_default_group_1 in Oracle Application Server based on period of time?

Solution
To automate log file splitting on default-web-access.log, add the "split" attribute to element in $ORACLE_HOME/j2ee//config/default-web-site.xml

This "split" attribute specifies how often to begin a new access log, supported values are "none" (equivalent to "never", which is the default), "hour", "day", "week", and "month".

To implement this solution:

1. Change the following line in default-web-site.xml
<access-log path="../log/default-web-access.log"/> 

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

2. OC4J instance restart is required for these changes to take effect.
$ORACLE_HOME/opmn/bin/opmnctl stopproc process-type=home
$ORACLE_HOME/opmn/bin/opmnctl startproc process-type=home

Source : Oracle Metalink Doc Id: 764085.1

No comments:

Post a Comment