openzipkin / brave

Java distributed tracing implementation compatible with Zipkin backend services.
Apache License 2.0
2.36k stars 713 forks source link

Set JUL loggerName #1370

Closed mauhiz closed 9 months ago

mauhiz commented 1 year ago

Problem:

When using JUL to SLF4J bridge, the logger is misconfigured and logs are detected as being sent from "unknown.jul.logger". As a result, it is not straightforward to configure logback to filter out brave debug logs.

Solution:

This is apparently solvable but setting a logger name to each LogRecord produced, like in https://github.com/asciidoctor/asciidoctorj/pull/834

Drawbacks

For people using JUL directly with the default format, this will change the log output slightly.

Before:

Jan 01, 1970 9:00:00 AM null
FINE: Some message

After:

Jan 01, 1970 9:00:00 AM brave.Tracer
FINE: Some message