org.apache.log4j.varia
クラス PriorityMatchFilter

java.lang.Object
  |
  +--org.apache.log4j.spi.Filter
        |
        +--org.apache.log4j.varia.PriorityMatchFilter
すべての実装インタフェース:
OptionHandler

public class PriorityMatchFilter
extends Filter

This is a very simple filter based on priority matching.

これは、優先度のマッチングをベースにしたとても単純なフィルタです。

The filter admits two options PriorityToMatch and AcceptOnMatch. If there is an exact match between the value of the PriorityToMatch option and the priority of the LoggingEvent, then the decide(org.apache.log4j.spi.LoggingEvent) method returns Filter.ACCEPT in case the AcceptOnMatch option value is set to true, if it is false then Filter.DENY is returned. If there is no match, Filter.NEUTRAL is returned.

フィルタは、2つのオプション PriorityToMatchAcceptOnMatch を許容します。 もし、OriorityToMatch オプションの値と LoggingEvent の優先度が完全にマッチする場合は、AcceptOnMatch オプションの値が true に設定されている時に限り、decide(org.apache.log4j.spi.LoggingEvent) メソッドが Filter.ACCEPT を返します。 もし、false が設定されている場合は、Filter.DENY が返されます。 もし、マッチしなければ、Filter.NEUTRAL が返されます。

See configuration files test11.xml and test12.xml for an example of seeting up a PriorityMatchFilter.

PriorityMatchFilter のセットアップの例に関しては、設定ファイル test11.xmltest12.xml を参照してください。

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

フィールドの概要
static String ACCEPT_ON_MATCH_OPTION
          推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

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

static String PRIORITY_TO_MATCH_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.spi.Filter から継承したフィールド
ACCEPT, DENY, NEUTRAL, next
 
コンストラクタの概要
PriorityMatchFilter()
           
 
メソッドの概要
 int decide(LoggingEvent event)
          Return the decision of this filter.
 boolean getAcceptOnMatch()
           
 String[] getOptionStrings()
          Return list of strings that the OptionHandler instance recognizes.
 String getPriorityToMatch()
           
 void setAcceptOnMatch(boolean acceptOnMatch)
           
 void setOption(String key, String value)
          Set option to value.
 void setPriorityToMatch(String priority)
           
 
クラス org.apache.log4j.spi.Filter から継承したメソッド
activateOptions
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

PRIORITY_TO_MATCH_OPTION

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

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


ACCEPT_ON_MATCH_OPTION

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

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

コンストラクタの詳細

PriorityMatchFilter

public PriorityMatchFilter()
メソッドの詳細

getOptionStrings

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

今日、私たちは、コンポーネントの設定には、JavaBeans のイントロスペクションを使用します

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

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


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


setPriorityToMatch

public void setPriorityToMatch(String priority)

getPriorityToMatch

public String getPriorityToMatch()

setAcceptOnMatch

public void setAcceptOnMatch(boolean acceptOnMatch)

getAcceptOnMatch

public boolean getAcceptOnMatch()

decide

public int decide(LoggingEvent event)
Return the decision of this filter.

このフィルターの判定を返します。

Returns Filter.NEUTRAL if the PriorityToMatch option is not set. Otherwise, the returned decision is defined according to the following table:

もし、PriorityToMatch オプションが設定されていない場合、Filter.NEUTRAL を返します。 もしそうでない場合は、返される判定は、次の表に従って定義されます:

Did a priority match occur? AcceptOnMatch setting
TRUE FALSE
TRUE Filter.ACCEPTFilter.DENY
FALSE Filter.DENYFilter.ACCEPT
Filter decision in function of whether a match occured and the AcceptOnMatch settings

優先度がマッチしましたか? AcceptOnMatch 設定
TRUE FALSE
TRUE Filter.ACCEPTFilter.DENY
FALSE Filter.DENYFilter.ACCEPT
マッチしたかどうかの機能でのフィルタの決定とAcceptOnMatch の設定

オーバーライド:
クラス Filter 内の decide
クラス org.apache.log4j.spi.Filter からコピーされたタグ:
パラメータ:
event - The LoggingEvent to decide upon.

event 決定するロギングイベント



Please notify me about new log4j releases.