Class PatternFormatter
- java.lang.Object
-
- org.apache.logging.log4j.core.pattern.PatternFormatter
-
public class PatternFormatter extends Object
-
-
Constructor Summary
Constructors Constructor Description PatternFormatter(LogEventPatternConverter converter, FormattingInfo field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
format(LogEvent event, StringBuilder buf)
LogEventPatternConverter
getConverter()
FormattingInfo
getFormattingInfo()
boolean
handlesThrowable()
Normally pattern formatters are not meant to handle Exceptions although few pattern formatters might.boolean
requiresLocation()
Most pattern formatters do not use location information.String
toString()
Returns a String suitable for debugging.
-
-
-
Constructor Detail
-
PatternFormatter
public PatternFormatter(LogEventPatternConverter converter, FormattingInfo field)
-
-
Method Detail
-
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.
-
-