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
FieldsModifier and TypeFieldDescriptionprotected final List<PatternFormatter>Deprecated.Kept for binary backward compatibility.protected final ThrowableFormatOptionsFields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGERFields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThrowablePatternConverter(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
Modifier and TypeMethodDescriptionvoidformat(LogEvent event, StringBuilder buffer) Formats an event into a string buffer.protected StringDeprecated.Planned to be removed without a replacementbooleanIndicates 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, isVariableMethods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
Field Details
-
formatters
Deprecated.Kept for binary backward compatibility.Returns the list of formatters used to render the suffix. -
options
-
-
Constructor Details
-
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 Details
-
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
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
-
getSuffix
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
-