org.apache.avalon.framework.logger
public class AvalonFormatter extends ExtendedPatternFormatter
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: $Id: AvalonFormatter.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
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.
|
boolean | m_printCascading |
int | m_stackDepth |
static int | TYPE_CLASS |
static String | TYPE_CLASS_SHORT_STR |
static String | TYPE_CLASS_STR |
Constructor Summary | |
---|---|
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.
|
Method Summary | |
---|---|
protected String | formatPatternRun(LogEvent event, PatternRun run)
Return the result of formaltting a pattern run. |
String | getClass(String format)
Finds the class that has called Logger. |
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.
|
Since: 4.1.2
Since: 4.1.2
Parameters: pattern The pattern to use to format the log entries
Since: 4.1
Parameters: pattern The pattern to use to format the log entries stackDepth The depth to which stacktraces are printed out printCascading true enables printing of nested exceptions, false only prints out the outermost exception
Since: 4.1.2
Parameters: event the log event run the patter formatter pattern run
Returns: the formatted string
Parameters: throwable the throwable instance format ancilliary format parameter - allowed to be null
Returns: the formatted string
Parameters: type the string
Returns: the type-id