org.apache.log4j.helpers
Class DateLayout
- OptionHandler
public abstract class DateLayout
This abstract layout takes care of all the date related options and
formatting work.
void | activateOptions()
|
void | dateFormat(StringBuffer buf, LoggingEvent event)
|
String | getDateFormat() - Returns value of the DateFormat option.
|
String[] | getOptionStrings() - Use the setter method for the option directly instead
of the generic
setOption method.
|
String | getTimeZone() - Returns value of the TimeZone option.
|
void | setDateFormat(DateFormat dateFormat, TimeZone timeZone) - Sets the
DateFormat used to format time and date in the
zone determined by timeZone .
|
void | setDateFormat(String dateFormat) - The value of the DateFormat option should be either an
argument to the constructor of
SimpleDateFormat or one of
the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
|
void | setDateFormat(String dateFormatType, TimeZone timeZone) - Sets the DateFormat used to format date and time in the time zone
determined by
timeZone parameter.
|
void | setOption(String option, String value) - Use the setter method for the option directly instead
of the generic
setOption method.
|
void | setTimeZone(String timeZone) - The TimeZoneID option is a time zone ID string in the format
expected by the
TimeZone.getTimeZone method.
|
DATE_FORMAT_OPTION
public static final String DATE_FORMAT_OPTION
Options are now handled using the JavaBeans paradigm.
This constant is not longer needed and will be removed in the
near term.
NULL_DATE_FORMAT
public static final String NULL_DATE_FORMAT
String constant designating no time information. Current value of
this constant is NULL.
RELATIVE_TIME_DATE_FORMAT
public static final String RELATIVE_TIME_DATE_FORMAT
String constant designating relative time. Current value of
this constant is RELATIVE.
TIMEZONE_OPTION
public static final String TIMEZONE_OPTION
Options are now handled using the JavaBeans paradigm.
This constant is not longer needed and will be removed in the
near term.
dateFormat
protected DateFormat dateFormat
pos
protected FieldPosition pos
dateFormat
public void dateFormat(StringBuffer buf,
LoggingEvent event)
getDateFormat
public String getDateFormat()
Returns value of the DateFormat option.
getOptionStrings
public String[] getOptionStrings()
Use the setter method for the option directly instead
of the generic setOption
method.
getTimeZone
public String getTimeZone()
Returns value of the TimeZone option.
setDateFormat
public void setDateFormat(DateFormat dateFormat,
TimeZone timeZone)
Sets the DateFormat
used to format time and date in the
zone determined by timeZone
.
setDateFormat
public void setDateFormat(String dateFormat)
The value of the DateFormat option should be either an
argument to the constructor of SimpleDateFormat
or one of
the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
setDateFormat
public void setDateFormat(String dateFormatType,
TimeZone timeZone)
setOption
public void setOption(String option,
String value)
Use the setter method for the option directly instead
of the generic setOption
method.
setTimeZone
public void setTimeZone(String timeZone)
The TimeZoneID option is a time zone ID string in the format
expected by the TimeZone.getTimeZone
method.
Copyright 2000-2005 Apache Software Foundation.