org.x4juli.formatter.pattern
Class LogRecordPatternConverter

java.lang.Object
  extended byorg.x4juli.global.components.AbstractComponent
      extended byorg.x4juli.formatter.pattern.PatternConverter
          extended byorg.x4juli.formatter.pattern.LogRecordPatternConverter
All Implemented Interfaces:
Component
Direct Known Subclasses:
CurrentlyNotAvailableConverter, DatePatternConverter, FileLocationPatternConverter, FullLocationPatternConverter, LevelPatternConverter, LineLocationPatternConverter, LineSeparatorPatternConverter, LiteralPatternConverter, MessagePatternConverter, MethodLocationPatternConverter, NamePatternConverter, RelativeTimePatternConverter, SequenceNumberPatternConverter, ThreadPatternConverter, ThrowableInformationPatternConverter

public abstract class LogRecordPatternConverter
extends PatternConverter

LogRecordPatternConverter is a base class for pattern converters that can format information from instances of LoggingEvent.

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 Curt Arnold. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Field Summary
 
Fields inherited from class org.x4juli.formatter.pattern.PatternConverter
 
Fields inherited from class org.x4juli.global.components.AbstractComponent
manager, repository
 
Constructor Summary
protected LogRecordPatternConverter(java.lang.String name, java.lang.String style)
          Constructs an instance of LogRecordPatternConverter.
 
Method Summary
abstract  void format(ExtendedLogRecord record, java.lang.StringBuffer toAppendTo)
          Formats an event into a string buffer.
 void format(java.lang.Object obj, java.lang.StringBuffer output)
          Formats an object into a string buffer.
 boolean handlesThrowable()
          Normally pattern converters are not meant to handle Exceptions although few pattern converters might.
 
Methods inherited from class org.x4juli.formatter.pattern.PatternConverter
getMessageProperties, getName, getStyleClass, toString
 
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
 

Constructor Detail

LogRecordPatternConverter

protected LogRecordPatternConverter(java.lang.String name,
                                    java.lang.String style)
Constructs an instance of LogRecordPatternConverter.

Parameters:
name - name of converter.
style - CSS style for output.
Since:
0.5
Method Detail

format

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

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

format

public void format(java.lang.Object obj,
                   java.lang.StringBuffer output)
Formats an object into a string buffer.

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

handlesThrowable

public boolean handlesThrowable()
Normally pattern converters are not meant to handle Exceptions although few pattern converters might. By examining the return values for this method, the containing layout will determine whether it handles throwables or not.

Returns:
true if this PatternConverter handles throwables
Since:
0.5


${license_html}