public final class MdcContext extends Object
An example of the usage of this class, for a parallel stream:
MdcContext context = MdcContext.getCurrentMdc(); // stream and set context: list.parallelStream().forEach(entry -> { mdcContext.populateMdc(); ... })
Modifier and Type | Method and Description |
---|---|
static MdcContext |
getCurrentMdc()
Create a new instance.
|
void |
populateMdc()
Set the copied MDC context map into the current thread's MDC.
|
public static MdcContext getCurrentMdc()
public void populateMdc()