[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 
{code:xml}
<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)

Workaround:

use regex capture pattern

 
{code:xml}
<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
(v7.3.1#73012)


More information about the logback-dev mailing list