public class RollingFileWithoutDeleteAppender
extends org.apache.log4j.FileAppender
| Modifier and Type | Field and Description |
|---|---|
protected long |
maxFileSize
The default maximum file size is 10MB.
|
| Constructor and Description |
|---|
RollingFileWithoutDeleteAppender()
The default constructor simply calls its
parents constructor. |
RollingFileWithoutDeleteAppender(org.apache.log4j.Layout layout,
String filename)
Instantiate a FileAppender and open the file designated by
filename. |
RollingFileWithoutDeleteAppender(org.apache.log4j.Layout layout,
String filename,
boolean append)
Instantiate a RollingFileAppender and open the file designated by
filename. |
| Modifier and Type | Method and Description |
|---|---|
long |
getMaximumFileSize()
Get the maximum size that the output file is allowed to reach before being
rolled over to backup files.
|
void |
rollOver()
Implements the usual roll over behaviour.
|
void |
setFile(String fileName,
boolean append,
boolean bufferedIO,
int bufferSize) |
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.
|
protected void |
setQWForFiles(Writer writer) |
protected void |
subAppend(org.apache.log4j.spi.LoggingEvent event)
This method differentiates RollingFileAppender from its super class.
|
activateOptions, closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFileappend, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, writeFooter, writeHeaderpublic RollingFileWithoutDeleteAppender()
parents constructor.public RollingFileWithoutDeleteAppender(org.apache.log4j.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.
IOExceptionpublic RollingFileWithoutDeleteAppender(org.apache.log4j.Layout layout,
String filename)
throws IOException
filename. The opened filename will become the output
destination for this appender.
The file will be appended to.
IOExceptionpublic long getMaximumFileSize()
public void rollOver()
File is renamed File.yyyyMMddHHmmss and closed. A
new File is created to receive further log output.
public void setFile(String fileName, boolean append, boolean bufferedIO, int bufferSize) throws IOException
setFile in class org.apache.log4j.FileAppenderIOExceptionpublic 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.
protected void setQWForFiles(Writer writer)
setQWForFiles in class org.apache.log4j.FileAppenderprotected void subAppend(org.apache.log4j.spi.LoggingEvent event)
subAppend in class org.apache.log4j.WriterAppenderCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.