2010/9/27 Roy McMorran <mcmor...@mdibl.org>:
>  On 9/23/10 8:15 PM, Roy McMorran wrote:
>>
>>  We are observing an odd behavior after upgrading to 6.0.29.  Ordinarily
>> if an exception occurs this will be logged to catalina.out.  When Tomcat is
>> first started (we use jsvc) this is the case as expected.  However if the
>> webapp is redeployed (without a restart of Tomcat) errors are no longer
>> logged to catalina.out. Restarting will return it to the normal behavior
>> (until the next redeploy).
>>
>> Prior to upgrading we were using 6.0.20 and did not have this issue.
>>  Running under Solaris 10 with JDK 1.6.0_21.  I'd be happy to provide any
>> other information that might be useful.  Any suggestions?  Thanks!
>>
> Well, we never did find out why this behavior changed, but we've implemented
> a workaround by configuring Tomcat to use log4j as described at
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html#log4j
> and setting swallowOutput in the Context element.
>
> Now everything is logging to tomcat.log (instead of catalina.out) and it
> behaves the same way before and after any redeploy.
>

Even when Tomcat uses java.util.logging (by default),  it should be
configured properly.

That is done by specifying
 -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

system properties when starting Tomcat. See how catalina.sh does that.

In recent Tomcat versions there are improvements to prevent memory
leaks. One of them is to reset webapp logging when a webapp is
undeployed.

That works fine if the logging is configured as above, or when log4j
is used instead, but it does not work well with the default LogManager
implementation.



The default LogManager implementation (used if
"java.util.logging.manager" property is not set) does not make a
difference between different class loaders (different webapps), and
its reset does shutdown the whole Tomcat-wide logging. That is what
the OP sees.

Note, that the default LogManager holds references to classes for its
entire lifetime, which is a good example of a PermGen memory leak. The
ClassLoaderLogManager should be used instead, and thus this issue
remains as is.

https://issues.apache.org/bugzilla/show_bug.cgi?id=48716


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