Package net.logstash.logback.decorate
Interface JsonFactoryDecorator
- All Known Implementing Classes:
CborJsonFactoryDecorator,CharacterEscapesJsonFactoryDecorator,CompositeJsonFactoryDecorator,EscapeNonAsciiJsonFactoryDecorator,FeatureJsonFactoryDecorator,NullJsonFactoryDecorator,SmileJsonFactoryDecorator,YamlJsonFactoryDecorator
public interface JsonFactoryDecorator
Decorates the
JsonFactory used by a
AbstractCompositeJsonFormatter.
This allows you to customize the factory used by the formatters.
Implementations must be idempotent. The decorator configured on a formatter is called each time a formatter is started, and there is no way to 'un-decorate' the factory when when formatter is stopped. So, the factory could be decorated multiple times if the formatter is restarted.
-
Method Summary
Modifier and TypeMethodDescriptiondefault JsonFactorydecorate(JsonFactory factory) Decorates the givenJsonFactory.
-
Method Details
-
decorate
Decorates the givenJsonFactory.By default, returns the given factory unchanged.
Note that the default
JsonFactorycreated by logstash-logback-encoder is aMappingJsonFactory, but can be changed byJsonFactoryDecorators to any subclass ofJsonFactory.- Parameters:
factory- the factory to decorate- Returns:
- the decorated
JsonFactory
-