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

where we can find docker container logs #4597

Closed
vmuthuprasad opened this issue May 22, 2020 · 4 comments
Closed

where we can find docker container logs #4597

vmuthuprasad opened this issue May 22, 2020 · 4 comments

Comments

@vmuthuprasad
Copy link

I want to consume docker container STDOUT using filebeat. In general it is mentioned container logs will be stored under /var/lib/docker/containers/

docker inspect f98f60f4db0c
gives log path in

"LogPath": "/var/lib/docker/containers/f98f60f4db0c3220e624312cd71b0c85ddcd1919c75567deae35f4ab07ab0877/f98f60f4db0c3220e624312cd71b0c85ddcd1919c75567deae35f4ab07ab0877-json.log"
but i don't see even

/var/lib/docker/
I don't see any logs even under

~/Library/Containers/com.docker.docker/Data/vms/0/

following are my mac and docker

macOS Version: 10.14.6

Docker Version: 2.3.0.2 (docker dekstop)

please let me know where can i find docker container logs for mac to capture them in filebeat.

@djs55
Copy link
Contributor

djs55 commented May 22, 2020

Thanks for your report. Unfortunately the paths /var/lib/docker/containers are inside the helper Linux VM.

Perhaps you could run filebeat inside a container with a command like:

$ docker run -it -v /var/lib/docker/containers:/var/lib/docker/containers alpine sh
/ # ls /var/lib/docker/containers/
082d8f8ad6f05edac3731c64ff066ffc8367dbe9fa121d3d8d21075861e8c40a  92cdf44069f25e520b354ff1e73f17350e461d44cce1b088c34220eb137f392c

which would give it access to the correct paths.

Another possibility is to write a small program / script which uses docker events to see when containers are started and stopped, and then use docker logs to write the logs to a file.

Another possibility is to write a Docker logging plugin which could ship the logs somewhere.

Let me know what you think.

@vmuthuprasad
Copy link
Author

Thanks David, could you please suggest ideal logging plugin to ship logs

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Oct 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants