Class PatternFormatter

java.lang.Object
org.apache.logging.log4j.core.pattern.PatternFormatter

public class PatternFormatter extends Object
  • Field Details

    • EMPTY_ARRAY

      public static final PatternFormatter[] EMPTY_ARRAY
      The empty array.
  • Constructor Details

  • Method Details

    • format

      public void format(LogEvent event, StringBuilder buf)
    • getConverter

      public LogEventPatternConverter getConverter()
    • getFormattingInfo

      public FormattingInfo getFormattingInfo()
    • handlesThrowable

      public boolean handlesThrowable()
      Normally pattern formatters are not meant to handle Exceptions although few pattern formatters might.

      By examining the return values for this method, the containing layout will determine whether it handles throwables or not.

      Returns:
      true if this PatternConverter handles throwables
    • requiresLocation

      public boolean requiresLocation()
      Most pattern formatters do not use location information. When they do they should return true here so that the logging system can efficiently capture it.
      Returns:
      true if location information is required.
    • toString

      public String toString()
      Returns a String suitable for debugging.
      Overrides:
      toString in class Object
      Returns:
      a String suitable for debugging.