Friday, January 01, 2010

How to rotate SOA log file by size

Rotating SOA log file mean limiting the size of the log files so that whenever the log file reaches the defined size it creates one new log file.To rotate the log file at 100k in SOA we will do something like this

GO to SOA_HOME/opmn/conf/opmn.xml, add "-Dstdstream.filesize=0.10" to java-options
under the start-parameters tag for process type oc4j_soa. This sets log file rotation at 100K bytes.


So it should appear like

process-type id="oc4j_soa" module-id="OC4J" status="enabled">
module-data>
category id="start-parameters">
data id="java-options" value="-server -mx1024M -ms512M -Xrs
-XX:MaxPermSize=128M -XX:AppendRatio=3 -Dstdstream.filesize=0.25
-Djava.security.policy=$ORACLE_HOME/j2ee/oc4j_soa/config/java2.policy -Djava.awt.headless=true
-Dhttp.webdir.enable=false -Doraesb.home=D:\product\10.1.3.1\OracleAS_1\integration\esb
-Doc4j.userThreads=true -Doracle.mdb.fastUndeploy=60
-Dorabpel.home=D:\product\10.1.3.1\OracleAS_1\bpel
-Xbootclasspath^/p:D:\product\10.1.3.1\OracleAS_1\bpel/lib/orabpel-boot.jar -Dhttp.proxySet=true
-Dhttp.proxyHost=www-proxy.us.oracle.com -Dhttp.proxyPort=80
-Dhttp.nonProxyHosts=arpit.us.oracle.com|localhost|*.us.oracle.com|arpit"/>


Next you have to add this line under the start-parameters tag:


This you have to add just after the code that i have written here.


Once it is done save the file and exit.

NOw go to command prompt

SOA_HOME\opmn\bin and do opmnctl reload.

ONce reloaded do opmnctl shutdown and then opmnctl startall.

Now if you will observe log file mylog_.out (and mylog_.err) will be created in /opmn/logs/oc4j_soa_default_group_1. When the current log file segment size reaches to roughly 100K+ bytes, a new log file segment will be created automatically.

No comments: