Request for feature: Logger.sync()

Alexandre Rafalovitch writes:
 > Hi,
 > 
 > I was looking at the Logger class with the buffering Logger in mind and I
 > realized, that there is one function missing that would be nice to have and
 > easy to implement.
 > 
 > This function is Logger.sync() (or flush()). This basically would flash the
 > log buffer if any on the disk.
 > That would be useful for debugging without having to change buffer size to
 > 0 and back.

Correct, BTW if you set the bufsize to 0, this will only affect the
currently running Jigsaw process, restarting it will "forget" that
change (if you're interested in the fix let me know).

How about:

w3c/jigsaw/http/Logger.java

...

/**
 * Sync any pending state of the logger back to disk.
 */

    public abstract void sync();

Which could be implemented by the ComonLogger

I would rather favor one single call, since you don't know wether a
logger instance uses different streams to report log entries, errors
and traces.

 > If flush function was present, I could create a log checkpoint resource
 > very easily. Or maybe a resource that can flush the buffer every minute
 > whether it is full or not (I can see some problems with keeping that
 > resource from being purged though.. ).

This checkpoint resource is in my todo list, it should also (config
attributes) checkpoint the global jigsaw state every N seconds (so
that we use only one thread for all the checkpointing)

It's so easy to write that I'll write it today :-)

Anselm.

Received on Tuesday, 12 November 1996 06:04:07 UTC