Class ColorConverter
java.lang.Object
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
org.springframework.boot.logging.log4j2.ColorConverter
- All Implemented Interfaces:
org.apache.logging.log4j.core.pattern.PatternConverter
@Plugin(name="color",
category="Converter")
public final class ColorConverter
extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
Log4j2
LogEventPatternConverter colors output using the AnsiOutput
class. A single option 'styling' can be provided to the converter, or if not specified
color styling will be picked based on the logging level.- Since:
- 1.3.0
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGERFields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendAnsiString(StringBuilder toAppendTo, String in, AnsiElement element) voidformat(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo) booleanstatic ColorConverternewInstance(org.apache.logging.log4j.core.config.Configuration config, String[] options) Creates a new instance of the class.Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
emptyVariableOutput, format, isVariableMethods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
Method Details
-
newInstance
public static ColorConverter newInstance(org.apache.logging.log4j.core.config.Configuration config, String[] options) Creates a new instance of the class. Required by Log4J2.- Parameters:
config- the configurationoptions- the options- Returns:
- a new instance, or
nullif the options are invalid
-
handlesThrowable
public boolean handlesThrowable()- Overrides:
handlesThrowablein classorg.apache.logging.log4j.core.pattern.LogEventPatternConverter
-
format
- Specified by:
formatin classorg.apache.logging.log4j.core.pattern.LogEventPatternConverter
-
appendAnsiString
-