Capturing stdout and stderr on Tomcat
Accepted answer
Tomcat has separate files for the server itself and each of the applications.
stdout and stderr for Tomcat is echoed to these files:
<CLM_HOME>/server/tomcat/logs/catalina.2012-06-15.log
<CLM_HOME>/server/tomcat/logs/localhost.2012-06-15.log
where the text in italics is the date when tomcat was started.
The output for applications is managed by each application. QM, RM and admin (LPA) all echo stdout (but not stderr) to their log files by default:
<CLM_HOME>/server/logs/qm.log
<CLM_HOME>/server/logs/rm.log
<CLM_HOME>/server/logs/admin.log
CCM and JTS do not echo stdout to a log file by default. Each of those applications has a file called log4j.properties that can be modified to echo stdout.
Open <CLM_HOME>/server/conf/application/log4j.properties for editing
where application is either jts or ccm
Comment out this line:
log4j.rootLogger=WARN, file
Uncomment this line:
log4j.rootLogger=WARN, stdout, file
Restart tomcat
None of the applications echos stderr. To do that, the log4j.properties file for each application must be changed.
Open <CLM_HOME>/server/conf/application/log4j.properties for editing
where application is either jts, ccm, qm, rm, admin
Add these lines:
###############################
# stderr Appender #
################################
log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stderr.layout.ConversionPattern=%d{ISO8601} [%t] %5p %-50.50c - %m%n
Restart tomcat