Java – logback – no line end delimiter
•
Java
I'm using logback 0.9 21. Unfortunately, it prints all messages to a single line, without end characters, or even the wrong line
My mode settings are correct AFAIK:
<pattern>%d{HH:mm:ss.SSS} %-5level %class (%thread) [%logger{36}] -- %msg%n</pattern>
What did you get?
Solution
Find it. Parentheses have special meaning in the pattern layout, so they must be escaped
<pattern>%d{HH:mm:ss.SSS} %-5level %class \(%thread\) [%logger{36}] -- %msg%n</pattern>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码