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

LogEventPatternConverter JSON implementation should replace newline with \n

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.10.0
    • Component/s: Layouts
    • Labels:
      None

      Description

      If you use %enc

      {%msg} {JSON}

      and do:

      log.info("Line 1\nLine 2")

      The message will encode as

      "Line 1\u000ALine 2"

      It would be nice if the JSON encoder would replace newline with \n, and if the code can recongize other special character would be even better

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sunnychanclsa Sunny Chan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: