Class RollingPolicyBase

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.RollingPolicyBase
All Implemented Interfaces:
RollingPolicy, ContextAware, LifeCycle
Direct Known Subclasses:
FixedWindowRollingPolicy, TimeBasedRollingPolicy

public abstract class RollingPolicyBase extends ContextAwareBase implements RollingPolicy
Implements methods common to most, it not all, rolling policies. Currently such methods are limited to a compression mode getter/setter.
Author:
Ceki Gülcü
  • Field Details

    • compressionMode

      protected CompressionMode compressionMode
    • fileNamePatternStr

      protected String fileNamePatternStr
  • Constructor Details

    • RollingPolicyBase

      public RollingPolicyBase()
  • Method Details

    • determineCompressionMode

      protected void determineCompressionMode()
      Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr. Patterns ending with .gz imply GZIP compression, endings with '.zip' imply ZIP compression. Otherwise and by default, there is no compression.
    • setFileNamePattern

      public void setFileNamePattern(String fnp)
    • getFileNamePattern

      public String getFileNamePattern()
    • getCompressionMode

      public CompressionMode getCompressionMode()
      Description copied from interface: RollingPolicy
      The compression mode for this policy.
      Specified by:
      getCompressionMode in interface RollingPolicy
      Returns:
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface LifeCycle
    • start

      public void start()
      Specified by:
      start in interface LifeCycle
    • stop

      public void stop()
      Specified by:
      stop in interface LifeCycle
    • setParent

      public void setParent(FileAppender<?> appender)
      Description copied from interface: RollingPolicy
      This method allows RollingPolicy implementations to be aware of their containing appender.
      Specified by:
      setParent in interface RollingPolicy
    • isParentPrudent

      public boolean isParentPrudent()
    • getParentsRawFileProperty

      public String getParentsRawFileProperty()