Class JsonWriterStructuredLogFormatter<E>
java.lang.Object
org.springframework.boot.logging.structured.JsonWriterStructuredLogFormatter<E>
- Type Parameters:
- E- the log event type
- All Implemented Interfaces:
- StructuredLogFormatter<E>
public abstract class JsonWriterStructuredLogFormatter<E>
extends Object
implements StructuredLogFormatter<E>
Base class for 
StructuredLogFormatter implementations that generates JSON using
 a JsonWriter.- Since:
- 3.4.0
- Author:
- Phillip Webb
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedJsonWriterStructuredLogFormatter(Consumer<JsonWriter.Members<E>> members, StructuredLoggingJsonMembersCustomizer<?> customizer) Create a newJsonWriterStructuredLogFormatterinstance with the given members.protectedJsonWriterStructuredLogFormatter(JsonWriter<E> jsonWriter) Create a newJsonWriterStructuredLogFormatterinstance with the givenJsonWriter.
- 
Method Summary
- 
Constructor Details- 
JsonWriterStructuredLogFormatterprotected JsonWriterStructuredLogFormatter(Consumer<JsonWriter.Members<E>> members, StructuredLoggingJsonMembersCustomizer<?> customizer) Create a newJsonWriterStructuredLogFormatterinstance with the given members.- Parameters:
- members- a consumer, which should configure the members
- customizer- an optional customizer to apply
 
- 
JsonWriterStructuredLogFormatterCreate a newJsonWriterStructuredLogFormatterinstance with the givenJsonWriter.- Parameters:
- jsonWriter- the- JsonWriter
 
 
- 
- 
Method Details- 
formatDescription copied from interface:StructuredLogFormatterFormats the given log event to a String.- Specified by:
- formatin interface- StructuredLogFormatter<E>
- Parameters:
- event- the log event to write
- Returns:
- the formatted log event String
 
- 
formatAsBytesDescription copied from interface:StructuredLogFormatterFormats the given log event to a byte array.- Specified by:
- formatAsBytesin interface- StructuredLogFormatter<E>
- Parameters:
- event- the log event to write
- charset- the charset
- Returns:
- the formatted log event bytes
 
 
-