java-spring-cloud icon indicating copy to clipboard operation
java-spring-cloud copied to clipboard

Logging Filter

Open pavolloffay opened this issue 7 years ago • 2 comments

https://github.com/opentracing-contrib/java-spring-cloud/pull/97 introduced redirect of standard logging into span logs.

Logback supports filters https://logback.qos.ch/manual/filters.html to change a decision on appending log. Right now we send all logs to span (log of the level of root logger). However, this might overload tracing system. Just note that some tracing systems might strip long log strings.

Question if how to support this. Autowire list of Filter<E>? This might autowire other filters from the context, a solution might be to use classifier like tracingLogFilter.

cc @jfbreault

pavolloffay avatar Feb 20 '18 10:02 pavolloffay

I would suggest simply leaving it to custom configuration, as it does Spring Boot on its own. Moment logback-spring.xml (or other variants) are found, it is used, and logging properties are ignored.

Problem is, currently SpanLogsAppender requires Tracer reference. When used in logback manually, it would have to use GlobalTracer.

Note that TracerRegisterAutoConfiguration does not reregister GlobalTracer when already registered, which might break soft-restarts of the app (mainly devtools).

mdvorak avatar Apr 06 '18 13:04 mdvorak

Would SpanLogsAppender.java be a good place to add a configurable Level check before executing the append using the int values of the levels?

motobeats avatar Jan 10 '20 16:01 motobeats