|
|||||||||
| Home >> All >> org >> apache >> log4j >> [ helpers overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.log4j.helpers
Class DateLayout

java.lang.Objectorg.apache.log4j.Layout
org.apache.log4j.helpers.DateLayout
- All Implemented Interfaces:
- org.apache.log4j.spi.OptionHandler
- public abstract class DateLayout
- extends org.apache.log4j.Layout
This abstract layout takes care of all the date related options and formatting work.
| Field Summary | |
protected java.util.Date |
date
|
static java.lang.String |
DATE_FORMAT_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. |
protected java.text.DateFormat |
dateFormat
|
private java.lang.String |
dateFormatOption
|
static java.lang.String |
NULL_DATE_FORMAT
String constant designating no time information. |
protected java.text.FieldPosition |
pos
|
static java.lang.String |
RELATIVE_TIME_DATE_FORMAT
String constant designating relative time. |
static java.lang.String |
TIMEZONE_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. |
private java.lang.String |
timeZoneID
|
| Fields inherited from class org.apache.log4j.Layout |
LINE_SEP, LINE_SEP_LEN |
| Constructor Summary | |
DateLayout()
|
|
| Method Summary | |
void |
activateOptions()
Activate the options that were previously set with calls to option setters. |
void |
dateFormat(java.lang.StringBuffer buf,
org.apache.log4j.spi.LoggingEvent event)
|
java.lang.String |
getDateFormat()
Returns value of the DateFormat option. |
java.lang.String[] |
getOptionStrings()
Deprecated. Use the setter method for the option directly instead of the generic setOption method. |
java.lang.String |
getTimeZone()
Returns value of the TimeZone option. |
void |
setDateFormat(java.text.DateFormat dateFormat,
java.util.TimeZone timeZone)
Sets the java.text.DateFormat used to format time and date in the zone determined by timeZone. |
void |
setDateFormat(java.lang.String dateFormat)
The value of the DateFormat option should be either an argument to the constructor of java.text.SimpleDateFormat or one of the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601. |
void |
setDateFormat(java.lang.String dateFormatType,
java.util.TimeZone timeZone)
Sets the DateFormat used to format date and time in the time zone determined by timeZone parameter. |
void |
setOption(java.lang.String option,
java.lang.String value)
Deprecated. Use the setter method for the option directly instead of the generic setOption method. |
void |
setTimeZone(java.lang.String timeZone)
The TimeZoneID option is a time zone ID string in the format expected by the TimeZone.getTimeZone(java.lang.String)> TimeZone.getTimeZone(java.lang.String) 55 method. |
| Methods inherited from class org.apache.log4j.Layout |
format, getContentType, getFooter, getHeader, ignoresThrowable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
NULL_DATE_FORMAT
public static final java.lang.String NULL_DATE_FORMAT
- String constant designating no time information. Current value of
this constant is NULL.
- See Also:
- Constant Field Values
RELATIVE_TIME_DATE_FORMAT
public static final java.lang.String RELATIVE_TIME_DATE_FORMAT
- String constant designating relative time. Current value of
this constant is RELATIVE.
- See Also:
- Constant Field Values
pos
protected java.text.FieldPosition pos
DATE_FORMAT_OPTION
public static final java.lang.String DATE_FORMAT_OPTION
- Deprecated. Options are now handled using the JavaBeans paradigm.
This constant is not longer needed and will be removed in the
near term.
- See Also:
- Constant Field Values
TIMEZONE_OPTION
public static final java.lang.String TIMEZONE_OPTION
- Deprecated. Options are now handled using the JavaBeans paradigm.
This constant is not longer needed and will be removed in the
near term.
- See Also:
- Constant Field Values
timeZoneID
private java.lang.String timeZoneID
dateFormatOption
private java.lang.String dateFormatOption
dateFormat
protected java.text.DateFormat dateFormat
date
protected java.util.Date date
| Constructor Detail |
DateLayout
public DateLayout()
| Method Detail |
getOptionStrings
public java.lang.String[] getOptionStrings()
- Deprecated. Use the setter method for the option directly instead
of the generic
setOptionmethod.
setOption
public void setOption(java.lang.String option, java.lang.String value)
- Deprecated. Use the setter method for the option directly instead
of the generic
setOptionmethod.
setDateFormat
public void setDateFormat(java.lang.String dateFormat)
- The value of the DateFormat option should be either an
argument to the constructor of java.text.SimpleDateFormat or one of
the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
getDateFormat
public java.lang.String getDateFormat()
- Returns value of the DateFormat option.
setTimeZone
public void setTimeZone(java.lang.String timeZone)
- The TimeZoneID option is a time zone ID string in the format
expected by the TimeZone.getTimeZone(java.lang.String)>
TimeZone.getTimeZone(java.lang.String)55 method.
getTimeZone
public java.lang.String getTimeZone()
- Returns value of the TimeZone option.
activateOptions
public void activateOptions()
- Description copied from interface:
org.apache.log4j.spi.OptionHandler - Activate the options that were previously set with calls to option
setters.
This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.
For example, the FileAppender has the File 55 and Append 55 options both of which are ambigous until the other is also set.
dateFormat
public void dateFormat(java.lang.StringBuffer buf, org.apache.log4j.spi.LoggingEvent event)
setDateFormat
public void setDateFormat(java.text.DateFormat dateFormat, java.util.TimeZone timeZone)
- Sets the java.text.DateFormat used to format time and date in the
zone determined by
timeZone.
setDateFormat
public void setDateFormat(java.lang.String dateFormatType, java.util.TimeZone timeZone)
- Sets the DateFormat used to format date and time in the time zone
determined by
timeZoneparameter. The java.text.DateFormat used will depend on thedateFormatType.The recognized types are
NULL_DATE_FORMAT55 ,RELATIVE_TIME_DATE_FORMAT55AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT55 ,AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT55 andAbsoluteTimeDateFormat.ISO8601_DATE_FORMAT55 . If thedateFormatTypeis not one of the above, then the argument is assumed to be a date pattern for java.text.SimpleDateFormat.
|
|||||||||
| Home >> All >> org >> apache >> log4j >> [ helpers overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC