tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric B." <>
Subject swallowOutput not working properly?
Date Thu, 13 Aug 2009 18:49:55 GMT

I'm trying to get Tomcat to log the output each context individually in its 
own log file.

I tried using the swallowOutput in my <context> object definition, but am
getting some really weird results from it.  My webapp uses log4j to do its
logging with its own log4j.xml file within the webapp, and all log4j's 
output is
defined as using the org.apache.log4j.ConsoleAppender.

My context.xml file is:
                <Context debug="0" reloadable="true" distributable="true" 

                        <ResourceLink name="jdbc/dame"
                    type="javax.sql.DataSource" />

            <ResourceLink name="mail/dame"
                           type="javax.mail.Session" />


handlers =,,,\e.juli.FileHandler,,,       java.util.logging.ConsoleHandler = ALL = ${catalina.base}/logs = root.

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].level = 
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].handlers =

Based on that configuration (and swallowOutput documentation) I would expect 
that all logging from my root context would therefor go through log file.  However, I seem to only be 
getting some logging captured in the root.log logfile.

It is extremely confusing; there doesn't seem to be any pattern.  Some 
webapp logs go to root.log, other still are displayed on stdout, and 
therefore in catalina.out.  Like I said, all log msgs in the webapp use the 
same log4j ConsoleAppender.

I'm running Tomcat 6.0.18.  I searched through the changelog for 6.0.19 and 
6.0.20 and don't see anything that relates to this, so I am wondering if 
this is an issue that still exists.

Is my configuration wrong?



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

View raw message