|
||||||||||
| 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
org.apache.avalon.framework.logger.AvalonFormatter
public class AvalonFormatter
This formatter extends ExtendedPatternFormatter so that CascadingExceptions are formatted with all nested exceptions.
class : outputs the name of the class that has logged the
message. The optional short subformat removes the
package name. Warning : this pattern works only if formatting occurs in
the same thread as the call to Logger, i.e. it won't work with
AsyncLogTarget.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.log.format.PatternFormatter |
|---|
org.apache.log.format.PatternFormatter.PatternRun |
| Field Summary | |
|---|---|
static boolean |
DEFAULT_PRINT_CASCADING
The constant defining the default behaviour for printing nested exceptions. |
static int |
DEFAULT_STACK_DEPTH
The constant defining the default stack depth when none other is specified. |
private boolean |
m_printCascading
|
private int |
m_stackDepth
|
private static int |
TYPE_CLASS
|
private static java.lang.String |
TYPE_CLASS_SHORT_STR
|
private static java.lang.String |
TYPE_CLASS_STR
|
| Fields inherited from class org.apache.log.format.PatternFormatter |
|---|
MAX_TYPE |
| Constructor Summary | |
|---|---|
AvalonFormatter(java.lang.String pattern)
Construct the formatter with the specified pattern and which which prints out exceptions to stackDepth of 8. |
|
AvalonFormatter(java.lang.String pattern,
int stackDepth,
boolean printCascading)
Construct the formatter with the specified pattern and which which prints out exceptions to stackDepth specified. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
formatPatternRun(org.apache.log.LogEvent event,
org.apache.log.format.PatternFormatter.PatternRun run)
Return the result of formaltting a pattern run. |
private java.lang.String |
getClass(java.lang.String format)
Finds the class that has called Logger. |
protected java.lang.String |
getStackTrace(java.lang.Throwable throwable,
java.lang.String format)
Utility method to format stack trace. |
protected int |
getTypeIdFor(java.lang.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, 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_CLASS
private static final java.lang.String TYPE_CLASS_STR
private static final java.lang.String TYPE_CLASS_SHORT_STR
public static final int DEFAULT_STACK_DEPTH
public static final boolean DEFAULT_PRINT_CASCADING
private final int m_stackDepth
private final boolean m_printCascading
| Constructor Detail |
|---|
public AvalonFormatter(java.lang.String pattern)
pattern - The pattern to use to format the log entries
public AvalonFormatter(java.lang.String pattern,
int stackDepth,
boolean printCascading)
pattern - The pattern to use to format the log entriesstackDepth - The depth to which stacktraces are printed outprintCascading - true enables printing of nested exceptions,
false only prints out the outermost exception| Method Detail |
|---|
protected java.lang.String getStackTrace(java.lang.Throwable throwable,
java.lang.String format)
getStackTrace in class org.apache.log.format.PatternFormatterthrowable - the throwable instanceformat - ancilliary format parameter - allowed to be null
protected int getTypeIdFor(java.lang.String type)
getTypeIdFor in class org.apache.log.format.ExtendedPatternFormattertype - the string
protected java.lang.String formatPatternRun(org.apache.log.LogEvent event,
org.apache.log.format.PatternFormatter.PatternRun run)
formatPatternRun in class org.apache.log.format.ExtendedPatternFormatterevent - the log eventrun - the patter formatter pattern run
private java.lang.String getClass(java.lang.String format)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||