|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--org.apache.log4j.AppenderSkeleton
|
+--org.apache.log4j.net.SMTPAppender
Send an e-mail when a specific logging event occurs, typically on errors or fatal errors.
指定したロギングイベントが、一般的には、エラーまたは致命的エラー上で発生した時、電子メールを送信します。
The number of logging events delivered in this e-mail depend on
the value of BufferSize option. The
SMTPAppender keeps only the last
BufferSize logging events in its cyclic buffer. This
keeps memory requirements at a reasonable level while still
delivering useful application context.
この電子メールに出力されるロギングイベントの数は、BufferSize オプションの値により決まります。
SMTPAppender は、循環バッファ内に最終的な BufferSizeのロギングイベントを保持します。
これにより、有効なアプリケーションのコンテキストを書き込む間、納得のいくレベルでメモリを要求し続けます。
| フィールドの概要 | |
static String |
BUFFER_SIZE_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
protected CyclicBuffer |
cb
|
protected TriggeringEventEvaluator |
evaluator
|
static String |
EVALUATOR_CLASS_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
static String |
FROM_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
static String |
LOCATION_INFO_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
protected javax.mail.Message |
msg
|
static String |
SMTP_HOST_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
static String |
SUBJECT_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
static String |
TO_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。 |
| クラス org.apache.log4j.AppenderSkeleton から継承したフィールド |
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION |
| コンストラクタの概要 | |
SMTPAppender()
The default constructor will instantiate the appender with a TriggeringEventEvaluator that will trigger on events with
priority ERROR or higher.
|
|
SMTPAppender(TriggeringEventEvaluator evaluator)
Use evaluator passed as parameter as the TriggeringEventEvaluator for this SMTPAppender.
|
|
| メソッドの概要 | |
void |
activateOptions()
Activate the specified options, such as the smtp host, the recipient, from, etc. |
void |
append(LoggingEvent event)
Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent. |
protected boolean |
checkEntryConditions()
This method determines if there is a sense in attempting to append. |
void |
close()
Release any resources allocated within the appender such as file handles, network connections, etc. |
int |
getBufferSize()
Returns value of the BufferSize option. |
String |
getEvaluatorClass()
Returns value of the EvaluatorClass option. |
String |
getFrom()
Returns value of the From option. |
boolean |
getLocationInfo()
Returns value of the LocationInfo option. |
String[] |
getOptionStrings()
推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed. 今日、私たちは、コンポーネントの設定には、JavaBeansのイントロスペクションを使用します。 オプション文字列は、もう必要ありません。 |
String |
getSMTPHost()
Returns value of the SMTPHost option. |
String |
getSubject()
Returns value of the Subject option. |
String |
getTo()
Returns value of the To option. |
boolean |
requiresLayout()
The SMTPAppender requires a layout.
|
protected void |
sendBuffer()
Send the contents of the cyclic buffer as an e-mail message. |
void |
setBufferSize(int bufferSize)
The BufferSize option takes a positive integer representing the maximum number of logging events to collect in a cyclic buffer. |
void |
setEvaluatorClass(String value)
The EvaluatorClass option takes a string value representing the name of the class implementing the TriggeringEventEvaluator interface. |
void |
setFrom(String from)
The From option takes a string value which should be a e-mail address of the sender. |
void |
setLocationInfo(boolean locationInfo)
The LocationInfo option takes a boolean value. |
void |
setOption(String option,
String value)
Set option to value.
|
void |
setSMTPHost(String smtpHost)
The SMTPHost option takes a string value which should be a the host name of the SMTP server that will send the e-mail message. |
void |
setSubject(String subject)
The Subject option takes a string value which should be a the subject of the e-mail message. |
void |
setTo(String to)
The To option takes a string value which should be a comma separated list of e-mail address of the recipients. |
| クラス org.apache.log4j.AppenderSkeleton から継承したメソッド |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
| クラス java.lang.Object から継承したメソッド |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected CyclicBuffer cb
protected javax.mail.Message msg
public static final String TO_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
送信する電子メールの出力ファイルのToフィールドを指定する時に使用される文字列定数です。 この文字列定数の現在の値は、Toです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
public static final String FROM_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
送信する電子メールの出力ファイルのFromフィールドを指定する時に使用される文字列定数です。 この文字列定数の現在の値は、Fromです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
public static final String SUBJECT_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
送信する電子メールの出力ファイルのSubjectフィールドを指定する時に使用される文字列定数です。 この文字列定数の現在の値は、Subjectです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
public static final String SMTP_HOST_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
電子メールを送信するために接続されるSMTPホストを指定する時に使用される文字列定数です。 この文字列定数の現在の値は、SMTPHostです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
public static final String BUFFER_SIZE_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
循環バッファのサイズオプションを指定する時に使用される文字列定数です。 この文字列の現在の値は、BufferSizeです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
public static final String EVALUATOR_CLASS_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
この SMTPAppender が使用する TriggeringEventEvaluator のクラスを指定する時に使用される文字列定数です。 この文字列定数の現在の値は、EvaluatorClassです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
public static final String LOCATION_INFO_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、近いうちに削除されるでしょう。
位置情報フラグを設定するためのオプションを指定する時に使用される文字列定数です。 この文字列定数の現在の値は、LocationInfoです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字をすることに気をつけてください。
protected TriggeringEventEvaluator evaluator
| コンストラクタの詳細 |
public SMTPAppender()
TriggeringEventEvaluator that will trigger on events with
priority ERROR or higher.
デフォルトのコンストラクタは、ERRORまたはそれ以上の優先度をもつイベントでトリガーとなるように TriggeringEventEvaluator を使ってアペンダを生成します。
public SMTPAppender(TriggeringEventEvaluator evaluator)
evaluator passed as parameter as the TriggeringEventEvaluator for this SMTPAppender.
このSMTPAppenderに対する TriggeringEventEvaluator のように、パラメタとして渡された evaluator を使用します。
| メソッドの詳細 |
public String[] getOptionStrings()
今日、私たちは、コンポーネントの設定には、JavaBeansのイントロスペクションを使用します。 オプション文字列は、もう必要ありません。
AppenderSkeleton.
親クラス AppenderSkeleton のオプションに追加するための、このコンポーネントに関するオプション名を返します。
AppenderSkeleton 内の getOptionStringspublic void activateOptions()
smtpホストや、宛先、差出人などのような指定したオプションを有効にします。
AppenderSkeleton 内の activateOptionspublic void append(LoggingEvent event)
SMTPAppender の指定した追加アクションを実行します。 主に、循環バッファにイベントを追加し、そのイベントが電子メール送信のトリガーとなるかどうかをチェックします。
AppenderSkeleton 内の appendprotected boolean checkEntryConditions()
このメソッドは、追加するのに相応しいかどうか決定する。
It checks whether there is a set output target and also if
there is a set layout. If these checks fail, then the boolean
value false is returned.
設定された出力先があるかどうか、また、設定されたレイアウトがあるかどうかをチェックします。
もしこれらのチェックが失敗した場合は、論理値 false が返されます。
public void close()
Appender の記述: ファイルハンドルや、ネットワークのコネクションなどの、アペンダー内に位置づけられたリソースを開放します。
It is a programming error to append to a closed appender.
閉じたアペンダーに追加しようとするとプログラミングエラーになります。
public String getTo()
Toオプションの値を返します。
public boolean requiresLayout()
SMTPAppender requires a layout.
SMTPAPpender は、layout を要求します。
protected void sendBuffer()
電子メールのメッセージとして、循環バッファの内容を送信します。
public String getEvaluatorClass()
EvaluatorClassオプションの値を返します。
public String getFrom()
Fromオプションの値を返します。
public String getSubject()
Subjectオプションの値を返します。
public void setOption(String option,
String value)
setOption method.
一般的な setOptionメソッドの代わりに、直接オプションに関するセッタメソッドを使用します。
OptionHandler の記述: 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()が呼ばれる時にだけ有効になります。
AppenderSkeleton 内の setOptionpublic void setFrom(String from)
Fromオプションは、文字列値を取り、差出人の電子メールアドレスである必要があります。
public void setSubject(String subject)
Subjectオプションは、文字列値をとり、電子メールメッセージの件名である必要があります。
public void setBufferSize(int bufferSize)
BufferSize is reached,
oldest events are deleted as new events are added to the
buffer. By default the size of the cyclic buffer is 512 events.
BufferSize オプションは、循環バッファに収集したロギングイベントの最大数を表す正の整数をとります。
BufferSize が最大値に到達した時は、新規イベントがバッファに追加されため、最も古いイベントは削除されます。
デフォルトで、循環バッファのサイズは、512イベントです。public void setSMTPHost(String smtpHost)
SMTPHostオプションは、文字列値を取り、電子メールメッセージを送るSMTPサーバの名前である必要があります。
public String getSMTPHost()
SMTPHostオプションの値を返します。
public void setTo(String to)
Toオプションは、文字列値をとり、宛先の電子メールアドレスのカンマ区切りのリストである必要があります。
public int getBufferSize()
BufferSizeオプションの値を返します。
public void setEvaluatorClass(String value)
TriggeringEventEvaluator interface. A corresponding object will
be instantiated and assigned as the triggering event evaluator
for the SMTPAppender.
EvaluatorClassオプションは、TriggeringEventEvaluator インタフェースを実装しているクラス名を表す、文字列値をとります。
一致するオブジェクトがインスタンス化され、SMTPAppender のトリガーイベントの評価機構として割り当てられます。
public void setLocationInfo(boolean locationInfo)
LocationInfoオプションは、論理値をとります。 デフォルトでは、falseに設定され、そのイベントに関連する位置情報を抽出する動作を行わないことを意味します。 結果として、電子メール内に送出されるイベントをフォーマットするレイアウトは、(もし、フォーマット内に位置情報に関する記述があれば)間違った位置情報を出力するおそれがあります。
Location information extraction is comparatively very slow and should be avoided unless performance is not a concern.
位置情報を抽出するのは、比較にならないほど遅く、パフォーマンスを気にするようなら使用は避けるべきです。
public boolean getLocationInfo()
LocationInfoオプションの値を返します。
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||