[logback-dev] [JIRA] (LOGBACK-1261) %replace(%msg){'\n', '\n'} is not working

QOS.CH (JIRA) noreply-jira at qos.ch
Wed Feb 15 14:22:00 CET 2017

Gianluca created LOGBACK-1261:

             Summary: %replace(%msg){'\n','\n'} is not working
                 Key: LOGBACK-1261
                 URL: https://jira.qos.ch/browse/LOGBACK-1261
             Project: logback
          Issue Type: Bug
    Affects Versions: 1.2.1
            Reporter: Gianluca
            Assignee: Logback dev list

This pattern is not working 
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %replace(%msg){'\n','\n'}%n</pattern>{code}
This string "line a \n line b" becomes "line a n line b" (on the same line)


use regex capture pattern

<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %replace(%msg){'(\n)','$1'}%n</pattern>{code}
This partially solve the problem because it is not possible to add different escaped char like a tab '\t'

This message was sent by Atlassian JIRA

More information about the logback-dev mailing list