Skip to content

Config not properly reapplied on reopen? #107

@cphrmky

Description

@cphrmky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions