org.apache.avalon.logging.logkit
Class StandardFormatter

java.lang.Object
  extended byorg.apache.log.format.PatternFormatter
      extended byorg.apache.log.format.ExtendedPatternFormatter
          extended byorg.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.

Version:
CVS $Revision: 1.3 $ $Date: 2004/03/17 10:50:04 $
Author:
Avalon Development Team

Nested Class Summary
 
Nested classes inherited from class org.apache.log.format.PatternFormatter
PatternFormatter.PatternRun
 
Field Summary
static boolean DEFAULT_STACKTRACE_POLICY
           
 
Fields inherited from class org.apache.log.format.PatternFormatter
MAX_TYPE
 
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.
 
Method Summary
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.
 
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

DEFAULT_STACKTRACE_POLICY

public static final boolean DEFAULT_STACKTRACE_POLICY
See Also:
Constant Field Values
Constructor Detail

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 entries
trace - if TRUE generate a stack trace
Since:
1.0
Method Detail

getStackTrace

protected String getStackTrace(Throwable throwable,
                               String format)
Utility method to format stack trace.

Parameters:
throwable - the throwable instance
format - 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 event
run - the patter formatter pattern run
Returns:
the formatted string


Copyright © The Apache Software Foundation. All Rights Reserved.