public class RollingFileAppender<E> extends FileAppender<E>
RollingFileAppender extends FileAppender to backup the
log files depending on RollingPolicy and TriggeringPolicy.
For more information about this appender, please refer to the online manual
at http://logback.qos.ch/manual/appenders.html#RollingFileAppender| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
COLLISION_URL |
(package private) java.io.File |
currentlyActiveFile |
private static java.lang.String |
RFA_LATE_FILE_URL |
private static java.lang.String |
RFA_NO_RP_URL |
private static java.lang.String |
RFA_NO_TP_URL |
(package private) RollingPolicy |
rollingPolicy |
(package private) TriggeringPolicy<E> |
triggeringPolicy |
append, COLLISION_WITH_EARLIER_APPENDER_URL, fileNameencoder, lockname, startedcontext| Constructor and Description |
|---|
RollingFileAppender() |
| Modifier and Type | Method and Description |
|---|---|
private void |
attemptOpenFile() |
private void |
attemptRollover() |
private boolean |
checkForCollisionsInPreviousRollingFileAppenders() |
private boolean |
checkForFileAndPatternCollisions() |
java.lang.String |
getFile()
Returns the value of the File property.
|
RollingPolicy |
getRollingPolicy() |
TriggeringPolicy<E> |
getTriggeringPolicy() |
private boolean |
innerCheckForFileNamePatternCollisionInPreviousRFA(java.lang.String fileNamePattern) |
void |
rollover()
Implemented by delegating most of the rollover work to a rolling policy.
|
void |
setFile(java.lang.String file)
The File property takes a string value which should be the name of
the file to append to.
|
void |
setRollingPolicy(RollingPolicy policy)
Sets the rolling policy.
|
void |
setTriggeringPolicy(TriggeringPolicy<E> policy) |
void |
start()
If the value of File is not
null, then
FileAppender.openFile(java.lang.String) is called with the values of File and
Append properties. |
void |
stop()
Stop this appender instance.
|
protected void |
subAppend(E event)
This method differentiates RollingFileAppender from its super class.
|
addErrorForCollision, checkForFileCollisionInPreviousFileAppenders, isAppend, isPrudent, openFile, rawFileProperty, setAppend, setPrudent, writeOutappend, closeOutputStream, getEncoder, getOutputStream, setEncoder, setLayout, setOutputStreamaddFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextjava.io.File currentlyActiveFile
TriggeringPolicy<E> triggeringPolicy
RollingPolicy rollingPolicy
private static java.lang.String RFA_NO_TP_URL
private static java.lang.String RFA_NO_RP_URL
private static java.lang.String COLLISION_URL
private static java.lang.String RFA_LATE_FILE_URL
public void start()
FileAppendernull, then
FileAppender.openFile(java.lang.String) is called with the values of File and
Append properties.start in interface LifeCyclestart in class FileAppender<E>private boolean checkForFileAndPatternCollisions()
private boolean checkForCollisionsInPreviousRollingFileAppenders()
private boolean innerCheckForFileNamePatternCollisionInPreviousRFA(java.lang.String fileNamePattern)
public void stop()
OutputStreamAppenderStopped appenders cannot be reused.
stop in interface LifeCyclestop in class OutputStreamAppender<E>public void setFile(java.lang.String file)
FileAppendersetFile in class FileAppender<E>public java.lang.String getFile()
FileAppenderThis method may be overridden by derived classes.
getFile in class FileAppender<E>public void rollover()
private void attemptOpenFile()
private void attemptRollover()
protected void subAppend(E event)
subAppend in class OutputStreamAppender<E>public RollingPolicy getRollingPolicy()
public TriggeringPolicy<E> getTriggeringPolicy()
public void setRollingPolicy(RollingPolicy policy)
TriggeringPolicy, then the triggering policy for this appender is
automatically set to be the policy argument.policy - public void setTriggeringPolicy(TriggeringPolicy<E> policy)