|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--org.apache.log4j.AppenderSkeleton
|
+--org.apache.log4j.WriterAppender
|
+--org.apache.log4j.FileAppender
|
+--org.apache.log4j.RollingFileAppender
RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.
RollingFileAppenderは、ファイルがあるサイズに到達した時、ログファイルのバックアップを取るようにFileAppenderを拡張しています。
| フィールドの概要 | |
static String |
MAX_BACKUP_INDEX_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 |
MAX_FILE_SIZE_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. 今日、オプションは、JavaBeansのパラダイムを使い処理されています。 この定数は、今後必要なくなり、近いうちに削除される予定です。 |
protected int |
maxBackupIndex
There is one backup file by default. |
protected long |
maxFileSize
The default maximum file size is 10MB. |
| クラス org.apache.log4j.FileAppender から継承したフィールド |
APPEND_OPTION, FILE_OPTION, fileAppend, fileName, qwIsOurs |
| クラス org.apache.log4j.WriterAppender から継承したフィールド |
IMMEDIATE_FLUSH_OPTION, immediateFlush, qw |
| クラス org.apache.log4j.AppenderSkeleton から継承したフィールド |
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION |
| コンストラクタの概要 | |
RollingFileAppender()
The default constructor simply calls its parents constructor.
|
|
RollingFileAppender(Layout layout,
String filename)
Instantiate a FileAppender and open the file designated by filename. |
|
RollingFileAppender(Layout layout,
String filename,
boolean append)
Instantiate a RollingFileAppender and open the file designated by filename. |
|
| メソッドの概要 | |
int |
getMaxBackupIndex()
Returns the value of the MaxBackupIndex option. |
long |
getMaximumFileSize()
Get the maximum size that the output file is allowed to reach before being rolled over to backup files. |
String[] |
getOptionStrings()
推奨されていません。 We now use JavaBeans introspection to configure components. Options strings are no longer needed. 今日、私たちは、コンポーネントの設定でJavaBeansのイントロスペクションを 使っています。 オプション文字列は、今後必要なくなります。 |
void |
rollOver()
Implements the usual roll over behaviour. |
void |
setFile(String fileName,
boolean append)
Sets and opens the file where the log output will go. |
void |
setMaxBackupIndex(int maxBackups)
Set the maximum number of backup files to keep around. |
void |
setMaxFileSize(long maxFileSize)
推奨されていません。 Use setMaximumFileSize(long) instead.
代わりに、 |
void |
setMaxFileSize(String value)
Set the maximum size that the output file is allowed to reach before being rolled over to backup files. |
void |
setMaximumFileSize(long maxFileSize)
Set the maximum size that the output file is allowed to reach before being rolled over to backup files. |
void |
setOption(String key,
String value)
Set option to value.
|
protected void |
setQWForFiles(Writer writer)
Sets the quiet writer being used. |
protected void |
subAppend(LoggingEvent event)
This method differentiates RollingFileAppender from its super class. |
| クラス org.apache.log4j.FileAppender から継承したメソッド |
activateOptions, closeFile, getAppend, getFile, reset, setAppend, setFile |
| クラス org.apache.log4j.WriterAppender から継承したメソッド |
append, checkEntryConditions, close, closeWriter, getImmediateFlush, requiresLayout, setErrorHandler, setImmediateFlush, setWriter, 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 MAX_FILE_SIZE_OPTION
今日、オプションは、JavaBeansのパラダイムを使い処理されています。 この定数は、今後必要なくなり、近いうちに削除される予定です。
ログファイルの最大サイズを設定するというオプションを指定する時に使う文字列定数です。 この文字列定数の現状の値は、MaxFileSizeです。
public static final String MAX_BACKUP_INDEX_OPTION
今日、オプションは、JavaBeansのパラダイムを使い処理されています。 この定数は、今後必要なくなり、近いうちに削除される予定です。
保持するバックアップフィルの数を設定するというオプションに指定する時使う文字列定数です。 この文字列定数の現状の値は、MaxBackupIndexです。
protected long maxFileSize
デフォルトの最大ファイルサイズは、10メガバイトです。
protected int maxBackupIndex
デフォルトで、一つのバックアップファイルがあります。
| コンストラクタの詳細 |
public RollingFileAppender()
parents constructor.
デフォルトのコンストラクタは、
親のコンストラクタを呼び出します。
public RollingFileAppender(Layout layout,
String filename,
boolean append)
throws IOException
filename. The opened filename will become the ouput
destination for this appender.
RollingFileAppenderのインスタンスを生成し、filenameで
指定されたファイルをオープンします。
オープンされたファイル名は、このアペンダの出力先となります。
If the append parameter is true, the file will be
appended to. Otherwise, the file desginated by
filename will be truncated before being opened.
もし、appendパラメタが true の場合は、ファイルが指定されたファイルに
追加されます。そうでない場合は、filenameで指定されたファイルは、
オープンされているファイルの最初から追加されます。
public RollingFileAppender(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 int getMaxBackupIndex()
MaxBackupIndexオプションの値を返します。
public long getMaximumFileSize()
出力先のファイルがバックアップファイルに切り替わる前に到達することができる 最大サイズを取得します。
public String[] getOptionStrings()
今日、私たちは、コンポーネントの設定でJavaBeansのイントロスペクションを 使っています。 オプション文字列は、今後必要なくなります。
MAX_FILE_SIZE_OPTION and MAX_BACKUP_INDEX_OPTION in
addition to the options of FileAppender.getOptionStrings()
このコンポーネントのオプション名を返します。
名前としては、MAX_FILE_SIZE_OPTION や
FileAppender.getOptionStrings()のオプションに追加する
MAX_BACKUP_INDEX_OPTIONがあります。
FileAppender 内の getOptionStringspublic void rollOver()
普段の切り替わりの振る舞いを実装します。
If MaxBackupIndex is positive, then files
{File.1, ..., File.MaxBackupIndex -1}
are renamed to {File.2, ...,
File.MaxBackupIndex}. Moreover, File is
renamed File.1 and closed. A new File is
created to receive further log output.
もし、maxBackupIndexが、有効である場合、ファイル
{File.1, ..., File.MaxBackupIndex -1}
は、{File.2, ..., File.MaxBackupIndex}に
リネームされます。
その上、Fileは、File.1へリネームされ、
クローズされます。新しい Fileは、さらにログ出力を受け取る
ために作成されます。
If MaxBackupIndex is equal to zero, then the
File is truncated with no backup files created.
もし、MaxBackupIndexが0と同等の場合、File
は、バックアップファイルは作成されず、そこで切られてしまいます。
public void setFile(String fileName,
boolean append)
throws IOException
FileAppender の記述: 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.
もし、すでにオープンされたファイルがあれば、先にオープンされたファイルが最初にクローズされます。
FileAppender 内の setFileorg.apache.log4j.FileAppender からコピーされたタグ: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()が呼ばれる時にだけ有効になります。
FileAppender 内の setOptionpublic void setMaxBackupIndex(int maxBackups)
保持し続けられるバックアップファイルの最大数を設定します。
The MaxBackupIndex option determines how many backup
files are kept before the oldest is erased. This option takes
a positive integer value. If set to zero, then there will be no
backup files and the log file will be truncated when it reaches
MaxFileSize.
MaxBackupIndexオプションは、最も古いファイルが消去される前に
保持するバックアップファイルがいくつあるかを決定します。
このオプションは、整数値をとります。もし、0 に設定した場合は、
バックアップファイルはなく、ログファイルは、MaxFileSizeに
到達した時点で、切られてしまいます。
public void setMaxFileSize(long maxFileSize)
setMaximumFileSize(long) instead.
代わりに、setMaximumFileSize(long)を使用してください。
出力ファイルがバックアップファイルに切り替わる前に到達可能な最大サイズを設定します。
public void setMaximumFileSize(long maxFileSize)
出力ファイルがバックアップファイルへ切り替わる前に到達可能な最大サイズを設定します。
This method is equivalent to setMaxFileSize(long) except
that it is required for differentiating the setter taking a
long argument from the setter taking a
String argument by the JavaBeans Introspector.
このメソッドは、JavaBeansのIntrospectorにより
String引数をとるセッタメソッドとlongをとる
セッタメソッドを区別するよう要求されることを除いて
setMaxFileSize(long)と同じです。
setMaxFileSize(String)public void setMaxFileSize(String value)
出力ファイルがバックアップファイルに切り替わる前に到達できる最大のサイズを設定します。
In configuration files, the MaxFileSize option takes an long integer in the range 0 - 2^63. You can specify the value with the suffixes "KB", "MB" or "GB" so that the integer is interpreted being expressed respectively in kilobytes, megabytes or gigabytes. For example, the value "10KB" will be interpreted as 10240.
設定ファイル内で、MaxFileSizeオプションは、0 から 2^63 の範囲の長整数をとります。 あなたは、サフィックス "KB"、"MB"または、"GB"を使って値を指定します。そこで 整数は、それぞれ キロバイト、メガバイト、ギガバイトの表現として解釈されます。 例えば、"10MB"は、10240として解釈されます。
protected void setQWForFiles(Writer writer)
FileAppender の記述: 利用されるquietライタを設定します。
This method is overriden by RollingFileAppender.
このメソッドは、RollingFileAppenderにオーバーライドされます。
FileAppender 内の setQWForFilesprotected void subAppend(LoggingEvent event)
このメソッドは、RollingFileAppenderと親クラスとを区別します。
WriterAppender 内の subAppend
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||