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

Bug in BaseConfiguration.addLoggerAppender(..)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-beta4
    • 2.0-beta5
    • Core
    • None

    Description

      I add and remove dynamically appenders to loggers (Logger.addAppender)
      But when removing an error occurs.
      The reason is that the appenders are registered with the logger name in the list of appenders.

      proposal for solution:

      BaseConfiguration.java

      public synchronized void addLoggerAppender(final org.apache.logging.log4j.core.Logger logger,
      final Appender appender) {
      final String name = logger.getName();
      //appenders.putIfAbsent(name, appender); ==> it's the name of the logger
      appenders.putIfAbsent(appender.getName(), appender);

      Attachments

        Activity

          People

            rgoers Ralph Goers
            gow Werner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: