Top Description Methods
org.apache.logging.log4j.spi

public Interface ThreadContextMap2

extends ThreadContextMap
Known Direct Subinterfaces
org.apache.logging.log4j.spi.CleanableThreadContextMap
Imports
java.util.Map, org.apache.logging.log4j.util.StringMap

Extension service provider interface to implement additional custom MDC behavior for org.apache.logging.log4j.ThreadContext. Consider implementing CleanableThreadContextMap instead.
Since
2.7
See Also
ThreadContextMap

Method Summary

Modifier and TypeMethod and Description
public StringMap

Returns:

the StringMap
getReadOnlyContextData
()

Returns the context data for reading.

public void
putAll(final Map<String, String>
The map.
map
)

Puts all given context map entries into the current thread's context map.

Inherited from org.apache.logging.log4j.spi.ThreadContextMap:
clearcontainsKeygetgetCopygetImmutableMapOrNullisEmptyputremove

Method Detail

getReadOnlyContextDataback to summary
public StringMap getReadOnlyContextData()

Returns the context data for reading. Note that regardless of whether the returned context data has been frozen (made read-only) or not, callers should not attempt to modify the returned data structure.

Returns:StringMap

the StringMap

putAllback to summary
public void putAll(final Map<String, String> map)

Puts all given context map entries into the current thread's context map.

If the current thread does not have a context map it is created as a side effect.

Parameters
map:Map<String, String>

The map.

Since
2.7