org.apache.log4j.helpers
public abstract class DateLayout extends Layout
Field Summary | |
---|---|
protected Date | date |
protected DateFormat | dateFormat |
static String | DATE_FORMAT_OPTION |
static String | NULL_DATE_FORMAT
String constant designating no time information. |
protected FieldPosition | pos |
static String | RELATIVE_TIME_DATE_FORMAT
String constant designating relative time. |
static String | TIMEZONE_OPTION |
Method Summary | |
---|---|
void | activateOptions() |
void | dateFormat(StringBuffer buf, LoggingEvent event) |
String | getDateFormat()
Returns value of the DateFormat option. |
String[] | getOptionStrings() |
String | getTimeZone()
Returns value of the TimeZone option. |
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(DateFormat dateFormat, TimeZone timeZone)
Sets the DateFormat used to format time and date in the
zone determined by timeZone . |
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) |
void | setTimeZone(String timeZone)
The TimeZoneID option is a time zone ID string in the format
expected by the TimeZone#getTimeZone method. |
Deprecated: Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
Deprecated: Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
Deprecated: Use the setter method for the option directly instead
of the generic setOption
method.
timeZone
.timeZone
parameter. The DateFormat used
will depend on the dateFormatType
.
The recognized types are NULL_DATE_FORMAT, RELATIVE_TIME_DATE_FORMAT ABS_TIME_DATE_FORMAT, DATE_AND_TIME_DATE_FORMAT and ISO8601_DATE_FORMAT. If the
dateFormatType
is not one of the above, then the
argument is assumed to be a date pattern for SimpleDateFormat.
Deprecated: Use the setter method for the option directly instead
of the generic setOption
method.