|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.format.PatternFormatter
org.apache.log.format.ExtendedPatternFormatter
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.log.format.PatternFormatter |
---|
PatternFormatter.PatternRun |
Field Summary | |
---|---|
private int |
m_callStackOffset
|
private static int |
TYPE_METHOD
|
private static String |
TYPE_METHOD_STR
|
private static int |
TYPE_THREAD
|
private static String |
TYPE_THREAD_STR
|
Fields inherited from class org.apache.log.format.PatternFormatter |
---|
MAX_TYPE |
Constructor Summary | |
---|---|
ExtendedPatternFormatter(String format)
Creation of a new extended pattern formatter. |
|
ExtendedPatternFormatter(String format,
int callStackOffset)
Creation of a new extended pattern formatter. |
Method Summary | |
---|---|
protected String |
formatPatternRun(LogEvent event,
PatternFormatter.PatternRun run)
Formats a single pattern run (can be extended in subclasses). |
private String |
getMethod(LogEvent event)
Utility method to format category. |
private String |
getThread(LogEvent event)
Utility thread to format category. |
protected int |
getTypeIdFor(String type)
Retrieve the type-id for a particular string. |
Methods inherited from class org.apache.log.format.PatternFormatter |
---|
format, getCategory, getContextMap, getMessage, getPriority, getRTime, getStackTrace, getThread, getTime, parse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int TYPE_METHOD
private static final int TYPE_THREAD
private static final String TYPE_METHOD_STR
private static final String TYPE_THREAD_STR
private int m_callStackOffset
Constructor Detail |
---|
public ExtendedPatternFormatter(String format)
format
- the format stringpublic ExtendedPatternFormatter(String format, int callStackOffset)
format
- the format stringcallStackOffset
- the offsetMethod Detail |
---|
protected int getTypeIdFor(String type)
getTypeIdFor
in class PatternFormatter
type
- the string
protected String formatPatternRun(LogEvent event, PatternFormatter.PatternRun run)
formatPatternRun
in class PatternFormatter
event
- the log eventrun
- the pattern run to format.
private String getMethod(LogEvent event)
event
- the event
private String getThread(LogEvent event)
event
- the even
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |