Skip to content

Fix duplicate logs & backlogs on container restart#201

Closed
ebr wants to merge 6 commits into
gliderlabs:masterfrom
ebr:187-fix
Closed

Fix duplicate logs & backlogs on container restart#201
ebr wants to merge 6 commits into
gliderlabs:masterfrom
ebr:187-fix

Conversation

@ebr

@ebr ebr commented Jun 13, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown

+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
Copy Markdown
Member

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

@olivergrahl

Copy link
Copy Markdown

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

ebr commented Aug 28, 2016

Copy link
Copy Markdown
Contributor Author

@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

ebr commented Sep 8, 2016

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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