Top Description Fields Constructors Methods
ch.qos.logback.classic.encoder

public Class JsonEncoder

extends EncoderBase<ILoggingEvent>
Class Inheritance
Imports
ch.qos.logback.classic.spi.ILoggingEvent, .IThrowableProxy, .LoggerContextVO, .StackTraceElementProxy, ch.qos.logback.core.CoreConstants, ch.qos.logback.core.encoder.EncoderBase, org.slf4j.Marker, org.slf4j.event.KeyValuePair, java.util.List, .Map, .Set

http://ndjson.org/ https://datatracker.ietf.org/doc/html/rfc8259

Field Summary

Modifier and TypeField and Description
pack-priv static final boolean
public static final String
public static final String
public static final String
public static final String
private static final char
private static final char
private static final String
public static final String
public static final String
public static final String
private static final String
pack-priv static int
pack-priv static int
pack-priv static final boolean
pack-priv static byte[]
private static final char
private static final String
public static final String
public static final String
public static final String
private static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
private static final char
private static final char
private static final char
private static final String
public static final String
private static final char
public static final String
public static final String
public static final String
public static final String
public static final String
private static final char
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
Inherited from ch.qos.logback.core.encoder.EncoderBase:
started

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
appendSTEPArray(StringBuilder sb, StackTraceElementProxy[] stepArray, int commonFrames)

private void
public byte[]
encode(ILoggingEvent event)

Implements ch.qos.logback.core.encoder.Encoder.encode.

Encode an event as bytes.
public byte[]
public byte[]
pack-priv boolean
isNotEmptyMap(Map<K, V> map)

private String
private String
private String
public void
setWithArguments(boolean withArguments)

public void
setWithContext(boolean withContext)

public void
setWithFormattedMessage(boolean withFormattedMessage)

public void
setWithKVPList(boolean withKVPList)

public void
setWithLevel(boolean withLevel)

public void
setWithLoggerName(boolean withLoggerName)

public void
setWithMarkers(boolean withMarkers)

public void
setWithMDC(boolean withMDC)

public void
setWithMessage(boolean withMessage)

public void
setWithNanoseconds(boolean withNanoseconds)

public void
setWithSequenceNumber(boolean withSequenceNumber)

public void
setWithThreadName(boolean withThreadName)

public void
setWithThrowable(boolean withThrowable)

public void
setWithTimestamp(boolean withTimestamp)

Inherited from ch.qos.logback.core.encoder.EncoderBase:
isStartedstartstop

Field Detail

ADD_QUOTE_KEYback to summary
pack-priv static final boolean ADD_QUOTE_KEY
ARGUMENT_ARRAY_ATTR_NAMEback to summary
public static final String ARGUMENT_ARRAY_ATTR_NAME
BIRTHDATE_ATTR_NAMEback to summary
public static final String BIRTHDATE_ATTR_NAME
CAUSE_ATTR_NAMEback to summary
public static final String CAUSE_ATTR_NAME
CLASS_NAME_ATTR_NAMEback to summary
public static final String CLASS_NAME_ATTR_NAME
CLOSE_ARRAYback to summary
private static final char CLOSE_ARRAY
CLOSE_OBJback to summary
private static final char CLOSE_OBJ
COL_SPback to summary
private static final String COL_SP
COMMON_FRAMES_COUNT_ATTR_NAMEback to summary
public static final String COMMON_FRAMES_COUNT_ATTR_NAME
CONTEXT_ATTR_NAMEback to summary
public static final String CONTEXT_ATTR_NAME
CONTEXT_PROPERTIES_ATTR_NAMEback to summary
public static final String CONTEXT_PROPERTIES_ATTR_NAME
CYCLIC_THROWABLE_ATTR_NAMEback to summary
private static final String CYCLIC_THROWABLE_ATTR_NAME
DEFAULT_SIZEback to summary
pack-priv static int DEFAULT_SIZE
DEFAULT_SIZE_WITH_THROWABLEback to summary
pack-priv static int DEFAULT_SIZE_WITH_THROWABLE
DO_NOT_ADD_QUOTE_KEYback to summary
pack-priv static final boolean DO_NOT_ADD_QUOTE_KEY
EMPTY_BYTESback to summary
pack-priv static byte[] EMPTY_BYTES
ENTRY_SEPARATORback to summary
private static final char ENTRY_SEPARATOR
FILE_NAME_ATTR_NAMEback to summary
private static final String FILE_NAME_ATTR_NAME
FORMATTED_MESSAGE_ATTR_NAMEback to summary
public static final String FORMATTED_MESSAGE_ATTR_NAME
KEY_VALUE_PAIRS_ATTR_NAMEback to summary
public static final String KEY_VALUE_PAIRS_ATTR_NAME
LEVEL_ATTR_NAMEback to summary
public static final String LEVEL_ATTR_NAME
LINE_NUMBER_ATTR_NAMEback to summary
private static final String LINE_NUMBER_ATTR_NAME
LOGGER_ATTR_NAMEback to summary
public static final String LOGGER_ATTR_NAME
MARKERS_ATTR_NAMEback to summary
public static final String MARKERS_ATTR_NAME
MDC_ATTR_NAMEback to summary
public static final String MDC_ATTR_NAME
MESSAGE_ATTR_NAMEback to summary
public static final String MESSAGE_ATTR_NAME
METHOD_NAME_ATTR_NAMEback to summary
public static final String METHOD_NAME_ATTR_NAME
NAME_ATTR_NAMEback to summary
public static final String NAME_ATTR_NAME
NANOSECONDS_ATTR_NAMEback to summary
public static final String NANOSECONDS_ATTR_NAME
OPEN_ARRAYback to summary
private static final char OPEN_ARRAY
OPEN_OBJback to summary
private static final char OPEN_OBJ
QUOTEback to summary
private static final char QUOTE
QUOTE_COLback to summary
private static final String QUOTE_COL
SEQUENCE_NUMBER_ATTR_NAMEback to summary
public static final String SEQUENCE_NUMBER_ATTR_NAME
SPback to summary
private static final char SP
STEP_ARRAY_NAME_ATTRIBUTEback to summary
public static final String STEP_ARRAY_NAME_ATTRIBUTE
SUPPRESSED_ATTR_NAMEback to summary
public static final String SUPPRESSED_ATTR_NAME
THREAD_NAME_ATTR_NAMEback to summary
public static final String THREAD_NAME_ATTR_NAME
THROWABLE_ATTR_NAMEback to summary
public static final String THROWABLE_ATTR_NAME
TIMESTAMP_ATTR_NAMEback to summary
public static final String TIMESTAMP_ATTR_NAME
VALUE_SEPARATORback to summary
private static final char VALUE_SEPARATOR
withArgumentsback to summary
private boolean withArguments
withContextback to summary
private boolean withContext
withFormattedMessageback to summary
private boolean withFormattedMessage
withKVPListback to summary
private boolean withKVPList
withLevelback to summary
private boolean withLevel
withLoggerNameback to summary
private boolean withLoggerName
withMarkersback to summary
private boolean withMarkers
withMDCback to summary
private boolean withMDC
withMessageback to summary
private boolean withMessage
withNanosecondsback to summary
private boolean withNanoseconds
withSequenceNumberback to summary
private boolean withSequenceNumber
withThreadNameback to summary
private boolean withThreadName
withThrowableback to summary
private boolean withThrowable
withTimestampback to summary
private boolean withTimestamp

Constructor Detail

JsonEncoderback to summary
public JsonEncoder()

Method Detail

appendArgumentArrayback to summary
private void appendArgumentArray(StringBuilder sb, ILoggingEvent event)
appenderMemberback to summary
private void appenderMember(StringBuilder sb, String key, String value)
appenderMemberWithIntValueback to summary
private void appenderMemberWithIntValue(StringBuilder sb, String key, int value)
appenderMemberWithLongValueback to summary
private void appenderMemberWithLongValue(StringBuilder sb, String key, long value)
appendKeyValuePairsback to summary
private void appendKeyValuePairs(StringBuilder sb, ILoggingEvent event)
appendLoggerContextback to summary
private void appendLoggerContext(StringBuilder sb, LoggerContextVO loggerContextVO)
appendMapback to summary
private void appendMap(StringBuilder sb, String attrName, Map<String, String> map)
appendMarkersback to summary
private void appendMarkers(StringBuilder sb, ILoggingEvent event)
appendMDCback to summary
private void appendMDC(StringBuilder sb, ILoggingEvent event)
appendSTEPArrayback to summary
private void appendSTEPArray(StringBuilder sb, StackTraceElementProxy[] stepArray, int commonFrames)
appendThrowableProxyback to summary
private void appendThrowableProxy(StringBuilder sb, String attributeName, IThrowableProxy itp)
encodeback to summary
public byte[] encode(ILoggingEvent event)

Implements ch.qos.logback.core.encoder.Encoder.encode.

Doc from ch.qos.logback.core.encoder.Encoder.encode.

Encode an event as bytes.

Annotations
@Override
footerBytesback to summary
public byte[] footerBytes()

Implements ch.qos.logback.core.encoder.Encoder.footerBytes.

Doc from ch.qos.logback.core.encoder.Encoder.footerBytes.

Get footer bytes. This method is typically called prior to the closing of the stream where events are written.

Returns:byte[]

footer bytes. Null values are allowed.

Annotations
@Override
headerBytesback to summary
public byte[] headerBytes()

Implements ch.qos.logback.core.encoder.Encoder.headerBytes.

Doc from ch.qos.logback.core.encoder.Encoder.headerBytes.

Get header bytes. This method is typically called upon opening of an output stream.

Returns:byte[]

header bytes. Null values are allowed.

Annotations
@Override
isNotEmptyMapback to summary
pack-priv boolean isNotEmptyMap(Map<K, V> map)
jsonEscapeback to summary
private String jsonEscape(String s)
jsonEscapedToStringback to summary
private String jsonEscapedToString(Object o)
nullSafeStrback to summary
private String nullSafeStr(String s)
setWithArgumentsback to summary
public void setWithArguments(boolean withArguments)
setWithContextback to summary
public void setWithContext(boolean withContext)
setWithFormattedMessageback to summary
public void setWithFormattedMessage(boolean withFormattedMessage)
setWithKVPListback to summary
public void setWithKVPList(boolean withKVPList)
setWithLevelback to summary
public void setWithLevel(boolean withLevel)
setWithLoggerNameback to summary
public void setWithLoggerName(boolean withLoggerName)
setWithMarkersback to summary
public void setWithMarkers(boolean withMarkers)
setWithMDCback to summary
public void setWithMDC(boolean withMDC)
setWithMessageback to summary
public void setWithMessage(boolean withMessage)
setWithNanosecondsback to summary
public void setWithNanoseconds(boolean withNanoseconds)
Since
1.5.0
setWithSequenceNumberback to summary
public void setWithSequenceNumber(boolean withSequenceNumber)
Since
1.5.0
setWithThreadNameback to summary
public void setWithThreadName(boolean withThreadName)
setWithThrowableback to summary
public void setWithThrowable(boolean withThrowable)
setWithTimestampback to summary
public void setWithTimestamp(boolean withTimestamp)
Since
1.5.0