Module logstash.logback.encoder
Package net.logstash.logback.decorate
Class CharacterEscapesJsonFactoryDecorator
java.lang.Object
net.logstash.logback.decorate.CharacterEscapesJsonFactoryDecorator
- All Implemented Interfaces:
JsonFactoryDecorator
A
JsonFactoryDecorator that can be used to customize the JsonFactory.setCharacterEscapes(CharacterEscapes).
For example, you could change the escape sequence used for newline characters from '\n' to '
'-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines how a character will be escaped whenever that character is attempted to be written by a JsonGenerator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecorate(JsonFactory factory) Decorates the givenJsonFactory.booleanvoidvoidsetIncludeStandardAsciiEscapesForJSON(boolean includeStandardAsciiEscapesForJSON)
-
Constructor Details
-
CharacterEscapesJsonFactoryDecorator
public CharacterEscapesJsonFactoryDecorator()
-
-
Method Details
-
decorate
Description copied from interface:JsonFactoryDecoratorDecorates 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.- Specified by:
decoratein interfaceJsonFactoryDecorator- Parameters:
factory- the factory to decorate- Returns:
- the decorated
JsonFactory
-
isIncludeStandardAsciiEscapesForJSON
public boolean isIncludeStandardAsciiEscapesForJSON() -
setIncludeStandardAsciiEscapesForJSON
public void setIncludeStandardAsciiEscapesForJSON(boolean includeStandardAsciiEscapesForJSON) -
addEscape
-
removeEscape
-