Class AbstractCompositeJsonFormatter<Event extends DeferredProcessingAware>

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractCompositeJsonFormatter<Event>
Type Parameters:
Event - type of event (ILoggingEvent or IAccessEvent).
All Implemented Interfaces:
ContextAware, LifeCycle
Direct Known Subclasses:
AccessEventCompositeJsonFormatter, LoggingEventCompositeJsonFormatter

public abstract class AbstractCompositeJsonFormatter<Event extends DeferredProcessingAware> extends ContextAwareBase implements LifeCycle
Formats logstash Events as JSON using JsonProviders.

The AbstractCompositeJsonFormatter starts the JSON object ('{'), then delegates writing the contents of the object to the JsonProviders, and then ends the JSON object ('}').

Jackson JsonGenerator are initially created with a "disconnected" output stream so they can be reused multiple times with different target output stream.

JsonGenerator instances are *not* reused after they threw an exception. This is to prevent reusing an instance whose internal state may be unpredictable.

Author:
brenuart