Mapped diagnostic context
A mapped diagnostic context is a set of key-value data associated with an execution context so logging systems can include that information in log records.
Grokking Software Architecture
Mapped Diagnostic Context is an application-level mechanism that associates contextual data with an execution thread so logging frameworks can attach that data to log messages.
- How it is used
- Enriches downstream logs with request context while keeping telemetry variables out of business signatures.
- How deep it goes
- Defines thread-local storage and explains metadata binding, downstream logging, and scoped cleanup.
- Examples
- Uses tenantId and orderId metadata, including an instrumented checkout operation.
- What you can do after
- Apply it via SLF4J MDC to correlate structured logs with a transaction identifier.
Read how Grokking Software Architecture explains mapped diagnostic context →
The Art of Code
Mapped Diagnostic Context is a per-execution logging context that automatically associates key-value information with log records.
- How it is used
- Enriches enterprise failure logs with execution-level context for faster investigation and correlation.
- How deep it goes
- Defines automatic contextual enrichment and its rationale but does not explain configuration or lifecycle mechanics.
- Examples
- Uses a transaction ID attached to every log produced during one execution flow.
- What you can do after
- Apply it to associate shared execution context with log records without repeating that context manually.
Read how The Art of Code explains mapped diagnostic context →
Related concepts
- Spring Cloud Sleuthused by · Spring Cloud Sleuth is a library that instruments Spring applications to generate distributed-tracing information.
- thread localuses · Thread-local data is data whose value or instance is independently associated with each executing thread.
- logginguses · Logging is the practice of recording events and diagnostic information produced during system or software activity for later inspection, analysis, or troubleshooting.
- correlation iduses · A correlation ID is an identifier associated with related requests, operations, messages, or records so their activity can be linked across system components.
- contextkind of · Context is relevant information, state, or circumstances that shape how an input, decision, or activity is interpreted or carried out.
Questions about mapped diagnostic context
What is mapped diagnostic context?
A mapped diagnostic context is a set of key-value data associated with an execution context so logging systems can include that information in log records.
Which Manning books explain mapped diagnostic context?
Grokking Software Architecture and The Art of Code.
What is mapped diagnostic context a kind of?
Mapped diagnostic context is a kind of context. Context is relevant information, state, or circumstances that shape how an input, decision, or activity is interpreted or carried out.
What is mapped diagnostic context also called?
Mapped diagnostic context is also called MDC.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

