Cherry-pick #19531 to 7.x: Add docker logs support to the Elastic Log Driver#19808
Merged
fearful-symmetry merged 1 commit intoelastic:7.xfrom Jul 9, 2020
Merged
Conversation
* init commit of docker logs support * remove vendor * fix tests * mage fmt * code cleanup * change logging directories around, add code to remove containers * remove error message on EOF * fix config, add docs * more fixes, migrate to writing logs to docker's own location * add changelog entry * docs cleanup (cherry picked from commit d53cd12)
Contributor
|
Pinging @elastic/integrations (Team:Integrations) |
kaiyan-sheng
approved these changes
Jul 9, 2020
Contributor
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
urso
approved these changes
Jul 9, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #19531 to 7.x branch. Original message:
What does this PR do?
See #19371 and #13990
This PR adds support for the
docker logscommand to the Elastic Log Driver. This basically re-implements the "default" log driver, using Docker's own libraries, inside the Elastic Log Driver. In theory this should be a simple addition, as we're just gluing existing libraries on top on what we already have.There's still some oddities going on here:
docker logs -ffor an expended period of time without additional log lines:Error grabbing logs: error decoding log message: net/http: request canceled (Client.Timeout exceeded while reading body)This doesn't seem to be something in my library. Looks like it was due to this PR here: add a 10s timeout to the client object. docker/cli#1872Why is it important?
This is a "must have" from the Cloud folks, and it's good to have in general. Also required for docker certification.
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
mage buildAndInstalldockerlogbeatfor an example of how to run the plugin against a containerdocker logscommand against that container with various options, make sure everything works as expected.