Cherry-pick #19531 to 7.x: Add docker logs
support to the Elastic Log Driver
#19808
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 logs
command 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 -f
for 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.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
mage buildAndInstall
dockerlogbeat
for an example of how to run the plugin against a containerdocker logs
command against that container with various options, make sure everything works as expected.