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
Nested ClassesModifier and TypeClassDescriptionstatic classTheContextDataInjectorused when the ThreadContextMap implementation is a copy-on-write StringMap-based data structure.static classDefaultContextDataInjectorfor the legacyMap<String, String>-based ThreadContext (which is also the ThreadContext implementation used for web applications).static classTheContextDataInjectorused when the ThreadContextMap implementation is a garbage-free StringMap-based data structure. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Collection<ContextDataProvider>ContextDataProviders loaded via OSGi. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyProperties(List<Property> properties, StringMap result) Copies key-value pairs from the specified property list into the specifiedStringMap.static voidDeprecated.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 benullresult- theStringMapobject to add the key-values to. Must be non-null.
-