Open Minnozz opened 7 years ago
i just confirmed this is actually a bug. It doesn't finish reading the renamed file before reopening the new file. I say this is a bug because it claims to follow BSD tail, which doesn't suffer from this issue.
Indeed some log entries may be lost when the file is rotated, but the BSD tail has the same issue.
It's a tradeoff. If you just use the logs to do some statistics analysis, then I think it's acceptable.
I was wondering if the log file that is begin followed (Follow: true, ReOpen: true) will be read until the end when it is moved and recreated. I can imagine a race condition where a line is written to the log file just before the file is rotated, and the new log file is openend before the old one has been read until the end.