I'm trying to watch log rotated files with node.js and parse each line for keywords. The Problem is: after logrotate I'm still watching the old file because of the opened file discriptor.
I'm new to this and have two questions:
- Is it advisable to check after every line the inode and if it's not the same close the fd and read the file 'filename' again?
- What's the best way achieving this? Trying to avoid callbacks and use events instead or is there an library already?
Thanks!