sematext / logagent-js

Extensible log shipper with input/output plugins, buffering, parsing, data masking, and small memory/CPU footprint
https://sematext.com/logagent
Apache License 2.0
389 stars 79 forks source link

Stop watching a log file after it's been rotated #232

Closed otisg closed 4 years ago

otisg commented 4 years ago

https://www.npmjs.com/package/tail-forever has unwatch As does https://github.com/lucagrulla/node-tail

megastef commented 4 years ago

Did somebody report that rotated files are still watched? Which platforming Linux kernel is used? Can you provide more details to reproduce the issue?

File descriptor changes are monitored automatically in in tailF: https://github.com/mingqi/tailF/blob/master/tail-forever.coffee#L194-L208 The renamed file is closed and the new one opened. Please set environment variable DUBUG="tail-forever" to watch the debug output.

According to past tests Logagent had no issues with rotating log files.

There was a similar issue related to old Linux kernel versions: https://github.com/mingqi/tailF/issues/9