Class ThrowablePatternConverter
- java.lang.Object
-
- org.apache.logging.log4j.core.pattern.AbstractPatternConverter
-
- org.apache.logging.log4j.core.pattern.LogEventPatternConverter
-
- org.apache.logging.log4j.core.pattern.ThrowablePatternConverter
-
- All Implemented Interfaces:
PatternConverter
- Direct Known Subclasses:
ExtendedThrowablePatternConverter,RootThrowablePatternConverter
@NullMarked @Plugin(name="ThrowablePatternConverter", category="Converter") public class ThrowablePatternConverter extends LogEventPatternConverter
-
-
Field Summary
Fields Modifier and Type Field Description protected List<PatternFormatter>formattersDeprecated.Kept for binary backward compatibility.protected ThrowableFormatOptionsoptions-
Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedThrowablePatternConverter(String name, String style, @Nullable String[] options)Deprecated.UseThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory)instead.protectedThrowablePatternConverter(String name, String style, @Nullable String[] options, @Nullable Configuration config)Deprecated.UseThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory)instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidformat(LogEvent event, StringBuilder buffer)Formats an event into a string buffer.ThrowableFormatOptionsgetOptions()protected StringgetSuffix(LogEvent logEvent)Deprecated.Planned to be removed without a replacementbooleanhandlesThrowable()Indicates this converter handlesThrowables.static ThrowablePatternConverternewInstance(@Nullable Configuration config, @Nullable String[] options)Creates an instance of the class.-
Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
emptyVariableOutput, format, isVariable
-
Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
-
-
-
Field Detail
-
formatters
@Deprecated protected final List<PatternFormatter> formatters
Deprecated.Kept for binary backward compatibility.Returns the list of formatters used to render the suffix.
-
options
protected final ThrowableFormatOptions options
-
-
Constructor Detail
-
ThrowablePatternConverter
@Deprecated protected ThrowablePatternConverter(String name, String style, @Nullable String[] options)
Deprecated.UseThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory)instead.
-
ThrowablePatternConverter
@Deprecated protected ThrowablePatternConverter(String name, String style, @Nullable String[] options, @Nullable Configuration config)
Deprecated.UseThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory)instead.
-
-
Method Detail
-
newInstance
public static ThrowablePatternConverter newInstance(@Nullable Configuration config, @Nullable String[] options)
Creates an instance of the class.- Parameters:
config- a configurationoptions- the pattern options- Returns:
- a new instance
-
format
public void format(LogEvent event, StringBuilder buffer)
Formats an event into a string buffer.- Specified by:
formatin classLogEventPatternConverter- Parameters:
event- event to format, may not be null.buffer- string buffer to which the formatted event will be appended. May not be null.
-
handlesThrowable
public boolean handlesThrowable()
Indicates this converter handlesThrowables.- Overrides:
handlesThrowablein classLogEventPatternConverter- Returns:
true
-
getOptions
public ThrowableFormatOptions getOptions()
-
getSuffix
@Deprecated protected String getSuffix(LogEvent logEvent)
Deprecated.Planned to be removed without a replacementReturns the formatted suffix pattern.- Parameters:
logEvent- the log event to use while formatting the suffix pattern- Returns:
- the formatted suffix
-
-