public class NoDeleteRollingFileAppender
extends org.apache.log4j.FileAppender
Modifier and Type | Field and Description |
---|---|
protected long |
maxFileSize
The default maximum file size is 10MB.
|
Constructor and Description |
---|
NoDeleteRollingFileAppender()
The default constructor simply calls its
parents constructor . |
NoDeleteRollingFileAppender(org.apache.log4j.Layout layout,
String filename)
Instantiate a FileAppender and open the file designated by
filename . |
NoDeleteRollingFileAppender(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 behavior.
|
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, setFile
append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, writeFooter, writeHeader
public NoDeleteRollingFileAppender()
parents constructor
.public NoDeleteRollingFileAppender(org.apache.log4j.Layout layout, String filename, boolean append) throws IOException
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
public NoDeleteRollingFileAppender(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.
IOException
public 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.FileAppender
IOException
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.
protected void setQWForFiles(Writer writer)
setQWForFiles
in class org.apache.log4j.FileAppender
protected void subAppend(org.apache.log4j.spi.LoggingEvent event)
subAppend
in class org.apache.log4j.WriterAppender
Copyright © 2016 The Apache Software Foundation. All rights reserved.