Class AbstractNestedJsonProvider<Event extends DeferredProcessingAware>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<Event>
net.logstash.logback.composite.AbstractFieldJsonProvider<Event>
net.logstash.logback.composite.AbstractNestedJsonProvider<Event>
- Type Parameters:
Event- type of event (ILoggingEventorIAccessEvent).
- All Implemented Interfaces:
ContextAware, JsonProvider<Event>, ObjectMapperAware
- Direct Known Subclasses:
AccessEventNestedJsonProvider, LoggingEventNestedJsonProvider
public abstract class AbstractNestedJsonProvider<Event extends DeferredProcessingAware>
extends AbstractFieldJsonProvider<Event>
implements ObjectMapperAware
A
JsonProvider that nests other providers within a subobject.-
Field Summary
FieldsFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGives the provider a chance to perform more deferred processing (in addition to what is already provided byDeferredProcessingAware.prepareForDeferredProcessing()).voidsetObjectMapper(ObjectMapper objectMapper) voidsetProviders(JsonProviders<Event> jsonProviders) voidstart()Start the provider after all configuration properties are set.voidstop()Stop the providervoidwriteTo(JsonGenerator generator, Event event) Writes information about the event, to the given generator.Methods inherited from class AbstractFieldJsonProvider
getFieldName, setFieldNameMethods inherited from class AbstractJsonProvider
assertIsStarted, isStartedMethods 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_NESTED
- See Also:
-
-
Constructor Details
-
AbstractNestedJsonProvider
public AbstractNestedJsonProvider()
-
-
Method Details
-
start
public void start()Description copied from interface:JsonProviderStart the provider after all configuration properties are set.- Specified by:
startin interfaceJsonProvider<Event extends DeferredProcessingAware>- Overrides:
startin classAbstractJsonProvider<Event extends DeferredProcessingAware>
-
stop
public void stop()Description copied from interface:JsonProviderStop the provider- Specified by:
stopin interfaceJsonProvider<Event extends DeferredProcessingAware>- Overrides:
stopin classAbstractJsonProvider<Event extends DeferredProcessingAware>
-
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<Event extends DeferredProcessingAware>- Parameters:
generator- theJsonGeneratorto produce JSON contentevent- the event to convert into JSON
-
getProviders
-
setProviders
-
setObjectMapper
- Specified by:
setObjectMapperin interfaceObjectMapperAware
-
prepareForDeferredProcessing
Description copied from interface:JsonProviderGives the provider a chance to perform more deferred processing (in addition to what is already provided byDeferredProcessingAware.prepareForDeferredProcessing()).- Specified by:
prepareForDeferredProcessingin interfaceJsonProvider<Event extends DeferredProcessingAware>- Overrides:
prepareForDeferredProcessingin classAbstractJsonProvider<Event extends DeferredProcessingAware>- Parameters:
event- the event to prepare for deferred processing
-