org.apache.avalon.logging.logkit
Class StandardFormatter
java.lang.Object
org.apache.log.format.PatternFormatter
org.apache.log.format.ExtendedPatternFormatter
org.apache.avalon.logging.logkit.StandardFormatter
- All Implemented Interfaces:
- Formatter
- public class StandardFormatter
- 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:
- CVS $Revision: 1.3 $ $Date: 2004/03/17 10:50:04 $
- Author:
- Avalon Development Team
Constructor Summary |
StandardFormatter(String pattern)
Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth of 8. |
StandardFormatter(String pattern,
boolean trace)
Construct the formatter with the specified pattern
and which which prints out exceptions to stackDepth specified. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_STACKTRACE_POLICY
public static final boolean DEFAULT_STACKTRACE_POLICY
- See Also:
- Constant Field Values
StandardFormatter
public StandardFormatter(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- Since:
- 1.0
StandardFormatter
public StandardFormatter(String pattern,
boolean trace)
- 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 entriestrace
- if TRUE generate a stack trace- Since:
- 1.0
getStackTrace
protected String getStackTrace(Throwable throwable,
String format)
- Utility method to format stack trace.
- Parameters:
throwable
- the throwable instanceformat
- ancilliary format parameter - allowed to be null
- Returns:
- the formatted string
getTypeIdFor
protected int getTypeIdFor(String type)
- Retrieve the type-id for a particular string.
- Parameters:
type
- the string
- Returns:
- the type-id
formatPatternRun
protected String formatPatternRun(LogEvent event,
PatternFormatter.PatternRun run)
- Return the result of formaltting a pattern run.
- Parameters:
event
- the log eventrun
- the patter formatter pattern run
- Returns:
- the formatted string
Copyright © The Apache Software Foundation. All Rights Reserved.