logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17531] New: - PropertyConfigurator.configureAndWatch() don't reset the configuration
Date Fri, 28 Feb 2003 16:08:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17531>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17531

PropertyConfigurator.configureAndWatch() don't reset the configuration

           Summary: PropertyConfigurator.configureAndWatch() don't reset the
                    configuration
           Product: Log4j
           Version: 1.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Configurator
        AssignedTo: log4j-dev@jakarta.apache.org
        ReportedBy: eric.chastan@netcelo.com


When the log4j properties file is changed only  added logger are taken into
account, removed logger are still enabled. I mean that if a logger is drop down
from debug to warn it still prints debugging information after the log4j
properties file has been saved.

This is because in class PropertyWatchdog in doOnChange() method the
configuration is not reset before reading the changed one -> Here is a
correction that works fine for me:

    public
    void doOnChange() {
        LoggerRepository hierarchy = LogManager.getLoggerRepository();
        hierarchy.resetConfiguration();
        new PropertyConfigurator().doConfigure(filename,hierarchy);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message