Package org.slf4j

Class MDC

java.lang.Object
org.slf4j.MDC

public class MDC extends Object
This class hides and serves as a substitute for the underlying logging system's MDC implementation.

If the underlying logging system offers MDC functionality, then SLF4J's MDC, i.e. this class, will delegate to the underlying system's MDC. Note that at this time, only two logging systems, namely log4j and logback, offer MDC functionality. For java.util.logging which does not support MDC, BasicMDCAdapter will be used. For other systems, i.e. slf4j-simple and slf4j-nop, NOPMDCAdapter will be used.

Thus, as a SLF4J user, you can take advantage of MDC in the presence of log4j, logback, or java.util.logging, but without forcing these systems as dependencies upon your users.

For more information on MDC please see the chapter on MDC in the logback manual.

Please note that all methods in this class are static.

Since:
1.4.1
Author:
Ceki Gülcü