org.apache.avalon.framework.logger
Class AvalonFormatter
ExtendedPatternFormatterorg.apache.avalon.framework.logger.AvalonFormatter
public class AvalonFormatter
extends ExtendedPatternFormatter
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.
Version:
- Avalon Development Team
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.
|
AvalonFormatter(String pattern)- Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth of 8.
|
AvalonFormatter(String pattern, int stackDepth, boolean printCascading)- Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth specified.
|
protected String | formatPatternRun(LogEvent event, PatternFormatter.PatternRun run)- Return the result of formaltting a pattern run.
|
protected String | getStackTrace(Throwable throwable, String format)- Utility method to format stack trace.
|
protected int | getTypeIdFor(String type)- Retrieve the type-id for a particular string.
|
DEFAULT_PRINT_CASCADING
public static final boolean DEFAULT_PRINT_CASCADING
The constant defining the default behaviour for printing
nested exceptions.
- true
- 4.1.2
DEFAULT_STACK_DEPTH
public static final int DEFAULT_STACK_DEPTH
The constant defining the default stack depth when
none other is specified.
- 8
- 4.1.2
AvalonFormatter
public AvalonFormatter(String pattern)
Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth of 8.
pattern - The pattern to use to format the log entries
- 4.1
AvalonFormatter
public AvalonFormatter(String pattern,
int stackDepth,
boolean printCascading) Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth specified.
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
- 4.1.2
formatPatternRun
protected String formatPatternRun(LogEvent event,
PatternFormatter.PatternRun run) Return the result of formaltting a pattern run.
event - the log eventrun - the patter formatter pattern run
- the formatted string
getStackTrace
protected String getStackTrace(Throwable throwable,
String format) Utility method to format stack trace.
throwable - the throwable instanceformat - ancilliary format parameter - allowed to be null
- the formatted string
getTypeIdFor
protected int getTypeIdFor(String type)
Retrieve the type-id for a particular string.
type - the string
- the type-id
"Copyright B) 2001 Apache Jakarta Project. All Rights Reserved."