org.x4juli.formatter.pattern
Class RelativeTimePatternConverter

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.RelativeTimePatternConverter
All Implemented Interfaces:
Component

public class RelativeTimePatternConverter
extends LogRecordPatternConverter

Return the relative time in milliseconds since loading of the LoggingEvent class.

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 Ceki Gülcü. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Nested Class Summary
private static class RelativeTimePatternConverter.CachedTimestamp
          Cached timestamp and formatted value.
 
Field Summary
private  RelativeTimePatternConverter.CachedTimestamp lastTimestamp
          Cached formatted timestamp.
 
Fields inherited from class org.x4juli.formatter.pattern.PatternConverter
 
Fields inherited from class org.x4juli.global.components.AbstractComponent
manager, repository
 
Constructor Summary
RelativeTimePatternConverter()
          Private constructor.
 
Method Summary
 void format(ExtendedLogRecord record, java.lang.StringBuffer toAppendTo)
          Formats an event into a string buffer.
static RelativeTimePatternConverter newInstance(java.lang.String[] options)
          Obtains an instance of RelativeTimePatternConverter.
 
Methods inherited from class org.x4juli.formatter.pattern.LogRecordPatternConverter
format, handlesThrowable
 
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
 

Field Detail

lastTimestamp

private RelativeTimePatternConverter.CachedTimestamp lastTimestamp
Cached formatted timestamp.

Constructor Detail

RelativeTimePatternConverter

public RelativeTimePatternConverter()
Private constructor.

Method Detail

newInstance

public static RelativeTimePatternConverter newInstance(java.lang.String[] options)
Obtains an instance of RelativeTimePatternConverter.

Parameters:
options - options, currently ignored, may be null.
Returns:
instance of RelativeTimePatternConverter.

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


${license_html}