Interface ContextDataProvider

All Known Implementing Classes:
ThreadContextDataProvider

public interface ContextDataProvider
Source of context data to be added to each log event.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a Map containing context data to be injected into the event or null if no context data is to be added.
    default StringMap
    Returns the context data as a StringMap.
  • Method Details

    • supplyContextData

      Map<String,String> supplyContextData()
      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.

      Returns:
      A Map containing the context data or null.
    • supplyStringMap

      default StringMap supplyStringMap()
      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.

      Returns:
      the context data in a StringMap.