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

Failed to parse json string to LogEvent when massage type is MapMessage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.13.2, 2.13.3
    • None
    • Core
    • None

    Description

      I create LogEvent where message is of type MapMessage (key-value pairs).

      I send this log event to SocketAppender by JsonLayout.

      The json created in attached file.

      I tried also setObjectMessageAsJsonObject(true) - same result.

      On ServerSocket side I want to parse/deserialize this json string to  LogEvent and log it to File Appender:

      LogEvent logEvent = new JsonLogEventParser().parseFrom(line);

       

      Then parseFrom() build the LogEvent, message object create of type SimpleMessage and not MapMessage. Then it comes to resolving %map pattern in MapPatternConverter.format() - does nothing and returns.

       

       

       

       
       
       
       
       

      Attachments

        1. alert.json
          0.4 kB
          Alla Gofman

        Activity

          People

            Unassigned Unassigned
            AllaG Alla Gofman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: