Package net.logstash.logback.composite
Class AbstractJsonProvider<Event extends DeferredProcessingAware>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<Event>
- Type Parameters:
Event
- type of event (ILoggingEvent
orIAccessEvent
).
- All Implemented Interfaces:
ContextAware
,JsonProvider<Event>
- Direct Known Subclasses:
AbstractFieldJsonProvider
,AbstractPatternJsonProvider
,GlobalCustomFieldsJsonProvider
,LogstashMarkersJsonProvider
public abstract class AbstractJsonProvider<Event extends DeferredProcessingAware>
extends ContextAwareBase
implements JsonProvider<Event>
Base
JsonProvider
that provides default implementations for standard methods.-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Assert the component is started and throwIllegalStateException
if notboolean
Report whether the provider is started or not.void
Gives the provider a chance to perform more deferred processing (in addition to what is already provided byDeferredProcessingAware.prepareForDeferredProcessing()
).void
start()
Start the provider after all configuration properties are set.void
stop()
Stop the providerMethods 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
Methods inherited from interface net.logstash.logback.composite.JsonProvider
writeTo
-
Constructor Details
-
AbstractJsonProvider
public AbstractJsonProvider()
-
-
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<Event extends DeferredProcessingAware>
-
stop
public void stop()Description copied from interface:JsonProvider
Stop the provider- Specified by:
stop
in interfaceJsonProvider<Event extends DeferredProcessingAware>
-
isStarted
public boolean isStarted()Description copied from interface:JsonProvider
Report whether the provider is started or not.- Specified by:
isStarted
in interfaceJsonProvider<Event extends DeferredProcessingAware>
- Returns:
true
if the provider is started,false
otherwise.
-
prepareForDeferredProcessing
Description copied from interface:JsonProvider
Gives the provider a chance to perform more deferred processing (in addition to what is already provided byDeferredProcessingAware.prepareForDeferredProcessing()
).- Specified by:
prepareForDeferredProcessing
in interfaceJsonProvider<Event extends DeferredProcessingAware>
- Parameters:
event
- the event to prepare for deferred processing
-
assertIsStarted
protected void assertIsStarted()Assert the component is started and throwIllegalStateException
if not- Throws:
IllegalStateException
- if component is not started
-