Logback - no line separator

I am using logback 0.9.21 . Unfortunately, it prints all messages on one line, there is no end of line character , not even the wrong one.

I have a template installed to the right of AFAIK:

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

What is the catch?

+5
source share
2 answers

Found parentheses have special meaning in the template template, so they must be escaped. Thus, the template should look like this:

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

In logback, the brackets in the template string are the grouping token . They need to be avoided.

+3
source

All Articles