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

LogEventPatternConverter JSON implementation should replace newline with \n

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 2.9.1
    • 2.10.0
    • Layouts
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: