2016-03-08 18:43 GMT+03:00 Christopher Schultz <ch...@christopherschultz.net>:
>
> Everything that says log4j.logger.[something]=[level], stdout
>
> Is going to send those log messages to the "stdout" appender, which is
> tied to System.out. You'll need to do one of two things to dig
> yourself out:
>
> 1. Use swallowOutput="true" on your <Context>, which performs some
> magic to take System.out from applications' calls and redirect it
> elsewhere else (to the tomcat-defined loggers that can be configured
> in Tomcat's log4j.properties file).
>
> 2. Change the "stdout" appender to be something other than
> ConsoleAppender, and point it at a file on the disk.
>
> I'm not a fan of the first option, but it's sometimes the quickest way
> to handle everything all at once, and usually doesn't require any
> changes to the application's configuration.

The swallowOutput option is a remedy for direct System.out.println()
calls.  One should not expect it to work with something that gets a
direct reference to System.out stream before Tomcat replaces it.

For example, it Tomcat is reconfigured to use Log4J for its own
logging, and one configures a ConsoleAppender for Tomcat, this
ConsoleAppender is not affected by swallowOutput.

The limitations are documented here:

http://tomcat.apache.org/tomcat-8.0-doc/logging.html#Console

If you do not want to log to stdout/stderr, you really must not
configure any ConsoleAppender,.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to