[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PATCH: logfile rotation, native methods
From: |
Casey Marshall |
Subject: |
PATCH: logfile rotation, native methods |
Date: |
Thu, 7 Jul 2005 23:17:35 -0700 |
Hi,
The attached patch implements log file rotation in the
java.util.logging.FileHandler class.
One feature this implementation requires, in order to function
properly, are file locks, which to my dismay are still not
implemented. On that point, I'd like to ask what the requirements on
JNI code are for Classpath, if any. I know there are at least two
"standard" APIs in Classpath for native functionality -- the
TARGET_NATIVE macro nonsense, and the VM* classes (I get the feeling
that the latter is preferred now). Should file locks (and, say,
memory-mapped files) use one of these? Or would it be acceptable to
simply write the JNI code directly, surrounded by appropriate #ifdef's?
Ok?
2005-07-07 Casey Marshall <address@hidden>
* java/util/logging/FileHandler.java
(written): new field.
(logFiles): new field.
(<init>): initialize the OutputStream last.
(createFileStream): made non-static; append '.%g' to 'pattern'
if not included; open existing files if 'append' is set; return
byte-counting stream; use 'has', not 'String.indexOf'.
(publish): rotate the file if we go beyond the byte limit; flush
the stream after publishing each record.
(rotate): new method.
(has): new method.
(ostr): new member class.
FileHandler.patch
Description: Binary data
- PATCH: logfile rotation, native methods,
Casey Marshall <=