Class ThreadContextDataInjector
java.lang.Object
org.apache.logging.log4j.core.impl.ThreadContextDataInjector
ThreadContextDataInjector
contains a number of strategies for copying key-value pairs from the various
ThreadContext
map implementations into a StringMap
. In the case of duplicate keys,
thread context values overwrite configuration Property
values.
These are the default ContextDataInjector
objects returned by the ContextDataInjectorFactory
.
- Since:
- 2.7
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TheContextDataInjector
used when the ThreadContextMap implementation is a copy-on-write StringMap-based data structure.static class
DefaultContextDataInjector
for the legacyMap<String, String>
-based ThreadContext (which is also the ThreadContext implementation used for web applications).static class
TheContextDataInjector
used when the ThreadContextMap implementation is a garbage-free StringMap-based data structure. -
Field Summary
Modifier and TypeFieldDescriptionstatic Collection<ContextDataProvider>
ContextDataProviders loaded via OSGi. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyProperties
(List<Property> properties, StringMap result) Copies key-value pairs from the specified property list into the specifiedStringMap
.static void
Deprecated.no-op
-
Field Details
-
contextDataProviders
ContextDataProviders loaded via OSGi.
-
-
Constructor Details
-
ThreadContextDataInjector
public ThreadContextDataInjector()
-
-
Method Details
-
initServiceProviders
Deprecated.no-opPreviously this method allowed ContextDataProviders to be loaded eagerly, now they are loaded when this class is initialized. -
copyProperties
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
.
-