Recently I was troubleshooting an application under Oracle Application Server (OAS 10g) and I was wondering where the standard out and error were getting routed. I was looking for the script that starts the oc4j to see where it is getting redirected. However, oracle is doing things their own way and using a executable file to start the jvm if we are using oc4j as part of the opmn.
So I had to digup the oracle documentation and found where they are supposed to go and how to control them. This website has good documentation on the various setting. However if you like to setup quickly here is what I did and hope this will help.
1) Update your opmn config file so it prints the system out and system.err to a file.
To do this, edit the rocess-type definition related to the oc4j instance where the app is deployed and add the following line just below the java-options line under start-parameters.
If you are not comfortable editing the file manually, you can use the enterprose manager tool and add new properties (yourInstance->Administration->Server Properties)to the startup parameters. You will have to add one option per line.
Here is the sample process definition:
<process-type id="myappinstance" module-id="OC4J" status="enabled">
<data id="java-options" value="-server -Djava.security.policy=$ORACLE_HOME/j2ee/myappinstance/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Dstdstream.filesize=2.5"/>
<data id="oc4j-options" value="-out oc4j.out.txt -err oc4j.err.txt"/>
<data id="java-options" value="-Djava.security.policy=$ORACLE_HOME/j2ee/myappinstance/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false"/>
<start timeout="600" retry="2"/>
<restart timeout="720" retry="2"/>
<port id="default-web-site" range="12501-12600" protocol="ajp"/>
<port id="rmi" range="12401-12500"/>
<port id="rmis" range="12701-12800"/>
<port id="jms" range="12601-12700"/>
<process-set id="default_group" numprocs="1"/>
2) Restart the instance and now you should see the outputs from any System.out outputs in the new file.
The location of the files are little strange. You will find them under %ORACLE_HOME%\j2ee\home\%INSTANCE_NAME%_default_group_1.