MDC

Java Logging

Java Logging with Mapped Diagnostic Context (MDC)

A Mapped Diagnostic Context (MDC) is a per-thread map of key/value pairs that a logging framework adds to log messages, so we can distinguish the interleaved log output of different requests. Log output is interleaved when a server handles multiple clients at nearly the same time. 1. Stamping Requests with MDC We use MDC to …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.