Package org.apache.log.output.io.rotate
Class UniqueFileStrategy
java.lang.Object
org.apache.log.output.io.rotate.UniqueFileStrategy
- All Implemented Interfaces:
FileStrategy
Strategy for naming log files based on appending time suffix.
A file name can be based on simply appending the number of miliseconds
since (not really sure) 1/1/1970.
Other constructors accept a pattern of a
SimpleDateFormat
to form the appended string to the base file name as well as a suffix
which should be appended last.
A new UniqueFileStrategy( new File( "foo." ), "yyyy-MM-dd", ".log" )
object will return File
objects with file names like
foo.2001-12-24.log
- Author:
- Bernhard Huber, Giacomo Pati
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUniqueFileStrategy
(File baseFile) Creation of a new Unique File Strategy ??UniqueFileStrategy
(File baseFile, String pattern) Creation of a new Unique File Strategy ??UniqueFileStrategy
(File baseFile, String pattern, String suffix) Creation of a new Unique File Strategy ?? -
Method Summary
-
Field Details
-
m_baseFile
-
m_formatter
-
m_suffix
-
-
Constructor Details
-
UniqueFileStrategy
Creation of a new Unique File Strategy ??- Parameters:
baseFile
- the base file
-
UniqueFileStrategy
Creation of a new Unique File Strategy ??- Parameters:
baseFile
- the base filepattern
- the format pattern
-
UniqueFileStrategy
Creation of a new Unique File Strategy ??- Parameters:
baseFile
- the base filepattern
- the format patternsuffix
- the suffix ??
-
-
Method Details
-
nextFile
Calculate the real file name from the base filename.- Specified by:
nextFile
in interfaceFileStrategy
- Returns:
- File the calculated file name
-