Bug 49792 - The clearReferencesLogFactoryRelease removes all loggers in the JVM (instead of only removing all loggers of the Web application that is being undeployed)
Summary: The clearReferencesLogFactoryRelease removes all loggers in the JVM (instead ...
Status: RESOLVED DUPLICATE of bug 48716
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.2
Hardware: All All
: P2 regression (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on: 49791
  Show dependency tree
Reported: 2010-08-20 15:05 UTC by S. Ali Tokmen
Modified: 2010-08-22 09:34 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description S. Ali Tokmen 2010-08-20 15:05:31 UTC
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) {

The called method on JULI does the following:


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.


S. Ali Tokmen
Comment 1 S. Ali Tokmen 2010-08-20 15:08:08 UTC
Sorry, I meant Tomcat 7.0.0 and Tomcat 7.0.2 instead of 6.0.29.
Comment 2 S. Ali Tokmen 2010-08-21 07:55:10 UTC
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
              remove this handler
            else don't touch
              // that logger belongs to some other application or to Tomcat itself
Comment 3 Mark Thomas 2010-08-22 09:34:08 UTC

*** This bug has been marked as a duplicate of bug 48716 ***