CollegeSource recommends using the log4j.properties file instead of the log4j.xml file due to it's simplified format. NOTE: Either file may be used.
- Added a directory for the log4j.xml file
Download log4j.xml
The Oracle Application Server needs a slightly different log4j.xml file than JBoss, so download the file named log4j.xml from the following page: Oracle App Server
For the external CEG to successfully find this file, ensure the following:
- The file must be named log4j.xml
- The log4j.xml file must reside in a directory you have added (or will add) to the application classpath (i.e., an external path) through the OAS console
- The Operating System owner (i.e., executor) of the Java process must have Execute and Read permission for all directories in the path and the log4j.xml file
Edit log4j.xml
The log4j.xml file must be edited for your specific needs.
Find CEG Appender Section
Open log4j.xml with a text editor and go to the section that looks like this:
<!-- CEG Appender -->
<!--
uncomment when ceg4 is used
<appender name="CEG4" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/home/cas/logs/ceg4.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="25"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{MM/dd HH:mm:ss,SSS} %5p [ceg4] [%t] [%c] %m%n" />
</layout>
</appender>
-->
Remove the xml comment lines so the section now looks like this:
<appender name="CEG4" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/home/cas/logs/ceg4.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="25"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{MM/dd HH:mm:ss,SSS} %5p [ceg4] [%t] [%c] %m%n" />
</layout>
</appender>
Revise the ceg4 Log File Path
Go to the line that looks like this:
<param name="File" value="/home/cas/logs/ceg4.log" />
The value specifies the full path filename of the log file to be written by the logging framework. Change the value attribute to be the directory you want the log files written to.
The Operating System owner (i.e., executor) of the java process must have Execute, Write, and Read permission for all directories in the path for the external CEG log files to be successfully written.
Save Your Changes