Title
Grace Software
JavaLog

$Revision: 1.1 $
$Date: 1999/10/11 00:05:14 $

Logging to a File

JavaLog can log events to one or more files using the FileHandler class. To enable logging to a file, use the command line property:
    $ java -Dlog.handler.name.url=file:filename MyClass
This will cause JavaLog to write all events to filename. Here, filename can be either an absolute filename or a relative filename. Absolute files have a path prefix like /tmp/JavaLog/log.log. Relative paths have no path prefix like log/log.log and are relative to the current directory in which the java program is run.

Limiting the file size

If the JavaLog program is a server, it will run for extended periods of time and could eventually create huge log files. JavaLog helps solve this problem by allowing the run time user to specify a maximum file size. When this maximum file size is exceeded, the last half of the file is copied to new temporary file, and then copied back to the log file and logging continues. The property that does this is:
    $ java -Dlog.handler.name.maxsize=size MyClass
Here size is a numeric value followed by a size character. For example, the following command line starts MyClass logging with a 1500 Kbyte (1.5 Mbyte) max size.
    $ java -Dlog.handler.file.maxsize=file:test.log -Dlog.handler.file.maxsize=1500k MyClass