Where is the Docker daemon log?

LoggingDocker

Logging Problem Overview


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.

Logging Solutions


Solution 1 - Logging

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 - cat /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
  • macOS - ~/Library/Containers/com.docker.docker/Data/log/vm/d‌​ocker.log
  • Windows - Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time, as mentioned here.

Solution 2 - Logging

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

sudo journalctl -fu docker.service

Solution 3 - Logging

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 - Logging

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
    or
    $ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

  2. Check log file

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

Solution 5 - Logging

For Docker Mac Native (without Boot2Docker or docker-machine, running your Docker installation without extra VirtualBox - which I would recommend over the others), all the answers didn´t work for me. But the Docker docs fortunately came to the rescue.

If you want to see the docker daemon logs on commandline, just type:

syslog -k Sender Docker

Alternatively from Mac OS Sierra on, you can use the newly designed Mac Console App (don´t get confused here with the App "Terminal", the Console App´s icon looks quite similar - I found it with the Launchpad below "Others.."). There´s an article here which describes the general usage of the new Mac OS Sierra Console App, which didn´t make it into the official Docker docs yet.

Inside the Console App just choose system.log and type Docker into the search bar. That´s it. Now you should see all Docker related logs.

Solution 6 - Logging

Docker for Mac (Beta)

~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log/d‌​ocker.log

Solution 7 - Logging

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

Solution 8 - Logging

The location of docker logs has changed for Mac OSX to ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring

See Docker Daemon Documentation

Solution 9 - Logging

Also you can see logs by this command:

docker service ps --no-trunc {serviceName}

Solution 10 - Logging

I was not able to find the logs under Manjaro 20/Arch Linux. Instead i just stopped the docker daemon process and restarted daemon in debug mode with $ sudo dockerd -D to produce logs. It's unfortunate that the official Docker docs don't provide this info for Arch.
This should not only work for Arch, but for other systems in general.

Solution 11 - Logging

In the answer of Sabin, the Windows command that works for me is:

Get-EventLog -LogName Application -Source DockerService

Solution 12 - Logging

Add ways to find docker daemon log in windows:

try

When using docker machine on Windows and Mac OSX, the daemon runs inside a virtual machine.

First, find your active Docker machine.

docker-machine ls Find the name of the active docker machine under the NAME column in the output.

You can copy the docker daemon log file to your local directory for analysis:

docker-machine scp default:/var/log/docker.log ./ Where default is the name of active your docker machine.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser2603634View Question on Stackoverflow
Solution 1 - LoggingSabinView Answer on Stackoverflow
Solution 2 - LoggingmixelView Answer on Stackoverflow
Solution 3 - LoggingjoedragonsView Answer on Stackoverflow
Solution 4 - LoggingSunghoMoonView Answer on Stackoverflow
Solution 5 - LoggingjonashacktView Answer on Stackoverflow
Solution 6 - LoggingLauriView Answer on Stackoverflow
Solution 7 - LoggingYongJiang ZhangView Answer on Stackoverflow
Solution 8 - LoggingcaraView Answer on Stackoverflow
Solution 9 - LoggingTaras VaskivView Answer on Stackoverflow
Solution 10 - LoggingnichoioView Answer on Stackoverflow
Solution 11 - LoggingVancho PansaView Answer on Stackoverflow
Solution 12 - LoggingGabriel WuView Answer on Stackoverflow