Interface LoggingContextHandler
-
- All Known Implementing Classes:
NOPLoggingContextHandler,PassThroughMDCLoggingContextHandler
public interface LoggingContextHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Remove all values from the contextjava.lang.Stringget(java.lang.String key)Gets the context value identified by the key parameterjava.util.Map<java.lang.String,java.lang.String>getCopyOfContextMap()Gets an copy of this current context mapvoidput(java.lang.String key, java.lang.String val)Put a value into the current context map.java.io.CloseableputCloseable(java.lang.String key, java.lang.String val)Put a value into the current context map.voidremove(java.lang.String key)Removes the context value identified by key parametervoidsetContextMap(java.util.Map<java.lang.String,java.lang.String> contextMap)Sets current context map to the map passed as parameter.
-
-
-
Method Detail
-
put
void put(java.lang.String key, java.lang.String val)Put a value into the current context map.- Parameters:
key- - The key to putval- - The value to put associated with key
-
putCloseable
java.io.Closeable putCloseable(java.lang.String key, java.lang.String val)Put a value into the current context map. This method return a Closeable object who can remove key when close is called.- Parameters:
key- - The key to putval- - The value to put associated with key- Returns:
- a Closeable who can remove key when close is called
-
get
java.lang.String get(java.lang.String key)
Gets the context value identified by the key parameter- Parameters:
key- - The key to locate- Returns:
- The value associated with the key
-
remove
void remove(java.lang.String key)
Removes the context value identified by key parameter- Parameters:
key- - The key to remove
-
clear
void clear()
Remove all values from the context
-
getCopyOfContextMap
java.util.Map<java.lang.String,java.lang.String> getCopyOfContextMap()
Gets an copy of this current context map- Returns:
- copy of the context.
-
setContextMap
void setContextMap(java.util.Map<java.lang.String,java.lang.String> contextMap)
Sets current context map to the map passed as parameter.- Parameters:
contextMap- the context map to use.
-
-