Where is the Docker daemon log?

2019-01-02 16:20发布

Where is the Docker daemon log? Oddly cannot find an answer to this via man, StackOverflow or Docker Docs. Note I am not asking for the docker container STDOUT, but the daemon log for troubleshooting communications between the client and container via daemon / proxy.

10条回答
深知你不懂我心
2楼-- · 2019-01-02 17:11

Using CentOS7, logs are available using the command journalctl -u docker. Answering distinctly, because @sabin's answer might be accurate for older versions of CentOS but was not true for me.

systemd has its own logging system called the journal. The logs for the docker daemon can be viewed using journalctl -u docker

Ref: https://docs.docker.com/engine/admin/configuring/

查看更多
听够珍惜
3楼-- · 2019-01-02 17:12

If your OS is using systemd then you can view docker daemon log with:

sudo journalctl -fu docker.service
查看更多
忆尘夕之涩
4楼-- · 2019-01-02 17:14

For Mac with Docker Toolbox, ssh into the VM first with docker-machine ssh %VM-NAME% and then check /var/log/docker.log

查看更多
听够珍惜
5楼-- · 2019-01-02 17:17

In my environment(docker for mac 17.07), there is no log file at ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log/d‌​ocker.log

Instead I can find log file as below.

  1. Enter into VM.

    $ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

  2. Check log file

    / # tail -f /var/log/docker.log

查看更多
登录 后发表回答