public class JsonFormatter extends StructuredFormatter
Note that including details can be expensive in terms of calculating the caller.
The details include;
StructuredFormatter.ExceptionOutputType, StructuredFormatter.Generator, StructuredFormatter.Key
Constructor | Description |
---|---|
JsonFormatter() |
Creates a new JSON formatter.
|
JsonFormatter(String keyOverrides) |
Creates a new JSON formatter.
|
JsonFormatter(Map<StructuredFormatter.Key,String> keyOverrides) |
Creates a new JSON formatter.
|
Modifier and Type | Method | Description |
---|---|---|
protected StructuredFormatter.Generator |
createGenerator(Writer writer) |
Creates the generator used to create the structured data.
|
boolean |
isPrettyPrint() |
Indicates whether or not pretty printing is enabled.
|
void |
setPrettyPrint(boolean prettyPrint) |
Turns on or off pretty printing.
|
format
formatMessage, getHead, getTail
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
after, before, format, getDateTimeFormatter, getExceptionOutputType, getKey, getKeyOverrides, getMetaData, getRecordDelimiter, getZoneId, isCallerCalculationRequired, isDetailedExceptionOutputType, isFormattedExceptionOutputType, isPrintDetails, setDateFormat, setExceptionOutputType, setMetaData, setPrintDetails, setRecordDelimiter, setZoneId
public JsonFormatter()
public JsonFormatter(String keyOverrides)
keyOverrides
- a string representation of a map to override keysPropertyValues.stringToEnumMap(Class, String)
public JsonFormatter(Map<StructuredFormatter.Key,String> keyOverrides)
keyOverrides
- a map of overrides for the default keyspublic boolean isPrettyPrint()
true
if pretty printing is enabled, otherwise false
public void setPrettyPrint(boolean prettyPrint)
prettyPrint
- true
to turn on pretty printing or false
to turn it offprotected StructuredFormatter.Generator createGenerator(Writer writer)
StructuredFormatter
createGenerator
in class StructuredFormatter
Copyright © 2018. All rights reserved.