org.apache.log4j.pattern
Class DatePatternConverter
java.lang.Object
|
+--org.apache.log4j.spi.ComponentBase
|
+--org.apache.log4j.pattern.PatternConverter
|
+--org.apache.log4j.pattern.DatePatternConverter
- All Implemented Interfaces:
- Component
- public class DatePatternConverter
- extends PatternConverter
Convert and format the event's date in a StringBuffer.
- Author:
- Ceki Gülcü
Method Summary |
java.lang.StringBuffer |
convert(LoggingEvent event)
Derived pattern converters must override this method in order to
convert conversion specifiers in the correct way.
|
java.lang.String |
getName()
This method returns the name of the conversion pattern.
|
java.lang.String |
getStyleClass(LoggingEvent e)
This method returns the CSS style class that should be applied to
the LoggingEvent passed as parameter, which can be null.
|
void |
setOptions(java.util.List optionList)
The option string can be one of the strings 'DATE', 'ABSOLUTE', 'ISO8601'
or any date and time pattern accepted by java.text.SimpleDateFormat. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatePatternConverter
public DatePatternConverter()
setOptions
public void setOptions(java.util.List optionList)
- The option string can be one of the strings 'DATE', 'ABSOLUTE', 'ISO8601'
or any date and time pattern accepted by java.text.SimpleDateFormat.
- Overrides:
setOptions
in class PatternConverter
- Parameters:
optionList
- list of options, may be null.
convert
public java.lang.StringBuffer convert(LoggingEvent event)
- Description copied from class:
PatternConverter
- Derived pattern converters must override this method in order to
convert conversion specifiers in the correct way.
IMPORTANT: Note that an implementing class may always return the same
StringBuffer instance in order to avoid superflous object creation.
- Specified by:
convert
in class PatternConverter
getName
public java.lang.String getName()
- Description copied from class:
PatternConverter
- This method returns the name of the conversion pattern.
The name can be useful to certain Layouts such as HTMLLayout.
- Specified by:
getName
in class PatternConverter
- Returns:
- the name of the conversion pattern
getStyleClass
public java.lang.String getStyleClass(LoggingEvent e)
- Description copied from class:
PatternConverter
- This method returns the CSS style class that should be applied to
the LoggingEvent passed as parameter, which can be null.
This information is currently used only by HTMLLayout.
- Specified by:
getStyleClass
in class PatternConverter
- Parameters:
e
- null values are accepted
- Returns:
- the name of the conversion pattern
Copyright 2000-2005 Apache Software Foundation.