org.x4juli.formatter.pattern
Class ThrowableInformationPatternConverter

java.lang.Object
  extended byorg.x4juli.global.components.AbstractComponent
      extended byorg.x4juli.formatter.pattern.PatternConverter
          extended byorg.x4juli.formatter.pattern.LogRecordPatternConverter
              extended byorg.x4juli.formatter.pattern.ThrowableInformationPatternConverter
All Implemented Interfaces:
Component

public class ThrowableInformationPatternConverter
extends LogRecordPatternConverter

Outputs the ThrowableInformation portion of the LoggingiEvent as a full stacktrace unless this converter's option is 'short', where it just outputs the first line of the trace.

Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Paul Smith. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Field Summary
private  java.lang.String option
          If "short", only first line of throwable report will be formatted.
 
Fields inherited from class org.x4juli.formatter.pattern.PatternConverter
 
Fields inherited from class org.x4juli.global.components.AbstractComponent
manager, repository
 
Constructor Summary
private ThrowableInformationPatternConverter(java.lang.String[] options)
          Private constructor.
 
Method Summary
 void format(ExtendedLogRecord record, java.lang.StringBuffer toAppendTo)
          Formats an event into a string buffer.
 boolean handlesThrowable()
          This converter obviously handles throwables.
static ThrowableInformationPatternConverter newInstance(java.lang.String[] options)
          Gets an instance of the class.
 java.lang.String toString()
          
 
Methods inherited from class org.x4juli.formatter.pattern.LogRecordPatternConverter
format
 
Methods inherited from class org.x4juli.formatter.pattern.PatternConverter
getMessageProperties, getName, getStyleClass
 
Methods inherited from class org.x4juli.global.components.AbstractComponent
getLogger, getLoggerRepository, getNonFloodingLogger, getProperty, getProperty, getProperty, getProperty, resetErrorCount, setObjectStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

option

private final java.lang.String option
If "short", only first line of throwable report will be formatted.

Constructor Detail

ThrowableInformationPatternConverter

private ThrowableInformationPatternConverter(java.lang.String[] options)
Private constructor.

Parameters:
options - options, may be null.
Method Detail

newInstance

public static ThrowableInformationPatternConverter newInstance(java.lang.String[] options)
Gets an instance of the class.

Parameters:
options - pattern options, may be null. If first element is "short", only the first line of the throwable will be formatted.
Returns:
instance of class.
Since:
0.5

format

public void format(ExtendedLogRecord record,
                   java.lang.StringBuffer toAppendTo)
Formats an event into a string buffer.

Specified by:
format in class LogRecordPatternConverter
Parameters:
record - to format, may not be null.
toAppendTo - string buffer to which the formatted event will be appended. May not be null.
Since:
0.5

handlesThrowable

public boolean handlesThrowable()
This converter obviously handles throwables.

Overrides:
handlesThrowable in class LogRecordPatternConverter
Returns:
true.

toString

public java.lang.String toString()

Overrides:
toString in class PatternConverter
Since:
0.5


${license_html}