Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.09 KB

File metadata and controls

34 lines (25 loc) · 1.09 KB

Maven Version

SLF4J MDC propagation library

Adding the slf4j-propagation jar to your classpath is all that is needed to let the Mapped Diagnostic Context (MDC) from the Simple Logging Facade for Java (SLF4J) be automatically included into the ContextSnapshot.

How to use this library

Add it to your classpath.

<dependency>
    <groupId>nl.talsmasoftware.context</groupId>
    <artifactId>slf4j-propagation</artifactId>
    <version>[see Maven badge above]</version>
</dependency>

Done!

Now the MDC.getCopyOfContextMap() is copied into each snapshot from the ContextSnapshot.capture() method to be reactivated by the Contextsnapshot.reactivate() call. The ContextAwareExecutorService automatically propagates the full MDC content into all executed tasks this way.