Class ContextPairs
java.lang.Object
org.springframework.boot.logging.structured.ContextPairs
Helper that can be used to add JSON pairs from context data (typically the logger MDC)
 in the correct location (or drop them altogether).
- Since:
- 3.5.0
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescription<T> BiConsumer<T,BiConsumer<String, Object>> flat(String delimeter, Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using flat naming.<T> BiConsumer<T,BiConsumer<String, Object>> flat(BinaryOperator<String> joiner, Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using flat naming.<T> BiConsumer<T,BiConsumer<String, Object>> nested(Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using nested naming (for example as used in ECS).
- 
Method Details- 
flatpublic <T> BiConsumer<T,BiConsumer<String, flatObject>> (String delimeter, Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using flat naming.- Type Parameters:
- T- the item type
- Parameters:
- delimeter- the delimiter used if there is a prefix
- pairs- callback to add all the pairs
- Returns:
- a BiConsumerfor use with theJsonWriter
 
- 
flatpublic <T> BiConsumer<T,BiConsumer<String, flatObject>> (BinaryOperator<String> joiner, Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using flat naming.- Type Parameters:
- T- the item type
- Parameters:
- joiner- the function used to join the prefix and name
- pairs- callback to add all the pairs
- Returns:
- a BiConsumerfor use with theJsonWriter
 
- 
nestedAdd pairs using nested naming (for example as used in ECS).- Type Parameters:
- T- the item type
- Parameters:
- pairs- callback to add all the pairs
- Returns:
- a BiConsumerfor use with theJsonWriter
 
 
-