0Pricing
Spring Boot 4 Microservices & REST APIs · Lesson

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

  1. Why Distributed Tracing Matters
  2. Micrometer Tracing
  3. Exporting Traces to Zipkin
  4. Correlating Logs and Traces
← Back to Spring Boot 4 Microservices & REST APIs