Class DefaultRolloverStrategy.Builder

java.lang.Object
org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.Builder
All Implemented Interfaces:
Builder<DefaultRolloverStrategy>
Enclosing class:
DefaultRolloverStrategy

public static class DefaultRolloverStrategy.Builder extends Object implements Builder<DefaultRolloverStrategy>
Builds DefaultRolloverStrategy instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public DefaultRolloverStrategy build()
      Description copied from interface: Builder
      Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.
      Specified by:
      build in interface Builder<DefaultRolloverStrategy>
      Returns:
      the configured instance.
    • getMax

      public String getMax()
    • withMax

      Defines the maximum number of files to keep.
      Parameters:
      max - The maximum number of files to keep.
      Returns:
      This builder for chaining convenience
    • getMin

      public String getMin()
    • withMin

      Defines the minimum number of files to keep.
      Parameters:
      min - The minimum number of files to keep.
      Returns:
      This builder for chaining convenience
    • getFileIndex

      public String getFileIndex()
    • withFileIndex

      public DefaultRolloverStrategy.Builder withFileIndex(String fileIndex)
      Defines the file index for rolling strategy.
      Parameters:
      fileIndex - If set to "max" (the default), files with a higher index will be newer than files with a smaller index. If set to "min", file renaming and the counter will follow the Fixed Window strategy.
      Returns:
      This builder for chaining convenience
    • getCompressionLevelStr

      public String getCompressionLevelStr()
    • withCompressionLevelStr

      public DefaultRolloverStrategy.Builder withCompressionLevelStr(String compressionLevelStr)
      Defines compression level.
      Parameters:
      compressionLevelStr - The compression level, 0 (less) through 9 (more); applies only to ZIP files.
      Returns:
      This builder for chaining convenience
    • getCustomActions

      public Action[] getCustomActions()
    • withCustomActions

      public DefaultRolloverStrategy.Builder withCustomActions(Action[] customActions)
      Defines custom actions.
      Parameters:
      customActions - custom actions to perform asynchronously after rollover
      Returns:
      This builder for chaining convenience
    • isStopCustomActionsOnError

      public boolean isStopCustomActionsOnError()
    • withStopCustomActionsOnError

      public DefaultRolloverStrategy.Builder withStopCustomActionsOnError(boolean stopCustomActionsOnError)
      Defines whether to stop executing asynchronous actions if an error occurs.
      Parameters:
      stopCustomActionsOnError - whether to stop executing asynchronous actions if an error occurs
      Returns:
      This builder for chaining convenience
    • getTempCompressedFilePattern

      public String getTempCompressedFilePattern()
    • withTempCompressedFilePattern

      public DefaultRolloverStrategy.Builder withTempCompressedFilePattern(String tempCompressedFilePattern)
      Defines temporary compression file pattern.
      Parameters:
      tempCompressedFilePattern - File pattern of the working file pattern used during compression, if null no temporary file are used
      Returns:
      This builder for chaining convenience
    • getConfig

      public Configuration getConfig()
    • withConfig

      public DefaultRolloverStrategy.Builder withConfig(Configuration config)
      Defines configuration.
      Parameters:
      config - The Configuration.
      Returns:
      This builder for chaining convenience