类 JsonWriterStructuredLogFormatter<E>
java.lang.Object
org.springframework.boot.logging.structured.JsonWriterStructuredLogFormatter<E>
- 类型参数:
E- the log event type
- 所有已实现的接口:
StructuredLogFormatter<E>
public abstract class JsonWriterStructuredLogFormatter<E>
extends Object
implements StructuredLogFormatter<E>
Base class for
StructuredLogFormatter implementations that generates JSON using
a JsonWriter.- 从以下版本开始:
- 3.4.0
- 作者:
- Phillip Webb
-
构造器概要
构造器限定符构造器说明protectedJsonWriterStructuredLogFormatter(Consumer<JsonWriter.Members<E>> members, StructuredLoggingJsonMembersCustomizer<?> customizer) Create a newJsonWriterStructuredLogFormatterinstance with the given members.protectedJsonWriterStructuredLogFormatter(JsonWriter<E> jsonWriter) Create a newJsonWriterStructuredLogFormatterinstance with the givenJsonWriter. -
方法概要
-
构造器详细资料
-
JsonWriterStructuredLogFormatter
protected JsonWriterStructuredLogFormatter(Consumer<JsonWriter.Members<E>> members, StructuredLoggingJsonMembersCustomizer<?> customizer) Create a newJsonWriterStructuredLogFormatterinstance with the given members.- 参数:
members- a consumer, which should configure the memberscustomizer- an optional customizer to apply
-
JsonWriterStructuredLogFormatter
Create a newJsonWriterStructuredLogFormatterinstance with the givenJsonWriter.- 参数:
jsonWriter- theJsonWriter
-
-
方法详细资料
-
format
从接口复制的说明:StructuredLogFormatterFormats the given log event to a String.- 指定者:
format在接口中StructuredLogFormatter<E>- 参数:
event- the log event to write- 返回:
- the formatted log event String
-
formatAsBytes
从接口复制的说明:StructuredLogFormatterFormats the given log event to a byte array.- 指定者:
formatAsBytes在接口中StructuredLogFormatter<E>- 参数:
event- the log event to writecharset- the charset- 返回:
- the formatted log event bytes
-