Class RollingFileAppender<E>

All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable<E>, LifeCycle

public class RollingFileAppender<E> extends FileAppender<E>
RollingFileAppender extends FileAppender to back up 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

Author:
Heinz Richter, Ceki Gülcü
  • Constructor Details

    • RollingFileAppender

      public RollingFileAppender()
  • Method Details

    • start

      public void start()
      Description copied from class: FileAppender
      If the value of File is not null, then FileAppender.openFile(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>
    • stop

      public void stop()
      Description copied from class: OutputStreamAppender
      Stop this appender instance. The underlying stream or writer is also closed.

      Stopped appenders cannot be reused.

      Specified by:
      stop in interface LifeCycle
      Overrides:
      stop in class FileAppender<E>
    • setFile

      public void setFile(String file)
      Description copied from class: FileAppender
      The File property takes a string value which should be the name of the file to append to.
      Overrides:
      setFile in class FileAppender<E>
    • getFile

      public String getFile()
      Description copied from class: FileAppender
      Returns the value of the File property.

      This method may be overridden by derived classes.

      Overrides:
      getFile in class FileAppender<E>
    • rollover

      public void rollover()
      Implemented by delegating most of the rollover work to a rolling policy.
    • subAppend

      protected void subAppend(E event)
      This method differentiates RollingFileAppender from its super class.
      Overrides:
      subAppend in class OutputStreamAppender<E>
    • getRollingPolicy

      public RollingPolicy getRollingPolicy()
    • getTriggeringPolicy

      public TriggeringPolicy<E> 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<E> policy)