Sleuth adds the application name (or overridable name for tracing only), the trace id, and the span id to the logs, see here. This uses the SLF4J MDC feature.
- With brave, the trace id and the span id is put in there with help of the
brave.baggage.CorrelationScopeDecorator. - With Otel, this is done via Slf4jApplicationListener and EventPublishingContextWrapper.
We should support that in Spring Boot, too, as this is a very important feature when using tracing.
Comment From: wilkinsona
Superseded by #32480.