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

AbstractLogger NPE hides actual cause when getFormat returns null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 3.0.0
    • Core
    • None

    Description

      NPE on Message.getFormat().length()

      java.lang.NullPointerException: null
              at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2184) ~[log4j-api-2.11.0.jar:2.11.0]
              at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2173) ~[log4j-api-2.11.0.jar:2.11.0]
              at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2125) ~[log4j-api-2.11.0.jar:2.11.0]
              at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2108) ~[log4j-api-2.11.0.jar:2.11.0]
              at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1827) ~[log4j-api-2.11.0.jar:2.11.0]
              at org.apache.logging.log4j.spi.AbstractLogger.trace(AbstractLogger.java:2272) ~[log4j-api-2.11.0.jar:2.11.0]

      Attachments

        Activity

          People

            ckozak Carter Kozak
            ckozak Carter Kozak
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: