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

AbstractLogger NPE hides actual cause when getFormat returns null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11.0
    • Fix Version/s: 3.0.0
    • Component/s: Core
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: