javalogginglogback

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 the pattern set right AFAIK:

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

What's the catch?


Solution

  • 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>