Class StackHashJsonProvider
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.StackHashJsonProvider
- All Implemented Interfaces:
ContextAware, JsonProvider<ILoggingEvent>
A JSON provider that adds a
stack_hash Json field on a log with a stack trace
This hash is computed using StackHasher
- Author:
- Pierre Smeyers
-
Field Summary
FieldsFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExclude(String exclusionPattern) voidaddExclusions(String commaSeparatedPatterns) Add multiple exclusion patterns as a list of comma separated patternsvoidsetExcludes(List<String> exclusionPatterns) voidstart()Start the provider after all configuration properties are set.voidstop()Stop the providervoidwriteTo(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, prepareForDeferredProcessingMethods 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_NAME
- See Also:
-
-
Constructor Details
-
StackHashJsonProvider
public StackHashJsonProvider()
-
-
Method Details
-
start
public void start()Description copied from interface:JsonProviderStart the provider after all configuration properties are set.- Specified by:
startin interfaceJsonProvider<ILoggingEvent>- Overrides:
startin classAbstractJsonProvider<ILoggingEvent>
-
stop
public void stop()Description copied from interface:JsonProviderStop the provider- Specified by:
stopin interfaceJsonProvider<ILoggingEvent>- Overrides:
stopin classAbstractJsonProvider<ILoggingEvent>
-
addExclude
-
addExclusions
Add multiple exclusion patterns as a list of comma separated patterns- Parameters:
commaSeparatedPatterns- list of comma separated patterns
-
setExcludes
-
getExcludes
-
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.
- Parameters:
generator- theJsonGeneratorto produce JSON contentevent- the event to convert into JSON
-