org.apache.log4j
インタフェース Appender

既知の実装クラスの一覧:
AppenderSkeleton

public interface Appender

Implement this interface for your own strategies for printing log statements.

あなた自身の運営においてログステートメントを出力するには、このインタフェースを実装します。

作成者:
Ceki Gülcü

メソッドの概要
 void addFilter(Filter newFilter)
          Add a filter to the end of the filter list.
 void clearFilters()
          Clear the list of filters by removing all the filters in it.
 void close()
          Release any resources allocated within the appender such as file handles, network connections, etc.
 void doAppend(LoggingEvent event)
          Log in Appender specific way.
 ErrorHandler getErrorHandler()
          Returns the ErrorHandler for this appender.
 Filter getFilter()
          Returns the head Filter.
 Layout getLayout()
          Returns this appenders layout.
 String getName()
          Get the name of this appender.
 boolean requiresLayout()
          Configurators call this method to determine if the appender requires a layout.
 void setErrorHandler(ErrorHandler errorHandler)
          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.
 

メソッドの詳細

addFilter

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

フィルタのリストの最後に新規のフィルタを追加します。

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

getFilter

public Filter getFilter()
Returns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result.

先頭のフィルタを返します。フィルタは、リンクトリストとして管理されているので、アペンダー上の全てのフィルタは、この結果を通して利用可能になります。

戻り値:
the head Filter or null, if no Filters are present

先頭のフィルタまたは全くフィルタが存在しなければ、nullを返します。

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

clearFilters

public void clearFilters()
Clear the list of filters by removing all the filters in it.

リスト内の全てのフィルタを削除することで、フィルタのリストをクリアします。

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

close

public void close()
Release any resources allocated within the appender such as file handles, network connections, etc.

ファイルハンドルや、ネットワークのコネクションなどの、アペンダー内に位置づけられたリソースを開放します。

It is a programming error to append to a closed appender.

閉じたアペンダーに追加しようとするとプログラミングエラーになります。

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

doAppend

public void doAppend(LoggingEvent event)
Log in Appender specific way.

設定した通りに、アペンダーにログを出力します。


getName

public String getName()
Get the name of this appender. The name uniquely identifies the appender.

このアペンダーの名前を返します。名前は、ユニークにアペンダーを認識させます。


setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Set the ErrorHandler for this appender.

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


getErrorHandler

public ErrorHandler getErrorHandler()
Returns the ErrorHandler for this appender.

このアペンダーに関する、ErrorHandlerを返します。

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

setLayout

public void setLayout(Layout layout)
Set the Layout for this appender.

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

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

getLayout

public Layout getLayout()
Returns this appenders layout.

このアペンダーのレイアウトを返します。

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

setName

public void setName(String name)
Set the name of this appender. The name is used by other components to identify this appender.

このアペンダーに名前を設定します。名前は、このアペンダーを一意づける他のコンポーネントによって使用されます。

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

requiresLayout

public boolean requiresLayout()
Configurators call this method to determine if the appender requires a layout. If this method returns true, meaning that layout is required, then the configurator will configure an layout using the configuration information at its disposal. If this method returns false, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator..

コンフィギュレータが、アペンダーがレイアウトを要求するかどうかを決定するためこのメソッドを呼び出します。このメソッドが、trueを返した場合は、レイアウトが要求されないことを表します。その時、コンフィギュレータは、その処理でコンフィギュレーションの情報を使うレイアウトを構築します。このメソッドが、falseを返した場合は、レイアウトが要求されないことを表します。その時、レイアウトのコンフィギュレーションは、コンフィギュレータの処理で利用可能なレイアウトのコンフィギュレーション情報の有無にかかわらずスキップされます...

In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return true.

かなり例外的なケースとして、アペンダーの実装クラスでレイアウトを許容するが、処理できない場合であっても、アペンダーは、trueを返すようになっています。

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


Please notify me about new log4j releases.