Class StackHashJsonProvider
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.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 ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExclude
(String exclusionPattern) void
addExclusions
(String commaSeparatedPatterns) Add multiple exclusion patterns as a list of comma separated patternsvoid
setExcludes
(List<String> exclusionPatterns) void
start()
Start the provider after all configuration properties are set.void
stop()
Stop the providervoid
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
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
-
FIELD_NAME
- See Also:
-
-
Constructor Details
-
StackHashJsonProvider
public StackHashJsonProvider()
-
-
Method Details
-
start
public void start()Description copied from interface:JsonProvider
Start the provider after all configuration properties are set.- Specified by:
start
in interfaceJsonProvider<ILoggingEvent>
- Overrides:
start
in classAbstractJsonProvider<ILoggingEvent>
-
stop
public void stop()Description copied from interface:JsonProvider
Stop the provider- Specified by:
stop
in interfaceJsonProvider<ILoggingEvent>
- Overrides:
stop
in 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: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
-