org.apache.log.format
Class ExtendedPatternFormatter
- Formatter, Formatter
public class ExtendedPatternFormatter
Formatter especially designed for debugging applications.
This formatter extends the standard PatternFormatter to add
two new possible expansions. These expansions are %{method}
and %{thread}. In both cases the context map is first checked
for values with specified key. This is to facilitate passing
information about caller/thread when threads change (as in
AsyncLogTarget). They then attempt to determine appropriate
information dynamically.
Version:
- Avalon Development Team
- Peter Donald
format , formatPatternRun , getCategory , getContext , getContextMap , getContextStack , getMessage , getPriority , getRTime , getStackTrace , getThread , getTime , getTypeIdFor , parse , setFormat |
ExtendedPatternFormatter
public ExtendedPatternFormatter(String format)
Creation of a new extended pattern formatter.
format
- the format string
ExtendedPatternFormatter
public ExtendedPatternFormatter(String format,
int callStackOffset)
Creation of a new extended pattern formatter.
format
- the format stringcallStackOffset
- the offset
formatPatternRun
protected String formatPatternRun(LogEvent event,
PatternFormatter.PatternRun run)
Formats a single pattern run (can be extended in subclasses).
- formatPatternRun in interface PatternFormatter
event
- the log eventrun
- the pattern run to format.
- the formatted result.
getTypeIdFor
protected int getTypeIdFor(String type)
Retrieve the type-id for a particular string.
- getTypeIdFor in interface PatternFormatter
type
- the string
- the type-id