archiecobbs/logwarn

logwarn doesn't handle copytruncate log rotation

Closed this issue · 0 comments

What steps will reproduce the problem?
1. have a log source that cannot be restarted for log rotation
2. copy and truncate its log file for rotation
3. observe that logwarn never talks to you again

What is the expected output? What do you see instead?

I'd naturally expect logwarn to see that the file size or line count is smaller 
than what's noted in the index file and automatically execute "-i" behavior. As 
it stands, logwarn remains silent unless you manually init the index file.

What version of the product are you using? On what operating system?
1.0.7 on Centos Linux 5.5/6.0.

Please provide any additional information below.

It seems to me that the file size info you get from stat() would immediately 
show that the offset is larger than the current file size. It seems to me that 
initializing the index file at that point makes sense... I can't see where this 
would be bad behavior in any case I can imagine.

Thanks for a great tool!

Original issue reported on code.google.com by email.addy on 2 Apr 2012 at 11:01