Class LiteralPatternConverter
java.lang.Object
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
org.apache.logging.log4j.core.pattern.LiteralPatternConverter
- All Implemented Interfaces:
ArrayPatternConverter, PatternConverter
public final class LiteralPatternConverter
extends LogEventPatternConverter
implements ArrayPatternConverter
Formats a string literal.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Configurationprivate final StringString literal.private final booleanFields inherited from class AbstractPatternConverter
LOGGERFields inherited from interface PatternConverter
CATEGORY -
Constructor Summary
ConstructorsConstructorDescriptionLiteralPatternConverter(Configuration config, String literal, boolean convertBackslashes) Create a new instance. -
Method Summary
Modifier and TypeMethodDescription(package private) static booleancontainsSubstitutionSequence(String literal) voidformat(Object obj, StringBuilder output) Formats an object into a string buffer.voidformat(StringBuilder output, Object... objects) Formats an array of Objects.voidformat(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.booleantoString()Methods inherited from class LogEventPatternConverter
handlesThrowableMethods inherited from class AbstractPatternConverter
getName, getStyleClassMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PatternConverter
getName, getStyleClass
-
Field Details
-
literal
String literal. -
config
-
substitute
private final boolean substitute
-
-
Constructor Details
-
LiteralPatternConverter
Create a new instance.- Parameters:
config- The Configuration.literal- string literal.convertBackslashes- iftrue, backslash characters are treated as escape characters and character sequences like "\" followed by "t" (backslash+t) are converted to special characters like '\t' (tab).
-
-
Method Details
-
containsSubstitutionSequence
-
format
Formats an event into a string buffer.- Specified by:
formatin classLogEventPatternConverter- Parameters:
event- event to format, may not be null.toAppendTo- string buffer to which the formatted event will be appended. May not be null.
-
format
Formats an object into a string buffer.- Specified by:
formatin interfacePatternConverter- Overrides:
formatin classLogEventPatternConverter- Parameters:
obj- event to format, may not be null.output- string buffer to which the formatted event will be appended. May not be null.
-
format
Formats an array of Objects.- Specified by:
formatin interfaceArrayPatternConverter- Parameters:
output- The StringBuilder to add the content to.objects- The Object array.
-
getLiteral
-
isVariable
public boolean isVariable()- Overrides:
isVariablein classLogEventPatternConverter
-
toString
-