pygtail icon indicating copy to clipboard operation
pygtail copied to clipboard

pygtail does not properly follow files rotated to .zip files

Open tlasica opened this issue 10 years ago • 4 comments

Observed with rotation done by logback.

https://github.com/bgreenlee/pygtail/blob/master/pygtail/core.py#L214

tlasica avatar Nov 06 '15 00:11 tlasica

Would you mind submitting a PR, since you're in a position to test?

bgreenlee avatar Nov 06 '15 00:11 bgreenlee

Sure, I will do it tomorrow.

tlasica avatar Nov 06 '15 01:11 tlasica

Ha, it seems to be much more complex then I initially suspected. In addition I am not sure how subsequent rotated files are handled in current implementation e.g. .2.gz, .3.gz....

tlasica avatar Nov 08 '15 04:11 tlasica

You don't need to handle subsequent rotated files. You only need to handle the case where the file you were tailing was just rotated, in which case it would have, for example, a .0.gz or .1.gz extension.

bgreenlee avatar Nov 08 '15 06:11 bgreenlee