java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.encoder.EncoderBase<E>
ch.qos.logback.core.encoder.JsonEncoderBase<ILoggingEvent>
ch.qos.logback.classic.encoder.JsonEncoder
- All Implemented Interfaces:
Encoder<ILoggingEvent>
,ContextAware
,LifeCycle
This is a concrete JsonEncoder for
ILoggingEvent
that emits fields according to object's configuration.
It is partially imported from penna, but adapted to logback's structure.- Author:
- Henry John Kupty
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.qos.logback.core.encoder.JsonEncoderBase
JsonEncoderBase.Emitter<E>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class ch.qos.logback.core.encoder.EncoderBase
started
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
encode
(ILoggingEvent event) void
writeFormattedMessage
(DirectJson jsonWriter, ILoggingEvent event) void
writeLevel
(DirectJson jsonWriter, ILoggingEvent event) void
writeLogger
(DirectJson jsonWriter, ILoggingEvent event) void
writeMarkers
(DirectJson jsonWriter, ILoggingEvent event) void
writeMdc
(DirectJson jsonWriter, ILoggingEvent event) void
writeMessage
(DirectJson jsonWriter, ILoggingEvent event) void
writeThreadName
(DirectJson jsonWriter, ILoggingEvent event) Methods inherited from class ch.qos.logback.core.encoder.JsonEncoderBase
footerBytes, headerBytes
Methods inherited from class ch.qos.logback.core.encoder.EncoderBase
isStarted, start, stop
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
TIMESTAMP_ATTR_NAME
- See Also:
-
LEVEL_ATTR_NAME
- See Also:
-
MARKERS_ATTR_NAME
- See Also:
-
THREAD_ATTR_NAME
- See Also:
-
MDC_ATTR_NAME
- See Also:
-
LOGGER_ATTR_NAME
- See Also:
-
FORMATTED_MESSAGE_ATTR_NAME
- See Also:
-
MESSAGE_ATTR_NAME
- See Also:
-
EXCEPTION_ATTR_NAME
- See Also:
-
CONTEXT_ATTR_NAME
- See Also:
-
includeLevel
protected boolean includeLevel -
includeThreadName
protected boolean includeThreadName -
includeMDC
protected boolean includeMDC -
includeLoggerName
protected boolean includeLoggerName -
includeFormattedMessage
protected boolean includeFormattedMessage -
includeMessage
protected boolean includeMessage -
includeException
protected boolean includeException -
includeContextName
protected boolean includeContextName
-
-
Constructor Details
-
JsonEncoder
public JsonEncoder()
-
-
Method Details
-
writeMessage
-
writeFormattedMessage
-
writeLogger
-
writeThreadName
-
writeLevel
-
writeMarkers
-
writeMdc
-
encode
-