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

           Summary: Logging (via juli) does not reread configuration
                    correctly when forced via LogManager indirect calls
           Product: Tomcat 6
           Version: 6.0.29
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: mfe...@altaresources.com


Created an attachment (id=26035)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26035)
Full source code (changes done against pristine 6.0.29 src code)

It is possible to normally do a LogManager.getLogManager() (which returns the
JULI specific implementation).  However, when calls to re-read the
configuration via readConfiguration() or readConfiguration(inputStream) are
done the current implementation does not properly re-read the config as the
standard JVM LogManager does.  In other words, the desired capability is to
update the logging.properties file at run-time without forcing any other types
of reloads (application context) or server restarts.

To address this, it is necessary to look at run-time to see which loggers are
already instantiated and manipulate the level at run-time based on the new
configuration.  Any loggers which are already instantiated should also have
their levels reset if they are not in the current configuration (fall back to
the default global level).

In addition, in the current implementation a reset is not consistently done.  I
pulled the JDK6 source code to contrast what the JULI ClassLoaderLogManager was
doing to do a comparison.

Attached is the file I used for testing which should address these issues.  It
should be fairly trivial to add this into Tomcat 7 as well as not much has
changed in this class in that version.

With this change, sites can modify the site-specific logging.properties
(context) and automatically reload those changes at run-time in the logging
system.

The attachment is all the code necessary to implement it (I did not do a
patch).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to