Log4j 1.3alpha-8

org.apache.log4j.helpers
Class DateLayout

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.Layout
              |
              +--org.apache.log4j.helpers.DateLayout
All Implemented Interfaces:
Component, OptionHandler
Direct Known Subclasses:
TTCCLayout

Deprecated. since 1.3

public abstract class DateLayout
extends Layout

This abstract layout takes care of all the date related options and formatting work.

Author:
Ceki Gülcü

Field Summary
protected  Date date
          Deprecated.  
static 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  DateFormat dateFormat
          Deprecated.  
static String NULL_DATE_FORMAT
          Deprecated. String constant designating no time information.
protected  FieldPosition pos
          Deprecated.  
static String RELATIVE_TIME_DATE_FORMAT
          Deprecated. String constant designating relative time.
static 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.
 
Fields inherited from class org.apache.log4j.Layout
ignoresThrowable, LINE_SEP, LINE_SEP_LEN
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
DateLayout()
          Deprecated. Instantiate a DateLayout object with in the ISO8601 format as the date formatter.
DateLayout(String dateFormatType)
          Deprecated. Instantiate a DateLayout object using the local time zone.
 
Method Summary
 void activateOptions()
          Deprecated. Activate the options that were previously set with calls to option setters.
 void dateFormat(StringBuffer buf, LoggingEvent event)
          Deprecated.  
 String getDateFormat()
          Deprecated. Returns value of the DateFormat option.
 String[] getOptionStrings()
          Deprecated. Use the setter method for the option directly instead of the generic setOption method.
 String getTimeZone()
          Deprecated. Returns value of the TimeZone option.
 void setDateFormat(DateFormat dateFormat, TimeZone timeZone)
          Deprecated. Sets the DateFormat used to format time and date in the zone determined by timeZone.
 void setDateFormat(String dateFormat)
          Deprecated. 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 dateFormatStr, TimeZone timeZone)
          Deprecated.  
 void setOption(String option, String value)
          Deprecated. Use the setter method for the option directly instead of the generic setOption method.
 void setTimeZone(String timeZone)
          Deprecated. The TimeZoneID option is a time zone ID string in the format expected by the TimeZone.getTimeZone(java.lang.String) method.
 
Methods inherited from class org.apache.log4j.Layout
format, getContentType, getFooter, getHeader, ignoresThrowable, setFooter, setHeader, setIgnoresThrowable
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository
 
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 String NULL_DATE_FORMAT
Deprecated. 
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
Deprecated. 
String constant designating relative time. Current value of this constant is RELATIVE.

pos

protected FieldPosition pos
Deprecated. 

DATE_FORMAT_OPTION

public static final 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.


TIMEZONE_OPTION

public static final 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.


dateFormat

protected DateFormat dateFormat
Deprecated. 

date

protected Date date
Deprecated. 
Constructor Detail

DateLayout

public DateLayout()
Deprecated. 
Instantiate a DateLayout object with in the ISO8601 format as the date formatter.

DateLayout

public DateLayout(String dateFormatType)
Deprecated. 
Instantiate a DateLayout object using the local time zone. The DateFormat used will depend on the dateFormatType.

This constructor just calls the setDateFormat(java.lang.String) method.

Method Detail

getOptionStrings

public String[] getOptionStrings()
Deprecated. Use the setter method for the option directly instead of the generic setOption method.


setOption

public void setOption(String option,
                      String value)
Deprecated. Use the setter method for the option directly instead of the generic setOption method.


setDateFormat

public void setDateFormat(String dateFormat)
Deprecated. 
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.

getDateFormat

public String getDateFormat()
Deprecated. 
Returns value of the DateFormat option.

setTimeZone

public void setTimeZone(String timeZone)
Deprecated. 
The TimeZoneID option is a time zone ID string in the format expected by the TimeZone.getTimeZone(java.lang.String) method.

getTimeZone

public String getTimeZone()
Deprecated. 
Returns value of the TimeZone option.

activateOptions

public void activateOptions()
Deprecated. 
Description copied from interface: 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 and Append options both of which are ambigous until the other is also set.


setDateFormat

public void setDateFormat(DateFormat dateFormat,
                          TimeZone timeZone)
Deprecated. 
Sets the DateFormat used to format time and date in the zone determined by timeZone.

setDateFormat

public void setDateFormat(String dateFormatStr,
                          TimeZone timeZone)
Deprecated. 

dateFormat

public void dateFormat(StringBuffer buf,
                       LoggingEvent event)
Deprecated. 

Log4j 1.3alpha-8

Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.