org.apache.log4j
クラス AppenderSkeleton

java.lang.Object
  |
  +--org.apache.log4j.AppenderSkeleton
すべての実装インタフェース:
Appender, OptionHandler
直系の既知のサブクラス:
AsyncAppender, JMSAppender, NTEventLogAppender, NullAppender, SMTPAppender, SocketAppender, SyslogAppender, WriterAppender

public abstract class AppenderSkeleton
extends Object
implements Appender, OptionHandler

Abstract superclass of the other appenders in the package.

パッケージ内の他のアペンダーの抽象クラスです。

This class provides the code for common functionality, such as support for threshold filtering and support for general filters.

このクラスは、共通的な機能に関する、閾値フィルタリングのサポートや一般的なフィルターのサポートのようなコードを提供します。

導入されたバージョン:
0.8.1
作成者:
Ceki Gülcü

フィールドの概要
protected  boolean closed
          Is this appender closed?
protected  ErrorHandler errorHandler
          It is assumed and enforced that errorHandler is never null.
protected  Filter headFilter
          The first filter in the filter chain.
protected  Layout layout
          The layout variable does not need to be set if the appender implementation has its own layout.
protected  String name
          Appenders are named.
protected  Filter tailFilter
          The last filter in the filter chain.
protected  Priority threshold
          There is no priority threshold filtering by default.
static String THRESHOLD_OPTION
          推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

オプションは、現在JavaBeansのパラダイムで使うために処理されます。 この不変数は、もはや必要とされません。そして、近いうちに削除される予定です。

 
コンストラクタの概要
AppenderSkeleton()
           
 
メソッドの概要
 void activateOptions()
          Derived appenders should override this method if option structure requires it.
 void addFilter(Filter newFilter)
          Add a filter to end of the filter list.
protected abstract  void append(LoggingEvent event)
          Subclasses of AppenderSkeleton should implement this method to perform actual logging.
 void clearFilters()
          Clear the filters chain.
 void doAppend(LoggingEvent event)
          This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific append(org.apache.log4j.spi.LoggingEvent) method.
 void finalize()
          Finalize this appender by calling the imlenentation's close method.
 ErrorHandler getErrorHandler()
          Return the currently set ErrorHandler for this Appender.
 Filter getFilter()
          Returns the head Filter.
 Filter getFirstFilter()
          Return the first filter in the filter chain for this Appender.
 Layout getLayout()
          Returns the layout of this appender.
 String getName()
          Returns the name of this FileAppender.
 String[] getOptionStrings()
          推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed.

われわれは、現在、コンポーネントを設定するためにJavaBeansのイントロスペクションをつかいます。 オプション文字列は、今後必要なくなります。

 Priority getThreshold()
          Returns this appenders threshold priority.
 boolean isAsSevereAsThreshold(Priority priority)
          Check whether the message priority is below the appender's threshold.
 void setErrorHandler(ErrorHandler eh)
          Set the ErrorHandler for this Appender.
 void setLayout(Layout layout)
          Set the layout for this appender.
 void setName(String name)
          Set the name of this Appender.
 void setOption(String key, String value)
          Set option to value.
 void setThreshold(Priority threshold)
          Set the threshold priority.
 
クラス java.lang.Object から継承したメソッド
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.apache.log4j.Appender から継承したメソッド
close, requiresLayout
 

フィールドの詳細

THRESHOLD_OPTION

public static final String THRESHOLD_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

オプションは、現在JavaBeansのパラダイムで使うために処理されます。 この不変数は、もはや必要とされません。そして、近いうちに削除される予定です。

A string constant used in naming the option for setting the threshold for the appender. See also setThreshold method. Current value of this string constant is Threshold.

アペンダーに境界値を設定するためのオプションを指定する際に使われる文字列定数です。 setThreshold(org.apache.log4j.Priority)メソッドを参照してください。この文字列定数の現在の値は、Thresholdです。


layout

protected Layout layout
The layout variable does not need to be set if the appender implementation has its own layout.

アペンダーの実装クラスが自分のレイアウトを保持している場合、レイアウト変数が、設定されている必要はありません。


name

protected String name
Appenders are named.

threshold

protected Priority threshold
There is no priority threshold filtering by default.

デフォルトでは、閾値フィルタリングの優先順位はありません。


errorHandler

protected ErrorHandler errorHandler
It is assumed and enforced that errorHandler is never null.

errorHandlerが絶対にnullでないことが想定かつ強制されます。


headFilter

protected Filter headFilter
The first filter in the filter chain. Set to null initially.

フィルターチェインの最初のフィルタです。 初期値では、nullに設定されています。


tailFilter

protected Filter tailFilter
The last filter in the filter chain.

フィルタチェインの最終端のフィルタです。


closed

protected boolean closed
Is this appender closed?

アペンダーがクローズされたかどうか?

コンストラクタの詳細

AppenderSkeleton

public AppenderSkeleton()
メソッドの詳細

activateOptions

public void activateOptions()
Derived appenders should override this method if option structure requires it.

派生したアペンダーは、オプション構造がこのメソッドを要求する場合、このメソッドをオーバーライドする必要がある。

定義:
インタフェース OptionHandler 内の activateOptions

addFilter

public void addFilter(Filter newFilter)
Add a filter to end of the filter list.

フィルタのリストの終端に新規のフィルタを追加する。

定義:
インタフェース Appender 内の addFilter
導入されたバージョン:
0.9.0

append

protected abstract void append(LoggingEvent event)
Subclasses of AppenderSkeleton should implement this method to perform actual logging. See also AppenderSkeleton.doAppend method.

AppenderSkeletonのサブクラスは実際にロギングを行うためにこのメソッドを実装する必要があります。 AppenderSkeleton.doAppendメソッドを参照してください。

導入されたバージョン:
0.9.0

clearFilters

public void clearFilters()
Clear the filters chain.

フィルタチェインをクリアします。

定義:
インタフェース Appender 内の clearFilters
導入されたバージョン:
0.9.0

finalize

public void finalize()
Finalize this appender by calling the imlenentation's close method.

実装クラスのcloseメソッドを呼ぶことでこのアペンダーをファイナライズします。

オーバーライド:
クラス Object 内の finalize
導入されたバージョン:
0.8.4

getErrorHandler

public ErrorHandler getErrorHandler()
Return the currently set ErrorHandler for this Appender.

このアペンダに現在設定されているErrorHandlerを返します。

定義:
インタフェース Appender 内の getErrorHandler
導入されたバージョン:
0.9.0

getFilter

public Filter getFilter()
Returns the head Filter.

先頭のフィルタを返します。

定義:
インタフェース Appender 内の getFilter
導入されたバージョン:
1.1

getFirstFilter

public final Filter getFirstFilter()
Return the first filter in the filter chain for this Appender. The return value may be null if no is filter is set.

このアペンダに関するフィルタチェイン内にある最初のフィルタを返します。 もしフィルタが設定されていなければ、戻り値は、nullかもしれません。


getLayout

public Layout getLayout()
Returns the layout of this appender. The value may be null.

このアペンダのレイアウトを返します。値はnull かもしれません。

定義:
インタフェース Appender 内の getLayout

getName

public final String getName()
Returns the name of this FileAppender.

このFileAppenderの名前を返します。

定義:
インタフェース Appender 内の getName

getOptionStrings

public String[] getOptionStrings()
推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed.

われわれは、現在、コンポーネントを設定するためにJavaBeansのイントロスペクションをつかいます。 オプション文字列は、今後必要なくなります。

Returns the string array {THRESHOLD_OPTION}.

THRESHOLD_OPTIONの文字列配列を返します。

Configurable appenders must override this method to return the additional options they accept.

コンフィグ可能なアペンダは、それらが受け入れられる追加オプションを返すためにこのメソッドをオーバーライドする必要があります。

定義:
インタフェース OptionHandler 内の getOptionStrings

getThreshold

public Priority getThreshold()
Returns this appenders threshold priority. See the setThreshold(org.apache.log4j.Priority) method for the meaning of this option.

このアペンダの閾値の優先度を返します。 このオプションの使い方については、setThreshold(org.apache.log4j.Priority)メソッドを参照してください。

導入されたバージョン:
1.1

isAsSevereAsThreshold

public boolean isAsSevereAsThreshold(Priority priority)
Check whether the message priority is below the appender's threshold. If there is no threshold set, then the return value is always true.

メッセージの優先度がアペンダの閾値より下回っているかをチェックします。 もし閾値の設定がない場合、その時は、戻り値は、必ずtrueです。


doAppend

public void doAppend(LoggingEvent event)
This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific append(org.apache.log4j.spi.LoggingEvent) method.

このメソッドは、閾値のチェックを行い、append(org.apache.log4j.spi.LoggingEvent)メソッドで設定したサブクラスに対し、実際にロギング処理を委譲する前に、フィルタリングを行います。

定義:
インタフェース Appender 内の doAppend

setErrorHandler

public void setErrorHandler(ErrorHandler eh)
Set the ErrorHandler for this Appender.

このアペンダに対し、ErrorHandlerを設定します。

定義:
インタフェース Appender 内の setErrorHandler
導入されたバージョン:
0.9.0

setLayout

public void setLayout(Layout layout)
Set the layout for this appender. Note that some appenders have their own (fixed) layouts or do not use one. For example, the SocketAppender ignores the layout set here.

このアペンダにレイアウトを設定します。 アペンダのいくつかは、自分自身で(固定の)レイアウトを保持していますが、それを使うわけではありません。 例えば、SocketAppenderはここに設定するレイアウトを無視します。

定義:
インタフェース Appender 内の setLayout

setName

public void setName(String name)
Set the name of this Appender.

このアペンダに名前を設定します。

定義:
インタフェース Appender 内の setName

setOption

public void setOption(String key,
                      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()が呼ばれる時にだけ有効になります。

定義:
インタフェース OptionHandler 内の setOption

setThreshold

public void setThreshold(Priority threshold)
Set the threshold priority. All log events with lower priority than the threshold priority are ignored by the appender.

閾値の優先度を設定します。 閾値の優先度より低い優先度をもつ全てのログイベントは、アペンダに無視されます。

In configuration files this option is specified by setting the value of the Threshold option to a priority string, such as "DEBUG", "INFO" and so on.

設定ファイルでこのオプションは、閾値を"DEBUG"や"INFO"などなどの優先度文字列に置き換えることで設定されます。

導入されたバージョン:
0.8.3


Please notify me about new log4j releases.