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
Modifier and TypeClassDescriptionstatic class
Defines how a character will be escaped whenever that character is attempted to be written by a JsonGenerator. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
decorate
(JsonFactory factory) Decorates the givenJsonFactory
.boolean
void
void
setIncludeStandardAsciiEscapesForJSON
(boolean includeStandardAsciiEscapesForJSON)
-
Constructor Details
-
CharacterEscapesJsonFactoryDecorator
public CharacterEscapesJsonFactoryDecorator()
-
-
Method Details
-
decorate
Description copied from interface:JsonFactoryDecorator
Decorates the givenJsonFactory
.By default, returns the given factory unchanged.
Note that the default
JsonFactory
created by logstash-logback-encoder is aMappingJsonFactory
, but can be changed byJsonFactoryDecorator
s to any subclass ofJsonFactory
.- Specified by:
decorate
in interfaceJsonFactoryDecorator
- Parameters:
factory
- the factory to decorate- Returns:
- the decorated
JsonFactory
-
isIncludeStandardAsciiEscapesForJSON
public boolean isIncludeStandardAsciiEscapesForJSON() -
setIncludeStandardAsciiEscapesForJSON
public void setIncludeStandardAsciiEscapesForJSON(boolean includeStandardAsciiEscapesForJSON) -
addEscape
-
removeEscape
-