Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2821

updateLoggers with the same configuration?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6, 2.13.1
    • None
    • Core
    • None

    Description

      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.

          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));
          }
      

      ps: The behavior was imported from LOG4J2-1206.

      Attachments

        Activity

          People

            Unassigned Unassigned
            KevenYLi LiYi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: