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

Bug in BaseConfiguration.addLoggerAppender(..)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta4
    • Fix Version/s: 2.0-beta5
    • Component/s: Core
    • Labels:
      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);

        Activity

        Hide
        ralph.goers@dslextreme.com Ralph Goers added a comment -

        Patch applied in revision 1463400. Please verify and close.

        Show
        ralph.goers@dslextreme.com Ralph Goers added a comment - Patch applied in revision 1463400. Please verify and close.

          People

          • Assignee:
            ralph.goers@dslextreme.com Ralph Goers
            Reporter:
            gow Werner
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development