OpenNTF / openliberty-domino

Open Liberty server embedded in Domino
Apache License 2.0
7 stars 3 forks source link

Log file watching on Windows is extremely delayed #19

Closed jesse-gallagher closed 4 years ago

jesse-gallagher commented 5 years ago

I suspect that this is just a limitation of Java NIO on Windows: I'm using the directory watcher mechanism, but it doesn't get immediate notifications and seems to only poll every couple of minutes. It may be best to switch to explicit quicker polling on Windows if possible.

jesse-gallagher commented 5 years ago

This may be tricky. The NIO WatchService is already set up to poll every 25ms, though it's possible that it's specifically polling the internal watcher, not the physical filesystem.

It's possible to "kick" the watcher: if you open a log file in e.g. Notepad++, then any changes that hadn't yet made it to the console will immediately show up.

If NIO doesn't work for it, it may be "better" to instead set up a scheduled thread to manually check every so often.