|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--org.apache.log4j.AppenderSkeleton
|
+--org.apache.log4j.WriterAppender
|
+--org.apache.log4j.FileAppender
FileAppender appends log events to a file.
FileAppender は、ログイベントをファイルに追加します。
Support for java.io.Writer and console appending has been
deprecated and will be removed in the near future. You are
strongly encouraged to use the replacement solutions: WriterAppender and ConsoleAppender.
java.io.Writerとコンソールの追加のサポートは、推奨されないので、近い将来削除されます。
あなたには、別の置き換えのきくソリューションを利用することを強く勧めます:
WriterAppender や ConsoleAppender があります。
| フィールドの概要 | |
static String |
APPEND_OPTION
推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed. 今日、私たちは、コンポーネントの設定では、JavaBeansのイントロスペクションを使っています。 オプション文字列は、今後、必要なくなります。 |
static String |
FILE_OPTION
推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed. 今日、私たちは、コンポーネントの設定では、JavaBeansのイントロスペクションを使っています。 オプション文字列は、今後、必要なくなります。 |
protected boolean |
fileAppend
Append to or truncate the file? |
protected String |
fileName
The name of the log file. |
protected boolean |
qwIsOurs
推奨されていません。 FileAppender will not support streams passed by the user in the future. FileAppender は、将来的には、ユーザにより渡されたストリームをサポートしない予定です。 |
| クラス org.apache.log4j.WriterAppender から継承したフィールド |
IMMEDIATE_FLUSH_OPTION, immediateFlush, qw |
| クラス org.apache.log4j.AppenderSkeleton から継承したフィールド |
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION |
| コンストラクタの概要 | |
FileAppender()
The default constructor does not do anything. |
|
FileAppender(Layout layout,
OutputStream os)
推奨されていません。 The functionality of this constructor form has been replaced by the WriterAppender. This constructor
will be removed in the near term.
コンストラクタのフォームの機能は、 |
|
FileAppender(Layout layout,
String filename)
Instantiate a FileAppender and open the file designated by filename. |
|
FileAppender(Layout layout,
String filename,
boolean append)
Instantiate a FileAppender and open the file designated by filename. |
|
FileAppender(Layout layout,
Writer writer)
推奨されていません。 The functionality of constructor form has been replaced by the WriterAppender. This constructor will be
removed in the near term.
コンストラクタのフォームの機能は、 |
|
| メソッドの概要 | |
void |
activateOptions()
If the value of FILE_OPTION is not null, then setFile(java.lang.String) is called with the values of FILE_OPTION and
APPEND_OPTION.
|
protected void |
closeFile()
Closes the previously opened file. |
boolean |
getAppend()
Returns the value of the Append option. |
String |
getFile()
Returns the value of the File option. |
String[] |
getOptionStrings()
推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed. 今日、私たちは、コンポーネントの設定には、JavaBeansのイントロスペクションを利用します。 オプション文字列は、今後必要なくなります。 |
protected void |
reset()
Close any previously opened file and call the parent's reset.
|
void |
setAppend(boolean flag)
The Append option takes a boolean value. |
void |
setFile(String file)
The File option takes a string value which should be the name of the file to append to. |
void |
setFile(String fileName,
boolean append)
Sets and opens the file where the log output will go. |
void |
setOption(String key,
String value)
Set option to value.
|
protected void |
setQWForFiles(Writer writer)
Sets the quiet writer being used. |
| クラス org.apache.log4j.WriterAppender から継承したメソッド |
append, checkEntryConditions, close, closeWriter, getImmediateFlush, requiresLayout, setErrorHandler, setImmediateFlush, setWriter, subAppend, writeFooter, writeHeader |
| クラス org.apache.log4j.AppenderSkeleton から継承したメソッド |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold |
| クラス java.lang.Object から継承したメソッド |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
public static final String FILE_OPTION
今日、私たちは、コンポーネントの設定では、JavaBeansのイントロスペクションを使っています。 オプション文字列は、今後、必要なくなります。
出力ファイルを設定するためのオプションとして指定する時に使われる文字列定数です。 この文字列定数の現在の値は、Fileです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字の区別をするのに気をつけてください。
public static final String APPEND_OPTION
今日、私たちは、コンポーネントの設定では、JavaBeansのイントロスペクションを使っています。 オプション文字列は、今後、必要なくなります。
出力ファイルが追加されないか追加されるかどうかを判定するオプションを指定する時に使用する文字列定数です。 この文字列定数の現状の値は、Appendです。
Note that all option keys are case sensitive.
全てのオプションキーは、大文字と小文字の区別をするのに気をつけてください。
protected boolean fileAppend
true, meaning that by default a
FileAppender will append to an existing file and
not truncate it.
This option is meaningful only if the FileAppender opens the file.
このオプションは、FileAppenderがファイルをオープンしたかどうかだけを意図しています。
protected String fileName
protected boolean qwIsOurs
FileAppender は、将来的には、ユーザにより渡されたストリームをサポートしない予定です。
QuietWriter が私たちのものか、ユーザにより作成され、渡されたものか?
| コンストラクタの詳細 |
public FileAppender()
デフォルトのコンストラクタは、何も行いません。
public FileAppender(Layout layout,
OutputStream os)
WriterAppender. This constructor
will be removed in the near term.
コンストラクタのフォームの機能は、WriterAppenderにより置き換えられます。
このコンストラクタは、近いうちに削除される予定です。
OutputStreamWriter initialized with os
as its OutputStream.
FileAppenderのインスタンスを生成し、OutputStreamとしてosを使って新規に初期化された OutputStreamWriterを出力先として設定します。
public FileAppender(Layout layout,
Writer writer)
WriterAppender. This constructor will be
removed in the near term.
コンストラクタのフォームの機能は、WriterAppenderにより置き換えられます。
このコンストラクタは、近いうちに削除される予定です。
writer.
FileAppenderのインスタンスを生成し、writerを出力先として設定します。
The writer must have been opened by the user.
writerは、ユーザによりオープンされている必要があります。
public FileAppender(Layout layout,
String filename,
boolean append)
throws IOException
filename. The opened filename will become the output
destination for this appender.
FileAppenderのインスタンスを生成し、filenameで指定されたファイルをオープンします。
そのオープンされたファイルがこのアペンダの出力先になります。
If the append parameter is true, the file will be
appended to. Otherwise, the file designated by
filename will be truncated before being opened.
もし、appendパラメタがtrueの場合、ファイルに追加されます。
そうでない場合、filename用に設計されたファイルがオープンされる前に追加されなくなります。
public FileAppender(Layout layout,
String filename)
throws IOException
filename. The opened filename will become the output
destination for this appender.
FileAppenderのインスタンスを生成し、filenameに指定されたファイルをオープンします。
そのオープンされたファイル名は、このアペンダの出力先となります。
The file will be appended to.
そのファイルに対し追加されます。
| メソッドの詳細 |
public void setFile(String file)
Fileオプションは、追加する対象のファイルの名であるはずの文字列の値を取ります。 特別な値、"System.out" または "System.err" は、標準出力と標準エラーとして解釈されます。
Note that the "System.out" or "System.err"
options are deprecated. Use ConsoleAppender
instead.
"System.out" または "System.err" オプションは、推奨されていないことに気を付けてください。代替として、ConsoleAppenderを使ってください。
If the option is set to "System.out" or "System.err" the output will go to the corresponding stream. Otherwise, if the option is set to the name of a file, then the file will be opened and output will go there.
もし、オプションに "System.out" または "System.err" が設定されている場合、出力は、一致するストリームに対して行われます。 そうでない場合は、もしオプションにファイル名が設定されている場合、その時は、そのファイルがオープンされ、そこに出力されます。
Note: Actual opening of the file is made when activateOptions() is called, not when the options are set.
注意: 実際にファイルのオープンは、オプションが設定される時ではなく、activateOptions()が呼び出されるときに作成されます。
public boolean getAppend()
Appendオプションの値を返します。
public String getFile()
Fileオプションの値を返します。
public String[] getOptionStrings()
今日、私たちは、コンポーネントの設定には、JavaBeansのイントロスペクションを利用します。 オプション文字列は、今後必要なくなります。
FILE_OPTION, APPEND_OPTION} in addition
to the options of its super class WriterAppender.
このコンポーネントのオプション名を返します。
名前としては、文字列配列の FILE_OPTION と親クラスWriterAppenderのオプションに追加する際のAPPEND_OPTIONがあります。
WriterAppender 内の getOptionStringspublic void setAppend(boolean flag)
true by default. If true, then File
will be opened in append mode by setFile (see
above). Otherwise, setFile will open
File in truncate mode.
Appendオプションは、論理値をとります。
デフォルトでは、trueに設定されます。
もし、true の場合、その時は、Fileが setFile(上記を参照してください)による追加モードでオープンされます。
そうでない場合、setFile は、追加しないモードでFileをオープンします。
Note: Actual opening of the file is made when activateOptions() is called, not when the options are set.
注意: ファイルの実際のオープンは、オプションが設定される時ではなく、activateOptions()が呼び出される時に作成されます。
public void activateOptions()
FILE_OPTION is not null, then setFile(java.lang.String) is called with the values of FILE_OPTION and
APPEND_OPTION.
もし、FILE_OPTIONの値が、nullでない場合、その時、setFile(java.lang.String) は、FILE_OPTION と APPEND_OPTION を使って値が呼び出されます。
WriterAppender 内の activateOptionsprotected void closeFile()
先にオープンしたファイルをクローズします。
public void setFile(String fileName,
boolean append)
throws IOException
Sets and opens the file where the log output will go. The specified file must be writable.
ログ出力を行うファイルを設定し、オープンします。 指定したファイルは、書き込み可能である必要があります。
If there was already an opened file, then the previous file is closed first.
もし、すでにオープンされたファイルがあれば、先にオープンされたファイルが最初にクローズされます。
fileName - The path to the log file.
fileName ログファイルへのパス
append - If true will append to fileName. Otherwise will
truncate fileName.
append trueの場合は、ファイルへ追加されます。 そうでない場合は、fileNameへは、追加されません。
public void setOption(String key,
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()が呼ばれる時にだけ有効になります。
WriterAppender 内の setOptionprotected void setQWForFiles(Writer writer)
利用されるquietライタを設定します。
This method is overriden by RollingFileAppender.
このメソッドは、RollingFileAppenderにオーバーライドされます。
protected void reset()
reset.
先にオープンしているファイルをクローズし、親のresetを呼び出します。
WriterAppender 内の reset
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||