RevolvingFileStrategy (LogKit API)
Keywords: org.apache.log.output.io.rotate.RevolvingFileStrategy,RevolvingFileStrategy class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.log.output.io.rotate
Class RevolvingFileStrategy

    java.lang.Object
      |
      +--org.apache.log.output.io.rotate.RevolvingFileStrategy

All Implemented Interfaces:
  FileStrategy

public class RevolvingFileStrategy
extends Object
implements FileStrategy

strategy for naming log files based on appending revolving suffix. If the initial rotation is not specified then the class will attempt to calculate the rotation number via the following algorithm. It will search for the file with the highest number in the rotation. It will then increment its rotation number and use that number. If all files in rotation are present then it will then set the initial rotation to the next rotation after the most recently created file.

Author:
  Avalon Development Team, Bernhard Huber, Peter Donald, David Gray

Constructor Summary
`RevolvingFileStrategy(File baseFile, int maxRotations)` Creation of a new instane ofthe revolving file strategy.
`RevolvingFileStrategy(File baseFile, int initialRotation, int maxRotations)` Creation of a new instane ofthe revolving file strategy.

Method Summary
`int` | `getCurrentRotation()` Retrieve the current rotation number.
`File` | `nextFile()` Calculate the real file name from the base filename.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RevolvingFileStrategy

    public RevolvingFileStrategy(File baseFile,
                                 int maxRotations)

  Creation of a new instane ofthe revolving file strategy.

Parameters:
  `baseFile` - the base file
  `maxRotations` - the maximum number of rotations ??

### RevolvingFileStrategy

    public RevolvingFileStrategy(File baseFile,
                                 int initialRotation,
                                 int maxRotations)

  Creation of a new instane ofthe revolving file strategy.

Parameters:
  `baseFile` - the base file
  `initialRotation` - the number of initial rotations ??
  `maxRotations` - the maximum number of rotations??

Method Detail

### nextFile

    public File nextFile()

  Calculate the real file name from the base filename.

  Specified by:
    `nextFile` in interface `FileStrategy`
  Returns:
    File the calculated file name

### getCurrentRotation

    public int getCurrentRotation()

  Retrieve the current rotation number.

  Returns:
    the current rotation number.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Jakarta Project. All Rights Reserved.