|
Log4j 1.3alpha-7 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.RollingFileAppender
RollingFileAppender
org.apache.log4j.RollingFileAppender emulates earlier implementations by delegating to general purpose org.apache.log4j.rollling.RollingFileAppender introduced in log4j 1.3. This class is provided for compatibility with existing configuration files but is not intended to be compatible with existing extensions of the prior RollingFileAppender and is marked final to prevent such use.
Constructor Summary | |
RollingFileAppender()
Deprecated. The default constructor simply calls its parents constructor . |
|
RollingFileAppender(Layout layout,
String filename)
Deprecated. Instantiate a FileAppender and open the file designated by filename . |
|
RollingFileAppender(Layout layout,
String filename,
boolean append)
Deprecated. Instantiate a RollingFileAppender and open the file designated by filename . |
Method Summary | |
void |
activateOptions()
Deprecated. Prepares RollingFileAppender for use. |
void |
addFilter(Filter newFilter)
Deprecated. Add a filter to the end of the filter list. |
void |
clearFilters()
Deprecated. Clear the list of filters by removing all the filters in it. |
void |
close()
Deprecated. Release any resources allocated within the appender such as file handles, network connections, etc. |
void |
doAppend(LoggingEvent event)
Deprecated. Log in Appender specific way. |
boolean |
getAppend()
Deprecated. Returns the value of the Append option. |
boolean |
getBufferedIO()
Deprecated. Get the value of the BufferedIO option. |
int |
getBufferSize()
Deprecated. Get the size of the IO buffer. |
ErrorHandler |
getErrorHandler()
Deprecated. As of 1.3 |
String |
getFile()
Deprecated. Returns the value of the File option. |
Filter |
getFilter()
Deprecated. Returns the head Filter. |
Layout |
getLayout()
Deprecated. Returns this appenders layout. |
int |
getMaxBackupIndex()
Deprecated. Returns the value of the MaxBackupIndex option. |
long |
getMaximumFileSize()
Deprecated. Get the maximum size that the output file is allowed to reach before being rolled over to backup files. |
String |
getName()
Deprecated. Get the name of this appender. |
boolean |
isActive()
Deprecated. Is this appender in working order? |
boolean |
isClosed()
Deprecated. Is this appender closed? |
void |
rollOver()
Deprecated. Implements the usual roll over behaviour. |
void |
setAppend(boolean flag)
Deprecated. The Append option takes a boolean value. |
void |
setBufferedIO(boolean bufferedIO)
Deprecated. The BufferedIO option takes a boolean value. |
void |
setBufferSize(int bufferSize)
Deprecated. Set the size of the IO buffer. |
void |
setErrorHandler(ErrorHandler eh)
Deprecated. As of 1.3 |
void |
setFile(String file)
Deprecated. The File property takes a string value which should be the name of the file to append to. |
void |
setLayout(Layout layout)
Deprecated. Set the Layout for this appender. |
void |
setLoggerRepository(LoggerRepository repository)
Deprecated. Set owning logger repository for this component. |
void |
setMaxBackupIndex(int maxBackups)
Deprecated. Set the maximum number of backup files to keep around. |
void |
setMaxFileSize(String value)
Deprecated. Set the maximum size that the output file is allowed to reach before being rolled over to backup files. |
void |
setMaximumFileSize(long maxFileSize)
Deprecated. Set the maximum size that the output file is allowed to reach before being rolled over to backup files. |
void |
setName(String name)
Deprecated. Set the name of this appender. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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.
If the append
parameter is true, the file will be
appended to. Otherwise, the file desginated by
filename
will be truncated before being opened.
public RollingFileAppender(Layout layout, String filename) throws IOException
filename
. The opened filename will become the output
destination for this appender.
The file will be appended to.
Method Detail |
public int getMaxBackupIndex()
public long getMaximumFileSize()
public 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
.
public void setMaximumFileSize(long maxFileSize)
This method is equivalent to setMaxFileSize(java.lang.String)
except
that it is required for differentiating the setter taking a
long
argument from the setter taking a
String
argument by the JavaBeans Introspector
.
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.
public void activateOptions()
activateOptions
in interface OptionHandler
public void addFilter(Filter newFilter)
addFilter
in interface Appender
public Filter getFilter()
getFilter
in interface Appender
public void clearFilters()
clearFilters
in interface Appender
public void close()
It is a programming error to append to a closed appender.
close
in interface Appender
public boolean isClosed()
public boolean isActive()
public void doAppend(LoggingEvent event)
Appender
specific way. When appropriate, Loggers will
call the doAppend
method of appender implementations in
order to log.
doAppend
in interface Appender
public String getName()
getName
in interface Appender
public void setLayout(Layout layout)
Layout
for this appender.
setLayout
in interface Appender
public Layout getLayout()
getLayout
in interface Appender
public void setName(String name)
setName
in interface Appender
public void setLoggerRepository(LoggerRepository repository) throws IllegalStateException
Component
setLoggerRepository
in interface Appender
IllegalStateException
public void setFile(String file)
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.
public boolean getAppend()
public String getFile()
public boolean getBufferedIO()
BufferedIO will significatnly increase performance on heavily loaded systems.
public int getBufferSize()
public 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.
Note: Actual opening of the file is made when activateOptions()
is called, not when the options are set.
public void setBufferedIO(boolean bufferedIO)
false
by default. If true, then File
will be opened and the resulting Writer
wrapped
around a BufferedWriter
.
BufferedIO will significatnly increase performance on heavily
loaded systems.
public void setBufferSize(int bufferSize)
public 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.
If MaxBackupIndex
is equal to zero, then the
File
is truncated with no backup files created.
public final ErrorHandler getErrorHandler()
OnlyOnceErrorHandler
for this Appender.
ErrorHandler
's are no longer utilized as of version 1.3.
getErrorHandler
in interface Appender
public final void setErrorHandler(ErrorHandler eh)
setErrorHandler
in interface Appender
|
Log4j 1.3alpha-7 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |