From: Bastiaan B. <bas...@li...> - 2002-02-04 21:19:46
|
Tony Cheung wrote: >Hi Steve and others, > >First, the changes (if made) will be applied to OpenVMS compilations >only. I am not sure if other platforms require the changes. > >For the disk caching, in order allow other users to "tail -f" on the >application log real-time. The OS needs to flush the changes to the disk >after each line of the logging. The caching should only be applicable to >within a single line of logging, otherwise there would be a delay for >the last few lines of logging to show up. BTW, the fsync() returns >before the I/O completes. > >I agree it's a tradeoff between real-time feedback or better disk >performance. > >Ideas? > >Tony > This feature may be more generally useful as well. In combination with a write cache disabled disk it can provide 'extra safe' logging. Of course log4j/log4cpp are still 'non reliable, best effort' loggers, but this may help a bit. So I suggest to add this as a runtime option to FileAppender. Now for the implementation, doe anyone have a good opion on whether to use fdatasync() or the O_SYNC open flag? Bastiaan |