Monday, February 6, 2012

OC4J Container log file rotation

default_group~<CONTAINER_NAME>_soa~default_group~1.log is created by JVM to print the output to console. This log file cannot be enabled for log file rotation using em console or configuration file.

Please follow below instruction to enable log file rotation.

1) Shutdown the server

2) Take back up of $ORACLE_HOME/opmn/conf/opmn.xml

3) Add "-Dstdstream.filesize=10" parameter to java-options of your container "start-parameters". 10 denotes the log file rotation size, after log file reaches 10MB new log file will be created.

4) Add "oc4j-options" data element, "<data id="oc4j-options" value="-out $ORACLE_HOME/opmn/logs/oc4j_soa.out -err $ORACLE_HOME/opmn/logs/oc4j_soa.err"/>"

5) Start the server

<data id="java-options" value="-server -mx1024M -ms1024M -XX:MaxPermSize=512M -XX:AppendRatio=3 -Djava.security.policy=$ORACLE_HOME/j2ee/oc4j_soa/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doraesb.home=$ORACLE_HOME/integration/esb -Dhttp.proxySet=false -Doc4j.userThreads=true -Doracle.mdb.fastUndeploy=60 -Doc4j.formauth.redirect=true -Djava.net.preferIPv4Stack=true -Dorabpel.home=$ORACLE_HOME/bpel -Xbootclasspath^/p:$ORACLE_HOME/bpel/lib/orabpel-boot.jar -Dhttp.proxySet=false -XX:MaxNewSize=614m -XX:NewSize=614m -XX:SurvivorRatio=6 -Daia.home=$AIA_HOME/AIA -Dbpel.delivery.operationNameCheck=true -Dbpel.dms=false -Dstdstream.filesize=10"/>

<data id="oc4j-options" value="-out $ORACLE_HOME/opmn/logs/oc4j_soa.out -err $ORACLE_HOME/opmn/logs/oc4j_soa.err"/>


Note: After changes log file will be created in the below location.
$ORACLE_HOME/opmn/logs/oc4j_soa_default_group_1/oc4j_soa_2012_02_06_18_41_30.out
$ORACLE_HOME/opmn/logs/oc4j_soa_default_group_1/oc4j_soa_2012_02_06_18_41_31.err

Tip: If you want to create only one log file then point the out and err stream to the same file as '<data id="oc4j-options" value="-out $ORACLE_HOME/opmn/logs/oc4j_soa.out -err $ORACLE_HOME/opmn/logs/oc4j_soa.out"/>'

No comments:

Post a Comment