org.apache.log.format
Class ExtendedPatternFormatter
- 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.
$Id: ExtendedPatternFormatter.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
EOL, MAX_TYPE, SPACE_1, SPACE_16, SPACE_2, SPACE_4, SPACE_8, TYPE_CATEGORY, TYPE_CATEGORY_STR, TYPE_CONTEXT, TYPE_CONTEXT_STR, TYPE_MESSAGE, TYPE_MESSAGE_STR, TYPE_PRIORITY, TYPE_PRIORITY_STR, TYPE_RELATIVE_TIME, TYPE_RELATIVE_TIME_STR, TYPE_TEXT, TYPE_THREAD, TYPE_THREAD_STR, TYPE_THROWABLE, TYPE_THROWABLE_STR, TYPE_TIME, TYPE_TIME_STR, m_date, m_formatSpecification, m_simpleDateFormat |
addPatternRun, addTextRun, append, appendWhiteSpace, format, formatPatternRun, getCategory, getContextMap, getMessage, getPriority, getRTime, getStackTrace, getThread, getTime, getTypeIdFor, parse |
TYPE_METHOD
private static final int TYPE_METHOD
TYPE_METHOD_STR
private static final String TYPE_METHOD_STR
TYPE_THREAD
private static final int TYPE_THREAD
TYPE_THREAD_STR
private static final String TYPE_THREAD_STR
m_callStackOffset
private int m_callStackOffset
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
getMethod
private String getMethod(LogEvent event)
Utility method to format category.
getThread
private String getThread(LogEvent event)
Utility thread to format category.
getTypeIdFor
protected int getTypeIdFor(String type)
Retrieve the type-id for a particular string.
- getTypeIdFor in interface PatternFormatter