java.lang.Object | |||
↳ | org.apache.log4j.AppenderSkeleton | ||
↳ | org.apache.log4j.WriterAppender | ||
↳ | org.apache.log4j.FileAppender |
Known Direct Subclasses |
Known Indirect Subclasses |
FileAppender appends log events to a file.
Support for java.io.Writer
and console appending
has been deprecated and then removed. See the replacement
solutions: WriterAppender
and ConsoleAppender
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
bufferSize | Determines the size of IO buffer be. | ||||||||||
bufferedIO | Do we do bufferedIO? | ||||||||||
fileAppend | Controls file truncatation. | ||||||||||
fileName | The name of the log file. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.log4j.WriterAppender
| |||||||||||
From class
org.apache.log4j.AppenderSkeleton
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The default constructor does not do anything.
| |||||||||||
Instantiate a
FileAppender and open the file
designated by filename . | |||||||||||
Instantiate a FileAppender and open the file designated by
filename . | |||||||||||
Instantiate a FileAppender and open the file designated by
filename . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If the value of File is not
null , then setFile(String) is called with the values of File and
Append properties. | |||||||||||
Returns the value of the Append option.
| |||||||||||
Get the size of the IO buffer.
| |||||||||||
Get the value of the BufferedIO option.
| |||||||||||
Returns the value of the File option.
| |||||||||||
The Append option takes a boolean value.
| |||||||||||
Set the size of the IO buffer.
| |||||||||||
The BufferedIO option takes a boolean value.
| |||||||||||
The File property takes a string value which should be the
name of the file to append to.
| |||||||||||
Sets and opens the file where the log output will go. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the previously opened file.
| |||||||||||
Close any previously opened file and call the parent's
reset . | |||||||||||
Sets the quiet writer being used.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.log4j.WriterAppender
| |||||||||||
From class
org.apache.log4j.AppenderSkeleton
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.log4j.Appender
| |||||||||||
From interface
org.apache.log4j.spi.OptionHandler
|
Determines the size of IO buffer be. Default is 8K.
Do we do bufferedIO?
Controls file truncatation. The default value for this variable
is 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.
The name of the log file.
The default constructor does not do anything.
Instantiate a FileAppender
and open the file
designated by filename
. The opened filename will
become the output destination for this appender.
If the append
parameter is true, the file will be
appended to. Otherwise, the file designated by
filename
will be truncated before being opened.
If the bufferedIO
parameter is true
,
then buffered IO will be used to write to the output file.
IOException |
---|
Instantiate a FileAppender and open the file designated by
filename
. The opened filename will become the output
destination for this appender.
If the append
parameter is true, the file will be
appended to. Otherwise, the file designated by
filename
will be truncated before being opened.
IOException |
---|
Instantiate a FileAppender and open the file designated by
filename
. The opened filename will become the output
destination for this appender.
The file will be appended to.
IOException |
---|
If the value of File is not null
, then setFile(String)
is called with the values of File and
Append properties.
Returns the value of the Append option.
Get the size of the IO buffer.
Get the value of the BufferedIO option.
BufferedIO will significatnly increase performance on heavily loaded systems.
Returns the value of the File option.
The Append option takes a boolean value. It is set to
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.
Note: Actual opening of the file is made when activateOptions()
is called, not when the options are set.
Set the size of the IO buffer.
The BufferedIO option takes a boolean value. It is set to
false
by default. If true, then File
will be opened and the resulting java.io.Writer wrapped
around a BufferedWriter.
BufferedIO will significatnly increase performance on heavily
loaded systems.
The File property takes a string value which should be the name of the file to append to.
Note that the special values "System.out" or "System.err" are no longer honored.
Note: Actual opening of the file is made when activateOptions()
is called, not when the options are set.
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.
Do not use this method directly. To configure a FileAppender or one of its subclasses, set its properties one by one and then call activateOptions.
fileName | The path to the log file. |
---|---|
append | If true will append to fileName. Otherwise will truncate fileName. |
IOException |
---|
Closes the previously opened file.
Close any previously opened file and call the parent's
reset
.
Sets the quiet writer being used.
This method is overriden by RollingFileAppender
.