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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.11.1
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: