Initially I had such logging configuration in my spring boot 3.4 app:
logging:
...
pattern:
file: "%d [%thread] %-5level %-50logger{40}- %n"
console: "%d [%thread]%-5level %-50logger{40}- %n"
Then I've added tracing and trace/spanId was not added auomatically to my pattern so I've added:
pattern:
correlation: "[${spring.application.name:},%X{traceId:-},%X{spanId:-}]"
file: "%d [%thread]${logging.pattern.correlation} %-5level %-50logger{40} - %n"
console: "%d [%thread]${logging.pattern.correlation} %-5level %-50logger{40} %n"
Is there way to do it in a simpler way without explicit link to logging.pattern.correlation ?
is there smth like %thread for corellation ?