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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to