You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ian Long <ia...@opterus.com> on 2014/04/13 08:49:11 UTC
Tomcat logging for Internal Server Errors (500)
Hi All,
I need some help tracking down a random infrequent Internal Server Error that isn’t getting logged anywhere. I’m using Tomcat 7.0.53 behind apache httpd with mod_jk 1.2.39.
I use new relic application monitoring, and I see in their application error reports that a 500 error from tomcat is occasionally being thrown.
I have configured tomcat for global log4j logging as follows, as described on the tomcat site for global log4j logging, including replacing the tomcat-juli.jar file and adding the adapter and log4j itself
to the lib directory. Tomcat is logging information at startup, so I know it’s setup correctly in general.
log4j.properties file
==============
log4j.rootLogger=INFO, CATALINA
# Define all the appenders
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.File=${catalina.base}/logs/tomcat.log
log4j.appender.CATALINA.Append=true
log4j.appender.CATALINA.Encoding=UTF-8
# Roll-over the log once per day
log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout
log4j.appender.CATALINA.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.APP=org.apache.log4j.DailyRollngFileAppender
log4j.appender.APP.File=${catalina.base}/logs/soc.log
log4j.appender.APP.Append=true
log4j.appender.APP.Encoding=UTF-8
# Roll-over the log once per day
log4j.appender.APP.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.APP.layout = org.apache.log4j.PatternLayout
log4j.appender.APP.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
# Configure which loggers log to which appenders
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[ops-center.opterus.net].[/]=INFO, APP
#log4j.logger.org.apache.catalina=INFO, CATALINA
I also use log4j logging in my web application, which is logging errors in other cases, so I’m assuming the the request isn’t actually getting through to my code.
Do I have to tweak some logging parameters to get Tomcat to log those errors?
I have looked at the debug log from mod_jk and Tomcat doesn’t return much to mod_jk other than the Internal Server Error text along with the text encoding. The request itself looks
the same as a request that succeeds.
Any suggestions?
Thanks in advance!
Cheers,
Ian