Where is the Docker daemon log?
Solution 1:
It depends on your OS. Here are the few locations, with commands for few Operating Systems:
- Ubuntu (old using upstart ) -
/var/log/upstart/docker.log
- Ubuntu (new using systemd ) -
sudo journalctl -fu docker.service
- Amazon Linux AMI -
/var/log/docker
- Boot2Docker -
/var/log/docker.log
- Debian GNU/Linux -
/var/log/daemon.log
- CentOS -
/var/log/message | grep docker
- CoreOS -
journalctl -u docker.service
- Fedora -
journalctl -u docker.service
- Red Hat Enterprise Linux Server -
/var/log/messages | grep docker
- OpenSuSE -
journalctl -u docker.service
- OSX -
~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log/docker.log
- Windows -
Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time
, as mentioned here.
Solution 2:
If your OS is using systemd
then you can view docker daemon log with:
sudo journalctl -fu docker.service
Solution 3:
Using CentOS 7.x or 8.x, 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/
Solution 4:
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/docker.log
Instead I can find log file as below.
-
Enter into VM.
$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
or$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
-
Check log file
/ # tail -f /var/log/docker.log