Skip to content

Latest commit

 

History

History

slf4j-propagation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

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 ContextManagers.createSnapshot() method to be reactivated by the Contextsnapshot.reactivate() call. The ContextAwareExecutorService automatically propagates the full MDC content into all executed tasks this way.