mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-23 22:26:01 +00:00
* GenerationFileHandler
disable flush-minimizing optimization until its effect on watching logs in web UI can be minimized
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user