I'm using this pattern:
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - (%file:%line) - %msg%n</pattern>
Yet the output looks like:
09:42:25.811 WARN a.a.an.dao.api.ANApi - (ANApi.java:153
The pattern appears to be truncated after the %line (it also happens if I use %L) - what am I doing wrong?
I need this specific pattern so that Eclipse's console will recognize it.
(
and )
have a special meaning, as explained on logback website:
In PatternLayout, parenthesis can be used to group conversion patterns. It follows that the '(' and ')' carry special meaning and need to be escaped if intended to be used as literals. The special nature of parenthesis is further explained below.
In your case you need to escape them with a backslash:
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - \(%file:%line\) - %msg%n</pattern>
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