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

Attempting to call getExtendedStackTraceAsString() after deserializing JSON LogEvent results in a NPE

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.14.1
    • Fix Version/s: 3.0.0, 2.15.0
    • Component/s: Layouts
    • Labels:
      None

      Description

      How to reproduce:

      1. Generate a LogEvent with an Exception that has at least one cause (i.e. nested Exception)
      2. Use the standard JSON Layout to turn that LogEvent into JSON
      3. Using JsonLogEventParser to turn it back into a LogEvent
      4. Call getExtendedStackTraceAsString() on the ThrowableProxy associated with the deserialized LogEvent
      5. A NullPointerException will be thrown

      I've attached a small example project to reproduce the error.  

        Attachments

        1. example.zip
          3 kB
          Adam Long

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              adam@adam-long.net Adam Long
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: