-
Notifications
You must be signed in to change notification settings - Fork 13
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
Not working with Apache rotatelogs tool #57
Comments
Thanks for the report, I'll take a look. Would you be able to get a |
Slightly different names,
|
Hi, do you have any ideas about why it's not working? |
Still hoping to get a better handle on the link semantics and the Pushing random lines to file
Results in (with some extra debugging):
It should be possible to hook that into some re-watch logic to update both the stored |
I reimplemented the tailing logic in my project to see how far I can get, and found that besides This seems to be more reliable in case that a file is quickly rotated twice, because the watcher on the parent folder gets notified of every rotation, but if you only watch the file itself for metadata changes, there's a race condition where you lose the second rotation because it happens before you've re-watched the file after the first rotation. While this should be unlikely, when I started a container with Apache and my program at the same time, for some reason Apache did a double rotation of all log files during its initialization, so my program lost events. Right now, my program keeps a Lines reader for a file until it gets a |
Hi, I'm trying to collect logs from Apache access log files, but I stop receiving lines every time the log files rotate.
For a test, I have Apache configured to rotate logs every 30 seconds:
According to rotatelogs documentation, this makes
latest.access.log
a hard link that always has the latest version of the logs. If I follow it usingtail
, it works:If I use
MuxedLines::add_file
on the same file, I stop receiving lines once the file is rotated:The text was updated successfully, but these errors were encountered: