public class TLcdJULFileHandler extends Handler
Handler
that logs all messages to a file. This class is
similar to the standard FileHandler
but it can be used by any number
of Loggers
.
The TLcdJULFileHandler
maintains a list of several log files.
The current (most recent) file has the index 0 while older logs have
corresponding increasing numbers. When the size of the current log file
exceeds a certain limit, the log files are rotated. The total number of log
files is also limited - if the limit is exceeded then the oldest file is
deleted.
The first time a handler of this type is created, it reads the following properties from the logging configuration file:
Handler
. The default is Level.INFO
.
Filter
class. The default is no filter.Formatter
class. The default is
TLcdSimpleFomratter
.false
, meaning that the logs
are rotated and a new file is created.
A pattern consists of a string that includes the following special components that will be replaced at runtime:
Constructor and Description |
---|
TLcdJULFileHandler()
Creates a new TLcdJULFileHandler with the default settings.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream of the current TLcdJULFileHandler..
|
void |
flush()
Flushes any buffered message.
|
void |
publish(LogRecord aRecord)
Writes the given
LogRecord to the log. |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
public TLcdJULFileHandler()
public void publish(LogRecord aRecord)
LogRecord
to the log. The file is flushed
after each log record.public void close() throws SecurityException
close
in class Handler
SecurityException