public class HighlightErrorConverter
extends LogEventPatternConverter
HighlightConverter
that uses
TerminalConsoleAppender
to detect if Ansi escape codes can be used
to highlight errors and warnings in the console.
If configured, it will mark all logged errors with a red color and all
warnings with a yellow color. It can be only used together with
TerminalConsoleAppender
.
TerminalConsoleAppender.ANSI_OVERRIDE_PROPERTY
may be used
to force the use of ANSI colors even in unsupported environments.
Example usage: %highlightError{%level: %message}
Modifier | Constructor and Description |
---|---|
protected |
HighlightErrorConverter(java.util.List<PatternFormatter> formatters)
Construct the converter.
|
Modifier and Type | Method and Description |
---|---|
void |
format(LogEvent event,
java.lang.StringBuilder toAppendTo) |
boolean |
handlesThrowable() |
static HighlightErrorConverter |
newInstance(Configuration config,
java.lang.String[] options)
Gets a new instance of the
HighlightErrorConverter with the
specified options. |
protected HighlightErrorConverter(java.util.List<PatternFormatter> formatters)
formatters
- The pattern formatters to generate the text to highlightpublic void format(LogEvent event, java.lang.StringBuilder toAppendTo)
public boolean handlesThrowable()
public static HighlightErrorConverter newInstance(Configuration config, java.lang.String[] options)
HighlightErrorConverter
with the
specified options.config
- The current configurationoptions
- The pattern options