logging threads

41 views
Skip to first unread message

jason....@gmail.com

unread,
Sep 13, 2024, 10:04:50 AM9/13/24
to dropwizard-user
Hi,

I have a few background threads that get started at app startup but they log to the same file as the rest of the code. Does anyone have a YAML configuration that would put these logs in a separate file?

Thanks, Jason

Peter Stackle

unread,
Sep 13, 2024, 5:30:54 PM9/13/24
to dropwizard-user
You can configure the logger you use in your threads to use a different appender (which can configure its own filename/pattern/archive info etc.)

This Logging Configuration section (https://www.dropwizard.io/en/stable/manual/core.html#id4) shows an example where the `org.hibernate.SQL` logger is configured to be logged to the `./logs/example-sql.log` file.

jason....@gmail.com

unread,
Sep 15, 2024, 11:11:22 AM9/15/24
to dropwizard-user
Thanks Peter, exactly what I'm looking for :-)
Reply all
Reply to author
Forward
0 new messages