tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Imner, Andreas" <>
Subject Why do stacktraces from servlets print to stdout, when the other end up in the log4j -log file?
Date Tue, 09 Jun 2009 19:31:44 GMT

My companys web application uses log4j 1.2.8 for logging and have just recently switched from
Weblogic to Tomcat 6.0.18.

Since the we switched to Tomcat, when we do some logging within a servlet
private static final Log log = LogFactory.getLog(ExceptionHandlerServlet.class);
log.error("some message, throwable);

The "some message" -line is written to the file specified by log4j, but why does the stacktrace
gets written to Tomcats stdout.log?

This behaviour is for servlets only. For the other Java classes in the webapp, both the "some
message" -line and the stacktrace is written to the file specified by log4j.


Extra info
The log -settings of Tomcat is the standard setup

This is our file



log4j.appender.A1.layout.ConversionPattern=%d{ABSOLUTE} %-5p %X{ak} [%c{1}] %m%n
log4j.rootLogger=ERROR, A1

# All System.out.println is redirected to stdout logger, INFO level

# All System.err.println (includes Exception.printStackTrace() is redirected to stderr logger,
INFO level

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message