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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment