In Tomcat 6.0.29, there's a new parameter in WebappClassLoader: clearReferencesLogFactoryRelease It is by default true, and executes the following code when undeploying a web application: // Clear the classloader reference in common-logging if (clearReferencesLogFactoryRelease) { org.apache.juli.logging.LogFactory.release(this); } The called method on JULI does the following: java.util.logging.LogManager.getLogManager().reset(); Which basically removes all handlers of all loggers of the Java util logger. This cause a severe regression: all other applications in the same JVM as Tomcat do not log anything anymore (since their handlers have disappeared). Is this an expected behaviour? How do we tell Catalina to only remove the handlers for the loggers by the Web application that is being undeployed? For now, in the Tomcat integration in our application server, we have worked around the problem by setting clearReferencesLogFactoryRelease to false. This is of course a very bad workaround. Cheers S. Ali Tokmen http://ali.tokmen.com/
Sorry, I meant Tomcat 7.0.0 and Tomcat 7.0.2 instead of 6.0.29.
The fix would I guess look like that: To clean up all of the current Web application's loggers: get all loggers' names for each logger get all handlers for each handler if the handler's class can be loaded using the WebAppClassLoader AND cannot be loaded using the WebAppClassLoader's parent then remove this handler else don't touch // that logger belongs to some other application or to Tomcat itself
*** This bug has been marked as a duplicate of bug 48716 ***