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

Using async appender with json layout causes only the message to be written

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.11.1, 3.0.0
    • None
    • None

    Description

      When using the async appender combined with the JsonLayout, you only get the results of the message being written to the appender.
       
      I took a look at it seems like this is because RingBufferLogEvent implements ReusableMessage which is where jackson gets the MessageSerializer, whereas the non async LogEvent doesn't, so it gets the BeanSerializer

      Attached are traces, both of which originating from the MessageSerializer.serialize method

      Attachments

        1. async_trace.txt
          3 kB
          David Knapp
        2. synchronous_trace.txt
          5 kB
          David Knapp

        Issue Links

          Activity

            People

              ckozak Carter Kozak
              falmarri David Knapp
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: