Class ThrowablePatternConverter

All Implemented Interfaces:
PatternConverter
Direct Known Subclasses:
ExtendedThrowablePatternConverter, RootThrowablePatternConverter

@NullMarked @Plugin(name="ThrowablePatternConverter", category="Converter") public class ThrowablePatternConverter extends LogEventPatternConverter
Outputs certain information extracted from the Throwable associated with a LogEvent.
  • Field Details

  • Constructor Details

    • ThrowablePatternConverter

      @Deprecated protected ThrowablePatternConverter(String name, String style, @Nullable String[] options)
      Deprecated.
      Use ThrowablePatternConverter(String, String, String[], Configuration, ThrowablePropertyRendererFactory, ThrowableStackTraceRendererFactory) instead.
    • ThrowablePatternConverter

      @Deprecated protected ThrowablePatternConverter(String name, String style, @Nullable String[] options, @Nullable Configuration config)
      Deprecated.
      Use ThrowablePatternConverter(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 configuration
      options - the pattern options
      Returns:
      a new instance
    • format

      public void format(LogEvent event, StringBuilder buffer)
      Formats an event into a string buffer.
      Specified by:
      format in class LogEventPatternConverter
      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 handles Throwables.
      Overrides:
      handlesThrowable in class LogEventPatternConverter
      Returns:
      true
    • getOptions

      public ThrowableFormatOptions getOptions()
    • getSuffix

      @Deprecated protected String getSuffix(LogEvent logEvent)
      Deprecated.
      Planned to be removed without a replacement
      Returns the formatted suffix pattern.
      Parameters:
      logEvent - the log event to use while formatting the suffix pattern
      Returns:
      the formatted suffix