Class ThreadContextDataInjector
- java.lang.Object
-
- org.apache.logging.log4j.core.impl.ThreadContextDataInjector
-
public class ThreadContextDataInjector extends java.lang.ObjectThreadContextDataInjectorcontains a number of strategies for copying key-value pairs from the variousThreadContextmap implementations into aStringMap. In the case of duplicate keys, thread context values overwrite configurationPropertyvalues.These are the default
ContextDataInjectorobjects returned by theContextDataInjectorFactory.- Since:
- 2.7
- See Also:
ThreadContext,Property,ReadOnlyStringMap,ContextDataInjector,ContextDataInjectorFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classThreadContextDataInjector.ForCopyOnWriteThreadContextMapTheContextDataInjectorused when the ThreadContextMap implementation is a copy-on-write StringMap-based data structure.static classThreadContextDataInjector.ForDefaultThreadContextMapDefaultContextDataInjectorfor the legacyMap<String, String>-based ThreadContext (which is also the ThreadContext implementation used for web applications).static classThreadContextDataInjector.ForGarbageFreeThreadContextMapTheContextDataInjectorused 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 voidcopyProperties(java.util.List<Property> properties, StringMap result)Copies key-value pairs from the specified property list into the specifiedStringMap.
-
-
-
Method Detail
-
copyProperties
public static void copyProperties(java.util.List<Property> properties, StringMap result)
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.
-
-