开发者

logback - no end of line delimiter

I'm using logback 0.9.21 . Unfortunately it prints all messages to single line, there is no end of line character, even wrong one.

I've got th开发者_JAVA技巧e pattern set right AFAIK:

<pattern>%d{HH:mm:ss.SSS} %-5level %class (%thread) [%logger{36}] -- %msg%n</pattern>

What's the catch?


Found it, round brackets have special meaning in the pattern layout, therefore they must be escaped. So the pattern should look this way:

<pattern>%d{HH:mm:ss.SSS} %-5level %class \(%thread\) [%logger{36}] -- %msg%n</pattern>


In logback, parentheses within the pattern string serve as grouping tokens.

They need to be escaped with a backslash.


For any troubled soul like my self, Logback behave this way when it found a miss match token, not just parenthesis,

in my case was a miss placed :- token

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜