public interface JsonFactoryDecorator
JsonFactory used by a
CompositeJsonFormatter.
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.
| Modifier and Type | Method and Description |
|---|---|
default JsonFactory |
decorate(JsonFactory factory)
Decorates the given
JsonFactory. |
default MappingJsonFactory |
decorate(MappingJsonFactory factory)
Deprecated.
Override
decorate(JsonFactory) instead.
Will be removed in a future release. |
@Deprecated default MappingJsonFactory decorate(MappingJsonFactory factory)
decorate(JsonFactory) instead.
Will be removed in a future release.MappingJsonFactory.
By default, returns the given factory unchanged.default JsonFactory decorate(JsonFactory factory)
JsonFactory.
By default, for backwards compatibility purposes,
this assumes the given factory is a MappingJsonFactory,
and calls decorate(MappingJsonFactory) so that existing
implementations that only implemented decorate(MappingJsonFactory) continue to work.
In a future release, this will be changed to return the given factory by default,
and decorate(MappingJsonFactory) will be removed.
It is recommended to only override decorate(JsonFactory).
Existing implementations should migrate to only overriding decorate(JsonFactory)
so that they will continue to work after decorate(MappingJsonFactory) is removed.
Note that the default JsonFactory created by logstash-logback-encoder
is a MappingJsonFactory, but can be changed by JsonFactoryDecorators
to any subclass of JsonFactory.JsonFactoryCopyright © 2020. All rights reserved.