hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.72k stars 505 forks source link

Config not properly reapplied on reopen? #107

Open cphrmky opened 7 years ago

cphrmky commented 7 years ago

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.