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 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:
  • Field Details

  • Constructor Details

    • ThreadContextDataInjector

      public ThreadContextDataInjector()
  • Method Details

    • initServiceProviders

      @Deprecated public static void initServiceProviders()
      Deprecated.
      no-op
      Previously this method allowed ContextDataProviders to be loaded eagerly, now they are loaded when this class is initialized.
    • copyProperties

      public static void copyProperties(List<Property> properties, StringMap result)
      Copies key-value pairs from the specified property list into the specified StringMap.
      Parameters:
      properties - list of configuration properties, may be null
      result - the StringMap object to add the key-values to. Must be non-null.