org.apache.log4j.helpers
クラス DateLayout

java.lang.Object
  |
  +--org.apache.log4j.Layout
        |
        +--org.apache.log4j.helpers.DateLayout
すべての実装インタフェース:
OptionHandler
直系の既知のサブクラス:
TTCCLayout

public abstract class DateLayout
extends Layout

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

この抽象レイアウトクラスは、全ての日付関連のオプションとフォーマット作業のお世話をします。

作成者:
Ceki Gülcü

フィールドの概要
protected  Date date
           
static 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.

今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。

protected  DateFormat dateFormat
           
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
          推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。

 
クラス org.apache.log4j.Layout から継承したフィールド
LINE_SEP, LINE_SEP_LEN
 
コンストラクタの概要
DateLayout()
           
 
メソッドの概要
 void activateOptions()
          Activate the options that were previously set with calls to option setters.
 void dateFormat(StringBuffer buf, LoggingEvent event)
           
 String getDateFormat()
          Returns value of the DateFormat option.
 String[] getOptionStrings()
          Return list of strings that the OptionHandler instance recognizes.
 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)
          Set option to value.
 void setTimeZone(String timeZone)
          The TimeZoneID option is a time zone ID string in the format expected by the TimeZone.getTimeZone(java.lang.String) method.
 
クラス org.apache.log4j.Layout から継承したメソッド
format, getContentType, getFooter, getHeader, ignoresThrowable
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

NULL_DATE_FORMAT

public static final String NULL_DATE_FORMAT
String constant designating no time information. Current value of this constant is NULL.

時間情報を指定しない時に使用する文字列定数です。 この定数の現在の値は、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.

時間を関連づけるよう指定するための文字列定数です。 この定数の現在の値は、RELATIVEです。


pos

protected FieldPosition pos

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.

今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。


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.

今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。


dateFormat

protected DateFormat dateFormat

date

protected Date date
コンストラクタの詳細

DateLayout

public DateLayout()
メソッドの詳細

getOptionStrings

public String[] getOptionStrings()
推奨されていません。 Use the setter method for the option directly instead of the generic setOption method.

一般的なsetOptionメソッドの代わりに直接オプションのためのセッタメソッドを使用します。

インタフェース OptionHandler の記述:
Return list of strings that the OptionHandler instance recognizes.

OptionHandlerインスタンスが認識する文字列のリストを返します。


setOption

public void setOption(String option,
                      String value)
推奨されていません。 Use the setter method for the option directly instead of the generic setOption method.

一般的なsetOptionメソッドの代わりに直接オプションのためのセッタメソッドを使用します。

インタフェース OptionHandler の記述:
Set option to value.

オプション に設定します。

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when OptionHandler.activateOptions() is called.

各オプションの処理は、OptionHandlerのインスタンスに依存します。 いくつかのオプションは、直ぐに有効になりますが、その他は OptionHandler.activateOptions()が呼ばれる時にだけ有効になります。


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.

DateFormatオプションの値は、SimpleDateFormatのコンストラクタの引数か、文字列 "NULL"、"RELATIVE"、"ABSOLUTE"、"DATE"または"ISO8601"のうちのひとつになります。


getDateFormat

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

DateFormatオプションの値を返します。


setTimeZone

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

TimeZoneID オプションは、TimeZone.getTimeZone(java.lang.String) メソッドで求められるフォーマットを使ったタイムゾーンID文字列です。


getTimeZone

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

TimeZone オプションの値を返します。


activateOptions

public void activateOptions()
インタフェース 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.

例えば、FileAppenderは、FileAppend の2つのオプションを持っていますが、その他のオプションもセットされるまで曖昧です。


dateFormat

public void dateFormat(StringBuffer buf,
                       LoggingEvent event)

setDateFormat

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

timeZoneにより決定されるゾーンでの時間と日付をフォーマットする際に使われる DateFormat を設定します。


setDateFormat

public void setDateFormat(String dateFormatType,
                          TimeZone timeZone)
Sets the DateFormat used to format date and time in the time zone determined by timeZone parameter. The DateFormat used will depend on the dateFormatType.

timeZone パラメタにより決定されるゾーンでの日付と時間をフォーマットする際に使われる DateFormat を設定します。 使用される DateFormat は、dateFormatType に依存します。

The recognized types are NULL_DATE_FORMAT, RELATIVE_TIME_DATE_FORMAT AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT, AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT and AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT. If the dateFormatType is not one of the above, then the argument is assumed to be a date pattern for SimpleDateFormat.

認識可能やタイプとして、NULL_DATE_FORMATRELATIVE_TIME_DATE_FORMATAbsoluteTimeDateFormat.ABS_TIME_DATE_FORMATAbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMATAbsoluteTimeDateFormat.ISO8601_DATE_FORMATがあります。 もし、dateFormatTypeが上記のどれにも該当しない場合、引数は、SimpleDateFormatに関する日付パタンと仮定されます。



Please notify me about new log4j releases.