Class RollingPolicyBase

java.lang.Object
org.apache.log4j.rolling.RollingPolicyBase
All Implemented Interfaces:
RollingPolicy, org.apache.log4j.spi.OptionHandler
Direct Known Subclasses:
FixedWindowRollingPolicy, TimeBasedRollingPolicy

public abstract class RollingPolicyBase extends Object implements RollingPolicy, org.apache.log4j.spi.OptionHandler
Implements methods common to most, it not all, rolling policies. Currently such methods are limited to a compression mode getter/setter.
  • Field Details

    • FNP_NOT_SET

      private static final String FNP_NOT_SET
      Error message.
      See Also:
    • SEE_FNP_NOT_SET

      private static final String SEE_FNP_NOT_SET
      Reference for error message.
      See Also:
    • patternConverters

      private org.apache.log4j.pattern.PatternConverter[] patternConverters
      File name pattern converters.
    • patternFields

      private ExtrasFormattingInfo[] patternFields
      File name field specifiers.
    • fileNamePatternStr

      private String fileNamePatternStr
      File name pattern.
    • activeFileName

      protected String activeFileName
      Active file name may be null. Duplicates FileAppender.file and should be removed.
  • Constructor Details

    • RollingPolicyBase

      public RollingPolicyBase()
  • Method Details

    • activateOptions

      public void activateOptions()
      Specified by:
      activateOptions in interface org.apache.log4j.spi.OptionHandler
    • setFileNamePattern

      public void setFileNamePattern(String fnp)
      Set file name pattern.
      Parameters:
      fnp - file name pattern.
    • getFileNamePattern

      public String getFileNamePattern()
      Get file name pattern.
      Returns:
      file name pattern.
    • setActiveFileName

      public void setActiveFileName(String afn)
      Deprecated.
      Duplicates FileAppender.file and should be removed
      ActiveFileName can be left unset, i.e. as null.
      Parameters:
      afn - active file name.
    • getActiveFileName

      public String getActiveFileName()
      Deprecated.
      Duplicates FileAppender.file and should be removed
      Return the value of the ActiveFile option.
      Returns:
      active file name.
    • parseFileNamePattern

      protected final void parseFileNamePattern()
      Parse file name pattern.
    • formatFileName

      protected final void formatFileName(Object obj, StringBuffer buf)
      Format file name.
      Parameters:
      obj - object to be evaluted in formatting, may not be null.
      buf - string buffer to which formatted file name is appended, may not be null.
    • getDatePatternConverter

      protected final org.apache.log4j.pattern.PatternConverter getDatePatternConverter()
    • getIntegerPatternConverter

      protected final org.apache.log4j.pattern.PatternConverter getIntegerPatternConverter()