Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1261

%replace(%msg){'\n','\n'} is not working

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Major Major
    • None
    • 1.2.1
    • None
    • None

    Description

      This pattern is not working 

      <pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %replace(%msg){'\n','\n'}%n</pattern>

      This string "line a \n line b" becomes "line a n line b" (on the same line)

      Workaround:

      use regex capture pattern

       

      <pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %replace(%msg){'(\n)','$1'}%n</pattern>

      This partially solve the problem because it is not possible to add different escaped char like a tab '\t'

      Attachments

        Activity

          People

            logback-dev Logback dev list
            gianluca Gianluca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: