Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate logs & backlogs on container restart #201

Closed
wants to merge 6 commits into from

Conversation

ebr
Copy link
Contributor

@ebr ebr commented Jun 13, 2016

Connects to #187

  • Nothing needs to be done on "restart" event, because a "start" event always(?) follows it. A pumpLogs was being called on both restart and start, which caused duplicate entries after a restart.
  • Add support for a BACKLOGS environment variable:
    • Unless specified BACKLOGS=false, it will default to true for all other values, consistent with current behaviour;
    • BACKLOGS=false is equal to docker logs --tail=0

@ebr ebr mentioned this pull request Jun 13, 2016
@olivergrahl
Copy link

+1 for getting this merged. We start containers using cron every couple of minutes, so we get all the log history sent again on every single start.

@josegonzalez
Copy link
Member

We're instead looking at #209 as a more elegant solution to the problem. Thanks for the +1 though.

@olivergrahl
Copy link

Any news on this? It's really an issue for us, as we start containers every couple of minutes, and monitor the logs via Papertrail alerts. Once a string that would trigger an alert gets logged from the container, it will be logged again and again on each container start, resulting in the alert being triggered again and again... Any idea how we can prevent that? Thx!

@ebr
Copy link
Contributor Author

ebr commented Aug 28, 2016

@josegonzalez are we still looking at #209? Shall I rebase this PR, or abandon it?
I'm ok with either, as long as we get a fix for this issue, since it's blocking us from running master in hopes to fix or alleviate #216

@ebr
Copy link
Contributor Author

ebr commented Sep 8, 2016

@josegonzalez (cc @olivergrahl) this is rebased, tested in my Staging and Prod and looking good. Takes care of the backlog dump with BACKLOG=false. double pump was already fixed elsewhere.

olivergrahl added a commit to olivergrahl/logspout that referenced this pull request Nov 16, 2016
See PR gliderlabs#201. Set BACKLOG=false to disable default behaviour of sending backlogs.
@michaelshobbs
Copy link
Member

merged in #280

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

Successfully merging this pull request may close these issues.

4 participants