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

Does sometimes not pick up rotated logs #78

Closed
piotr1212 opened this issue May 12, 2021 · 5 comments · Fixed by #79
Closed

Does sometimes not pick up rotated logs #78

piotr1212 opened this issue May 12, 2021 · 5 comments · Fixed by #79

Comments

@piotr1212
Copy link
Contributor

According to the readme: Rotating the log files while the exporter is running is OK. While this works most of the times, it already happened twice in two days that it does not and the exporter keeps tracking deleted files.


postfix+ 18282     1  0 May11 ?        00:07:50 /usr/local/bin/postfix_exporter --postfix.logfile_path=/var/log/mail.log

ls -l /proc/18282/fd/
total 0
<< skipped >>
lr-x------ 1 postfix-exporter postfix-exporter 64 May 11 11:55 3 -> '/var/log/mail.log.1 (deleted)'

rotate config:

/var/log/mail.log
{
        rotate 24
        hourly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        maxsize 200M
        postrotate
                /usr/lib/rsyslog/rsyslog-rotate
        endscript
}

OS: Ubuntu 18.04 LTS

Running latest commit b050cdf

BTW could not get journald log working at all, probably related to #55

@piotr1212
Copy link
Contributor Author

I see there is a bunch of known issues with hpcloud/tail, switched to a better maintained fork to see if that fixes our issues. Will post update if it works. piotr1212@6039f07

@piotr1212
Copy link
Contributor Author

Been running the version with nxadm/tail on multiple mailservers for 5 days with hourly rotate and the issue did not occur anymore, before this patch it would happen every few hours.

@travisghansen
Copy link

Even with the updated code I'm still seeing failures. I'm using the busybox syslogd launched as such syslogd -n -b 0 -s 50000 where the daemon itself does log rotation on it's own (not logrotate). Any ideas what could be causing the sporadic behavior in this setup?

@piotr1212
Copy link
Contributor Author

I also still see it happening once in a while, don't know why. Is much better than before though.

@travisghansen
Copy link

I toyed with using a named pipe but I didn’t have much luck getting the tail library to properly read data continuously (hacked the code and tried various options in the config struct). Ultimately I resorted to a cronjob to restart the collector on an interval (I run the container with supervisor so restarts are viable).

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

Successfully merging a pull request may close this issue.

2 participants