Interface ContextDataProvider
- All Known Implementing Classes:
ThreadContextDataProvider
public interface ContextDataProvider
Source of context data to be added to each log event.
-
Method Details
-
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
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.
-
getValue
Retrieves a single context data value.This method avoids the overhead of copying the entire context data, when only a single value is needed.
- Parameters:
key
- The context data key of the value to retrieve.- Returns:
- A context data value.
- Since:
- 2.24.0
-