* GenerationFileHandler

disable flush-minimizing optimization until its effect on watching logs in web UI can be minimized
This commit is contained in:
gojomo
2011-01-12 00:18:28 +00:00
parent 463d295c24
commit 9e75ff0019
@@ -143,25 +143,27 @@ public class GenerationFileHandler extends FileHandler {
getFormatter().format(record);
super.publish(record);
}
/**
* Flush only 1/100th of the usual once-per-record, to reduce the time
* spent holding the synchronization lock. (Flush is primarily called in
* a superclass's synchronized publish()).
*
* The eventual close calls a direct flush on the target writer, so all
* rotates/ends will ultimately be fully flushed.
*
* @see java.util.logging.StreamHandler#flush()
*/
@Override
public synchronized void flush() {
flushCount++;
if(flushCount==100) {
super.flush();
flushCount=0;
}
}
int flushCount;
//
// TODO: determine if there's another way to have this optimization without
// negative impact on log-following (esp. in web UI)
// /**
// * Flush only 1/100th of the usual once-per-record, to reduce the time
// * spent holding the synchronization lock. (Flush is primarily called in
// * a superclass's synchronized publish()).
// *
// * The eventual close calls a direct flush on the target writer, so all
// * rotates/ends will ultimately be fully flushed.
// *
// * @see java.util.logging.StreamHandler#flush()
// */
// @Override
// public synchronized void flush() {
// flushCount++;
// if(flushCount==100) {
// super.flush();
// flushCount=0;
// }
// }
// int flushCount;
}