Class ThreadContextDataInjector
- java.lang.Object
-
- org.apache.logging.log4j.core.impl.ThreadContextDataInjector
-
public class ThreadContextDataInjector extends Object
ThreadContextDataInjector
contains a number of strategies for copying key-value pairs from the variousThreadContext
map implementations into aStringMap
. In the case of duplicate keys, thread context values overwrite configurationProperty
values.These are the default
ContextDataInjector
objects returned by theContextDataInjectorFactory
.- Since:
- 2.7
- See Also:
ThreadContext
,Property
,ReadOnlyStringMap
,ContextDataInjector
,ContextDataInjectorFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThreadContextDataInjector.ForCopyOnWriteThreadContextMap
TheContextDataInjector
used when the ThreadContextMap implementation is a copy-on-write StringMap-based data structure.static class
ThreadContextDataInjector.ForDefaultThreadContextMap
DefaultContextDataInjector
for the legacyMap<String, String>
-based ThreadContext (which is also the ThreadContext implementation used for web applications).static class
ThreadContextDataInjector.ForGarbageFreeThreadContextMap
TheContextDataInjector
used when the ThreadContextMap implementation is a garbage-free StringMap-based data structure.
-
Constructor Summary
Constructors Constructor Description ThreadContextDataInjector()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyProperties(List<Property> properties, StringMap result)
Copies key-value pairs from the specified property list into the specifiedStringMap
.
-
-
-
Method Detail
-
copyProperties
public static void copyProperties(List<Property> properties, StringMap result)
Copies key-value pairs from the specified property list into the specifiedStringMap
.- Parameters:
properties
- list of configuration properties, may benull
result
- theStringMap
object to add the key-values to. Must be non-null
.
-
-