public class DailyRollingFileAppenderCustom
extends org.apache.log4j.FileAppender
| Modifier and Type | Field and Description |
|---|---|
protected int |
maxBackupIndex |
| Constructor and Description |
|---|
DailyRollingFileAppenderCustom()
The default constructor does nothing.
|
DailyRollingFileAppenderCustom(org.apache.log4j.Layout layout,
String filename,
String datePattern)
Instantiate a
DailyRollingFileAppenderCustom and open the
file designated by filename. |
| Modifier and Type | Method and Description |
|---|---|
void |
activateOptions() |
String |
getDatePattern()
Returns the value of the DatePattern option.
|
int |
getMaxBackupIndex() |
void |
setDatePattern(String pattern)
The DatePattern takes a string in the same format as
expected by
SimpleDateFormat. |
void |
setMaxBackupIndex(int maxBackupIndex) |
protected void |
subAppend(org.apache.log4j.spi.LoggingEvent event)
This method differentiates DailyRollingFileAppenderCustom from its
super class.
|
closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile, setFile, setQWForFilesappend, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, writeFooter, writeHeaderpublic DailyRollingFileAppenderCustom()
public DailyRollingFileAppenderCustom(org.apache.log4j.Layout layout,
String filename,
String datePattern)
throws IOException
DailyRollingFileAppenderCustom and open the
file designated by filename. The opened filename will
become the ouput destination for this appender.IOExceptionpublic int getMaxBackupIndex()
public void setMaxBackupIndex(int maxBackupIndex)
public void setDatePattern(String pattern)
SimpleDateFormat. This options determines the
rollover schedule.public String getDatePattern()
public void activateOptions()
activateOptions in interface org.apache.log4j.spi.OptionHandleractivateOptions in class org.apache.log4j.FileAppenderprotected void subAppend(org.apache.log4j.spi.LoggingEvent event)
Before actually logging, this method will check whether it is time to do a rollover. If it is, it will schedule the next rollover time and then rollover.
subAppend in class org.apache.log4j.WriterAppenderCopyright © 2016. All rights reserved.