Table of Contents

About

Context data (also known as Mapped Diagnostic Context or MDC)

To be able to follow a request that flow in different component, you need to put the request ID in every message (generally a GUID.

It's a mechanism to insert key-value pairs in log messages.

It can also be highly helpful in filtering messages or triggering certain actions.

Component

Example

MDC.put("requestId", "xxxx-XXXX-xxxx");