LiYi created LOG4J2-2821:
----------------------------

             Summary: updateLoggers with the same configuration?
                 Key: LOG4J2-2821
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2821
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.13.1, 2.6
            Reporter: LiYi


description: when we use the method updatetLoggers() in LoggerContext,  the old 
configuration is the same with the new configuration(i.e. The expression 'old 
== config' is always true), why do we need to update the configuration and fire 
a property change event?

The code below is from LoggerContext, for your information.
{code:java}
    public void updateLoggers() {
        updateLoggers(this.configuration);
    }

    public void updateLoggers(final Configuration config) {
        final Configuration old = this.configuration;
        for (final Logger logger : loggerRegistry.getLoggers()) {
            logger.updateConfiguration(config);
        }
        firePropertyChangeEvent(new PropertyChangeEvent(this, PROPERTY_CONFIG, 
old, config));
    }
{code}

ps: The behavior was imported from LOG4J2-1206.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to