|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.AppenderSkeleton
org.apache.log4j.WriterAppender
org.apache.log4j.FileAppender
it.openutils.log4j.EnhancedDailyRollingFileAppender
public class EnhancedDailyRollingFileAppender
Enhanced version of standard DailyRollingFileAppender that allow moving rotated files to a different directory. You
can configure the target directory by setting the archiveDirectory
property. The default value is
archive
Note that since DailyRollingFileAppender is not easily extendible, this class is
actually a copy and paste of all the code with slights modifications...
Field Summary |
---|
Fields inherited from class org.apache.log4j.FileAppender |
---|
bufferedIO, bufferSize, fileAppend, fileName |
Fields inherited from class org.apache.log4j.WriterAppender |
---|
encoding, immediateFlush, qw |
Fields inherited from class org.apache.log4j.AppenderSkeleton |
---|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
Constructor Summary | |
---|---|
EnhancedDailyRollingFileAppender()
The default constructor does nothing. |
|
EnhancedDailyRollingFileAppender(org.apache.log4j.Layout layout,
java.lang.String filename,
java.lang.String datePattern)
Instantiate a DailyRollingFileAppender and open the file designated by filename . |
Method Summary | |
---|---|
void |
activateOptions()
|
java.lang.String |
getDatePattern()
Returns the value of the DatePattern option. |
void |
setArchiveDirectory(java.lang.String archiveDirectory)
Sets the archiveDirectory. |
void |
setDatePattern(java.lang.String pattern)
The DatePattern takes a string in the same format as expected by SimpleDateFormat . |
protected void |
subAppend(org.apache.log4j.spi.LoggingEvent event)
This method differentiates DailyRollingFileAppender from its super class. |
Methods inherited from class org.apache.log4j.FileAppender |
---|
closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile, setFile, setQWForFiles |
Methods inherited from class org.apache.log4j.WriterAppender |
---|
append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, writeFooter, writeHeader |
Methods inherited from class org.apache.log4j.AppenderSkeleton |
---|
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EnhancedDailyRollingFileAppender()
public EnhancedDailyRollingFileAppender(org.apache.log4j.Layout layout, java.lang.String filename, java.lang.String datePattern) throws java.io.IOException
DailyRollingFileAppender
and open the file designated by filename
.
The opened filename will become the ouput destination for this appender.
java.io.IOException
Method Detail |
---|
public void setArchiveDirectory(java.lang.String archiveDirectory)
archiveDirectory
- the archiveDirectory to setpublic void setDatePattern(java.lang.String pattern)
SimpleDateFormat
. This options
determines the rollover schedule.
public java.lang.String getDatePattern()
public void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
activateOptions
in class org.apache.log4j.FileAppender
protected 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.WriterAppender
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |