tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Split Tomcat standard out into files for each context in 5.5
Date Mon, 03 Dec 2007 21:34:48 GMT
Hash: SHA1


Jason Perrone wrote:
> Please forgive me if this question was already answered.  I use log4j in
> my application, but still you always have some log messages that end up
> in stdout.  For these, and for all messages that end up in stdout, I
> would like there to be a separate log file for each of the applications
> (contexts) deployed in the container.  When trying to debug and looking
> for log messages it can get quite convoluted when all of the contexts
> are logging to the same file.

Sorry, dude. Stdout is stdout. If you call System.out.print and friends,
it's gonna go to (the unified) standard output. There's no way to
redirect stuff depending on the webapp that emitted the output.

If you were to embed Tomcat, you might be able to set System.out to
something other than a standard PrintWriter pointing to the console, and
roll your own hacked-up logging facility, but I would recommend against
all that.

By now, I think all the logging in Tomcat goes through the logger,
rather than directly to standard out. You ought to be able to set up
conf/ and friends to do things differently. You can
certainly set up a <Logger> element in your context.xml, though that is
likely to result in an application-specific log file as well as the same
output going to your stdout. You can always direct the logger to ignore
log messages from classes like com.yourcompany.*.

- -chris

Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message