All Implemented Interfaces:
Runnable, Action

@Plugin(name="Delete", category="Core", printObject=true) public class DeleteAction extends AbstractPathAction
Rollover or scheduled action for deleting old log files that are accepted by the specified PathFilters.
  • Field Details

    • pathSorter

      private final PathSorter pathSorter
    • testMode

      private final boolean testMode
    • scriptCondition

      private final ScriptCondition scriptCondition
  • Constructor Details

    • DeleteAction

      DeleteAction(String basePath, boolean followSymbolicLinks, int maxDepth, boolean testMode, PathSorter sorter, PathCondition[] pathConditions, ScriptCondition scriptCondition, StrSubstitutor subst)
      Creates a new DeleteAction that starts scanning for files to delete from the specified base path.
      Parameters:
      basePath - base path from where to start scanning for files to delete.
      followSymbolicLinks - whether to follow symbolic links. Default is false.
      maxDepth - The maxDepth parameter is the maximum number of levels of directories to visit. A value of 0 means that only the starting file is visited, unless denied by the security manager. A value of MAX_VALUE may be used to indicate that all levels should be visited.
      testMode - if true, files are not deleted but instead a message is printed to the status logger at INFO level. Users can use this to do a dry run to test if their configuration works as expected.
      sorter - sorts
      pathConditions - an array of path filters (if more than one, they all need to accept a path before it is deleted).
      scriptCondition -
  • Method Details