See Also: FileHandler Members
A FileHandler writes logging records into a specified file or a rotating set of files.
When a set of files is used and a given amount of data has been written to one file, then this file is closed and another file is opened. The name of these files are generated by given name pattern, see below for details. When the files have all been filled the Handler returns to the first and goes through the set again.
By default, the I/O buffering mechanism is enabled, but when each log record is complete, it is flushed out.
XMLFormatter is the default formatter for FileHandler.
FileHandler reads the following LogManager properties for initialization; if a property is not defined or has an invalid value, a default value is used.
Name pattern is a string that may include some special substrings, which will be replaced to generate output files:
Normally, the generation numbers are not larger than the given file count and follow the sequence 0, 1, 2.... If the file count is larger than one, but the generation field("%g") has not been specified in the pattern, then the generation number after a dot will be added to the end of the file name.
The "%u" unique field is used to avoid conflicts and is set to 0 at first. If one FileHandler tries to open the filename which is currently in use by another process, it will repeatedly increment the unique number field and try again. If the "%u" component has not been included in the file name pattern and some contention on a file does occur, then a unique numerical value will be added to the end of the filename in question immediately to the right of a dot. The generation of unique IDs for avoiding conflicts is only guaranteed to work reliably when using a local disk file system.