Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util.logging

Class FileHandler

java.lang.Object
|
+--java.util.logging.Handler
   |
   +--java.util.logging.StreamHandler
      |
      +--java.util.logging.FileHandler


public class FileHandler

extends StreamHandler

A FileHandler publishes log records to a set of log files. A maximum file size can be specified; as soon as a log file reaches the size limit, it is closed and the next file in the set is taken.

Configuration: Values of the subsequent LogManager properties are taken into consideration when a FileHandler is initialized. If a property is not defined, or if it has an invalid value, a default is taken without an exception being thrown.

File Name Patterns: The name and location and log files are specified with pattern strings. The handler will replace the following character sequences when opening log files:

If the pattern string does not contain %g and count is greater than one, the handler will append the string .%g to the specified pattern.

If the handler attempts to open a log file, this log file is being used at the time of the attempt, and the pattern string does not contain %u, the handler will append the string .%u to the specified pattern. This step is performed after any generation number has been appended.

Examples for the GNU platform:

Author:

Constructor Summary

FileHandler()

Constructs a FileHandler, taking all property values from the current LogManager LogManager configuration.
FileHandler(java.lang.String pattern, boolean append)

FileHandler(java.lang.String pattern, int limit, int count)

FileHandler(java.lang.String pattern, int limit, int count, boolean append)

Constructs a FileHandler given the pattern for the location and name of the produced log files, the size limit, the number of log files thorough which the handler will rotate, and the append property.

Method Summary

voidpublish(java.util.logging.LogRecord record)

Constructor Details

FileHandler

public FileHandler()

Constructs a FileHandler, taking all property values from the current LogManager LogManager configuration.

Throws:


FileHandler

public FileHandler(java.lang.String pattern, boolean append)

Parameters:


FileHandler

public FileHandler(java.lang.String pattern, int limit, int count)

Parameters:


FileHandler

public FileHandler(java.lang.String pattern, int limit, int count, boolean append)

Constructs a FileHandler given the pattern for the location and name of the produced log files, the size limit, the number of log files thorough which the handler will rotate, and the append property. All other property values are taken from the current LogManager LogManager configuration.

Parameters:

Throws:


Method Details

publish

public void publish(java.util.logging.LogRecord record)

Parameters: