From 9e75ff001920c57e45b8ba8d3486350f236352fd Mon Sep 17 00:00:00 2001 From: gojomo Date: Wed, 12 Jan 2011 00:18:28 +0000 Subject: [PATCH] * GenerationFileHandler disable flush-minimizing optimization until its effect on watching logs in web UI can be minimized --- .../org/archive/io/GenerationFileHandler.java | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/commons/src/main/java/org/archive/io/GenerationFileHandler.java b/commons/src/main/java/org/archive/io/GenerationFileHandler.java index ae5440c3..03e21ad5 100644 --- a/commons/src/main/java/org/archive/io/GenerationFileHandler.java +++ b/commons/src/main/java/org/archive/io/GenerationFileHandler.java @@ -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; } \ No newline at end of file