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 ThrowableFormatOptions
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
ConstructorsModifierConstructorDescriptionprotected
ThrowablePatternConverter
(String name, String style, @Nullable String[] options) Deprecated.UseThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory)
instead.protected
ThrowablePatternConverter
(String name, String style, @Nullable String[] options, @Nullable Configuration config) Deprecated.UseThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory)
instead. -
Method Summary
Modifier and TypeMethodDescriptionvoid
format
(LogEvent event, StringBuilder buffer) Formats an event into a string buffer.protected String
Deprecated.Planned to be removed without a replacementboolean
Indicates this converter handlesThrowable
s.static ThrowablePatternConverter
newInstance
(@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 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:
format
in 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 handlesThrowable
s.- Overrides:
handlesThrowable
in 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
-