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

log4j-1.2-api 2.17.2 throws NullPointerException while removing appender with name as null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.2
    • 2.18.0
    • None
    • None

    Description

      The log4j 1.2 bridge for 2.17.2 throws null pointer exception while removing Null appender

      viz. org.apache.log4j.varia.NullAppender 

      The class AppenderAttachableImpl adds the null appender to the concurrenthashmap as "null" and on removal there is no check for null and removes the nullappender with name null hence the NullPointerexception.

      Caused by: java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.remove(Unknown Source)
      at org.apache.log4j.helpers.AppenderAttachableImpl.removeAppender(AppenderAttachableImpl.java:93)
      at org.apache.log4j.Category.removeAppender(Category.java:618)

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            rajeshn Rajesh
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: