Correlating Logs and Traces
Connect logs to trace context.
Linking logs to traces
Traces show the request flow; logs show the details. Putting the traceId into every log line lets you jump from a trace to its exact logs - and vice versa.
What is MDC?
MDC (Mapped Diagnostic Context) is a per-thread key/value map provided by SLF4J/Logback. Values placed in it can be printed in every log line by the layout pattern.
All lessons in this course
- Why Distributed Tracing Matters
- Micrometer Tracing
- Exporting Traces to Zipkin
- Correlating Logs and Traces