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?
Found it, the 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With