Monday, November 23, 2015

Dropwizard: Add thread name to log

This should have been trivial, but somehow it isn't.
So I'll put it here.
Adding the thread name to Dropwizard logs:

#note the logFormat
logging:
level: INFO
appenders:
- type: console
threshold: INFO
timeZone: "UTC"
logFormat: "%-5p [%d{ISO8601,UTC}] %c: %m [%t]%n%rEx"
- type: file
threshold: ALL
timeZone: "UTC"
logFormat: "%-5p [%d{ISO8601,UTC}] %c: %m [%t]%n%rEx"

No comments: