Skip to content

Add option to sync from beginning of log file #83

Closed

Description

@azell

From the Markdown:

"remote_syslog automatically detects and activates new log files that match its file specifiers. For example, *.log may be provided as a file specifier, and remote_syslog will detect a some.log file created after it was started. Globs are re-checked every 10 seconds.

Note: messages may be written to files in the 0-10 seconds between when the file is created and when the periodic glob check detects it. This data is not acted on."

It would be useful to tell the system to seek to the beginning of the new log file instead of the end. In best case, no log lines are dropped. In the worse case there are several duplicates which can either be uniqued or run through an idempotent back-end.

IMO the downside of possible is dupes is worth not dropping any data in the common case of log rotation.

Activity

  1. bradvido commented on Nov 23, 2015

    @bradvido

    +1
    It would be ideal if the state was persisted as well, meaning only start from the beginning once. In the case that the remote_syslog2 service is restarted after it has tailed some files from the beginning, I wouldn't want it to restart at the beginning of all the files all over again.

    For reference, the ruby-filewatch file-tailing library has a concept of a sincedb which tracks the position tailed in the file and also handles rotation gracefully: https://github.com/jordansissel/ruby-filewatch

  2. jbardin commented on Jan 13, 2016

    @jbardin

    IMHO, this should be the default. I don't think the expected behavior would be to lose the start of every new log file in directories that are being watched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      ⌂ 换网址