hpcloud/tail

Config not properly reapplied on reopen?

cphrmky opened this issue · 0 comments

I'm using this package like this:

tail.TailFile("/path/to/some.log", tail.Config{Follow: true, ReOpen: true, Location: &tail.SeekInfo{Offset: 0, Whence: 2}})

So when the file is first opened for tailing the seek is waiting for the next line. When the file is truncated/moved/deleted by logrotate or similar, the reopen happens, but the initially applied tail.SeekInfo is not applied on the reopen, and I get the last N of lines in the log (whatever the default is) before the follow commences.

Not clear to me if this is intended behavior, or a bug.