Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the log file guaranteed to be read until the end before being reopened? #127

Open
Minnozz opened this issue Sep 5, 2017 · 2 comments

Comments

@Minnozz
Copy link

Minnozz commented Sep 5, 2017

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.

@chrisleavoy
Copy link

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.

@ahrtr
Copy link

ahrtr commented Nov 27, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants