ch.qos.logback.core.rolling
Class RollingFileAppender<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
ch.qos.logback.core.WriterAppender<E>
ch.qos.logback.core.FileAppender<E>
ch.qos.logback.core.rolling.RollingFileAppender<E>
- All Implemented Interfaces:
- Appender<E>, ContextAware, FilterAttachable, LifeCycle
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
- Since:
- 1.3
- Author:
- Heinz Richter, Ceki Gülcü
Methods inherited from class ch.qos.logback.core.WriterAppender |
append, closeWriter, createWriter, getEncoding, getImmediateFlush, getLayout, setEncoding, setImmediateFlush, setLayout, setWriter, stop |
RollingFileAppender
public RollingFileAppender()
- The default constructor simply calls its
parents constructor
.
start
public void start()
- Description copied from class:
FileAppender
- If the value of File is not
null
, then
FileAppender.setFile(java.lang.String)
is called with the values of File and Append
properties.
- Specified by:
start
in interface LifeCycle
- Overrides:
start
in class FileAppender<E>
rollover
public void rollover()
- Implements the usual roll over behaviour.
If MaxBackupIndex
is positive, then files
{File.1
, ..., File.MaxBackupIndex -1
}
are renamed to {File.2
, ...,
File.MaxBackupIndex
}. Moreover, File
is
renamed File.1
and closed. A new File
is
created to receive further log output.
If MaxBackupIndex
is equal to zero, then the
File
is truncated with no backup files created.
subAppend
protected void subAppend(E event)
- This method differentiates RollingFileAppender from its super
class.
- Overrides:
subAppend
in class WriterAppender<E>
getRollingPolicy
public RollingPolicy getRollingPolicy()
getTriggeringPolicy
public TriggeringPolicy getTriggeringPolicy()
setRollingPolicy
public void setRollingPolicy(RollingPolicy policy)
- Sets the rolling policy. In case the 'policy' argument also implements
TriggeringPolicy
, then the triggering policy for this appender
is automatically set to be the policy argument.
- Parameters:
policy
-
setTriggeringPolicy
public void setTriggeringPolicy(TriggeringPolicy policy)
Copyright © 2005-2008 QOS.ch. All Rights Reserved.