类 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).
- 从以下版本开始:
- 3.5.0
- 作者:
- Phillip Webb
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明<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).
-
方法详细资料
-
flat
public <T> BiConsumer<T,BiConsumer<String, flatObject>> (String delimeter, Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using flat naming.- 类型参数:
T
- the item type- 参数:
delimeter
- the delimiter used if there is a prefixpairs
- callback to add all the pairs- 返回:
- a
BiConsumer
for use with theJsonWriter
-
flat
public <T> BiConsumer<T,BiConsumer<String, flatObject>> (BinaryOperator<String> joiner, Consumer<ContextPairs.Pairs<T>> pairs) Add pairs using flat naming.- 类型参数:
T
- the item type- 参数:
joiner
- the function used to join the prefix and namepairs
- callback to add all the pairs- 返回:
- a
BiConsumer
for use with theJsonWriter
-
nested
Add pairs using nested naming (for example as used in ECS).- 类型参数:
T
- the item type- 参数:
pairs
- callback to add all the pairs- 返回:
- a
BiConsumer
for use with theJsonWriter
-