Class RootStackTraceElementJsonProvider
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<ILoggingEvent>
net.logstash.logback.composite.AbstractFieldJsonProvider<ILoggingEvent>
net.logstash.logback.composite.loggingevent.RootStackTraceElementJsonProvider
- All Implemented Interfaces:
ContextAware, FieldNamesAware<LogstashFieldNames>, JsonProvider<ILoggingEvent>
public class RootStackTraceElementJsonProvider
extends AbstractFieldJsonProvider<ILoggingEvent>
implements FieldNamesAware<LogstashFieldNames>
A JSON provider that, for any log event with a stack trace,
adds a
root_stack_trace_element JSON object field
containing the class name and method name where the outer-most exception was thrown.- Author:
- Daniel Albuquerque
-
Field Summary
FieldsFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetClassFieldName(String classFieldName) voidsetFieldNames(LogstashFieldNames fieldNames) voidsetMethodFieldName(String methodFieldName) voidwriteTo(JsonGenerator generator, ILoggingEvent event) Writes information about the event, to the given generator.Methods inherited from class AbstractFieldJsonProvider
getFieldName, setFieldNameMethods inherited from class AbstractJsonProvider
assertIsStarted, isStarted, prepareForDeferredProcessing, start, stopMethods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
FIELD_CLASS_NAME
- See Also:
-
FIELD_METHOD_NAME
- See Also:
-
FIELD_STACKTRACE_ELEMENT
- See Also:
-
-
Constructor Details
-
RootStackTraceElementJsonProvider
public RootStackTraceElementJsonProvider()
-
-
Method Details
-
writeTo
Description copied from interface:JsonProviderWrites 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.
- Specified by:
writeToin interfaceJsonProvider<ILoggingEvent>- Parameters:
generator- theJsonGeneratorto produce JSON contentevent- the event to convert into JSON
-
setFieldNames
- Specified by:
setFieldNamesin interfaceFieldNamesAware<LogstashFieldNames>
-
setClassFieldName
-
setMethodFieldName
-