Class ThreadContextDataProvider

java.lang.Object
org.apache.logging.log4j.core.impl.ThreadContextDataProvider
All Implemented Interfaces:
ContextDataProvider

public class ThreadContextDataProvider extends Object implements ContextDataProvider
ContextDataProvider for ThreadContext data.
  • Constructor Details

    • ThreadContextDataProvider

      public ThreadContextDataProvider()
  • Method Details

    • supplyContextData

      public Map<String,String> supplyContextData()
      Description copied from interface: ContextDataProvider
      Returns a Map containing context data to be injected into the event or null if no context data is to be added.

      Thread-safety note: The returned object can safely be passed off to another thread: future changes in the underlying context data will not be reflected in the returned object.

      Specified by:
      supplyContextData in interface ContextDataProvider
      Returns:
      A Map containing the context data or null.
    • supplyStringMap

      public StringMap supplyStringMap()
      Description copied from interface: ContextDataProvider
      Returns the context data as a StringMap.

      Thread-safety note: The returned object can safely be passed off to another thread: future changes in the underlying context data will not be reflected in the returned object.

      Specified by:
      supplyStringMap in interface ContextDataProvider
      Returns:
      the context data in a StringMap.