|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.slf4j.MDC
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. If the undelying system does not support MDC, then SLF4J will silently drop MDC information.
Thus, as a SLF4J user, you can take advantage of MDC in the presence of log4j or logback, but without forcing log4j or logback 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.
Method Summary | |
static void |
clear()
Clear all entries in the MDC of the underlying implementation. |
static String |
get(String key)
Get the context identified by the key parameter. |
static MDCAdapter |
getMDCAdapter()
Returns the MDCAdapter instance currently in use. |
static void |
put(String key,
String val)
Put a context value (the val parameter) as identified with
the key parameter into the current thread's context map. |
static void |
remove(String key)
Remove the the context identified by the key parameter using
the underlying system's MDC implementation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void put(String key, String val)
val
parameter) as identified with
the key
parameter into the current thread's context map. This
method delegates all work to the MDC of the underlying logging system.
public static String get(String key)
key
parameter.
This method delegates all work to the MDC of the underlying logging system.
key
parameter.public static void remove(String key)
key
parameter using
the underlying system's MDC implementation.
public static void clear()
public static MDCAdapter getMDCAdapter()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |