NarrativeScience-old / log.io

Real-time log monitoring in your browser
http://logio.org
Other
4.83k stars 698 forks source link

The file which is mounted (using NFS )on a server cannot be monitored. #231

Closed harlanc closed 4 years ago

harlanc commented 4 years ago

I mounted a folder A from machine AA to folder B on machine BB using NFS , and I launched a log.io-file-input client on machine BB after the log file path is configured correctly.

~/.log.io/inputs/file.json

But the log content changes cannot be displayed on the browser.

BTW, the common log file on machine BB can be monitored successfully.

msmathers commented 4 years ago

log.io uses node's fs.watch() to watch for file changes, which is known to not support NFS: https://nodejs.org/docs/latest/api/fs.html#fs_availability

fs.watchFile() could work, however it uses stat polling which is less efficient than inotify and uses more system resources.

Unfortunately we don't plan to support anything other than fs.watch() in log.io-file-input, however you're welcome to write a custom input that hits our TCP API. Feel free to use the file input code as an example.