Skip to content

Instantly share code, notes, and snippets.

View siddarth-ba-72's full-sized avatar
🎯
Focusing

Siddarth Ambannvar siddarth-ba-72

🎯
Focusing
View GitHub Profile
@siddarth-ba-72
siddarth-ba-72 / mdcJava.md
Last active October 2, 2025 16:42
Mapped Diagnostic Context (MDC) in Java

Mapped Diagnostic Context (MDC)

Analogy

  • Think of our Application as a Busy Restaurant
  • Where each order coming in is like an HTTP request from a user
  • Each chef(thread) is working on preparing orders
  • There is a kitchen logbook where each chef write what they are doing
  • Now if multiple chefs are working at the same time, how do we know which entry belongs to which chef and order

Case 1