org.apache.avalon.framework.logger
Class AvalonFormatter
java.lang.Object
|
+--org.apache.log.format.PatternFormatter
|
+--org.apache.avalon.framework.logger.AvalonFormatter
- All Implemented Interfaces:
- org.apache.log.Formatter, org.apache.log.format.Formatter
- public class AvalonFormatter
- extends org.apache.log.format.PatternFormatter
This formatter extends PatternFormatter so that
CascadingExceptions are formatted with all nested exceptions.
- Author:
- Peter Donald, Berin Loritsch
Inner classes 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. |
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 |
getStackTrace(java.lang.Throwable throwable,
java.lang.String format)
Utility method to format stack trace. |
Methods inherited from class org.apache.log.format.PatternFormatter |
format, formatPatternRun, getCategory, getContext, getContextMap, getContextStack, getMessage, getPriority, getTime, getTypeIdFor, parse, setFormat |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_STACK_DEPTH
public static final int DEFAULT_STACK_DEPTH
- The constant defining the default stack depth when
none other is specified.
DEFAULT_PRINT_CASCADING
public static final boolean DEFAULT_PRINT_CASCADING
- The constant defining the default behaviour for printing
nested exceptions.
AvalonFormatter
public AvalonFormatter(java.lang.String pattern)
- Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth of 8.
- Parameters:
pattern
- The pattern to use to format the log entries
AvalonFormatter
public 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.
- Parameters:
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
getStackTrace
protected java.lang.String getStackTrace(java.lang.Throwable throwable,
java.lang.String format)
- Utility method to format stack trace.
- Overrides:
getStackTrace
in class org.apache.log.format.PatternFormatter
- Parameters:
throwable
- the throwable instanceformat
- ancilliary format parameter - allowed to be null- Returns:
- the formatted string
"Copyright © 2001 Apache Jakarta Project. All Rights Reserved."