Class AbstractThrowableMessageJsonProvider
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<Event>
net.logstash.logback.composite.AbstractFieldJsonProvider<ILoggingEvent>
net.logstash.logback.composite.loggingevent.AbstractThrowableMessageJsonProvider
- All Implemented Interfaces:
ContextAware
,JsonProvider<ILoggingEvent>
- Direct Known Subclasses:
ThrowableMessageJsonProvider
,ThrowableRootCauseMessageJsonProvider
public abstract class AbstractThrowableMessageJsonProvider
extends AbstractFieldJsonProvider<ILoggingEvent>
Logs an exception message for a given logging event. Which exception to be
logged depends on the subclass's implementation of
getThrowable(ILoggingEvent)
.-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract IThrowableProxy
getThrowable
(ILoggingEvent event) void
writeTo
(JsonGenerator generator, ILoggingEvent event) Writes information about the event, to the given generator.Methods inherited from class net.logstash.logback.composite.AbstractFieldJsonProvider
getFieldName, setFieldName
Methods inherited from class net.logstash.logback.composite.AbstractJsonProvider
assertIsStarted, isStarted, prepareForDeferredProcessing, 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
-
Constructor Details
-
AbstractThrowableMessageJsonProvider
-
-
Method Details
-
writeTo
Description copied from interface:JsonProvider
Writes information about the event, to the given generator.When called, the generator is assumed to be within a JSON object context (i.e. this provider should write fields and their values to the generator). Upon return, the generator should be within the same JSON object context.
- Parameters:
generator
- theJsonGenerator
to produce JSON contentevent
- the event to convert into JSON- Throws:
IOException
- if an I/O error occurs
-
getThrowable
- Parameters:
event
- the event being logged, nevernull
- Returns:
- the throwable to use, or
null
if no appropriate throwable is available - Throws:
NullPointerException
- ifevent
isnull
-