Where is the Docker daemon log?
Asked Answered
U

14

474

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.

Unicorn answered 21/6, 2015 at 21:18 Comment(1)
The official list is here: docs.docker.com/config/daemon/#read-the-logsCascara
G
794

It depends on your OS: https://docs.docker.com/config/daemon/logs/

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.
Gnatcatcher answered 21/6, 2015 at 22:55 Comment(8)
If you use syslog driver in daemon mode, this is where your STDOUT logs go as well.Mesarch
I believe that 1.13 moved the OSX location, but I can't find any documentation on that.Tetraploid
The link from @Thomasleveil is no longer working. I believe the equivalent link would be here docs.docker.com/engine/reference/commandline/dockerdMichal
docker-machine: Use docker-machine ssh $host tail -f /var/lib/boot2docker/log/docker.log. (docker-machine version 0.16.1, build cce350d7)Constabulary
Alpine Linux also uses /var/log/docker.logUpanchor
It seems to be /var/log/messages for CentOSRhythmics
Follow up question. How to produce logs when those directories or event sources turn up nothing?Denominational
For Amazon Linux 2 use sudo journalctl -fu docker.serviceSelie
B
124

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

sudo journalctl -fu docker.service
Buenrostro answered 12/8, 2015 at 10:10 Comment(2)
This shows the output of the docker containers, too... is there a way to filter those out to show only the dockerd logs?Roundish
@TheDoctorWhat , that's probably because you have journald set as your logging driver. From github.com/docker/docker/issues/23339#issuecomment-224275072, you can filter the containers stuff out and keep only daemon logs by using journalctl -fu docker _TRANSPORT=stdout + OBJECT_EXE=docker (works fine here)Lagos
L
29

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/

Lucrative answered 7/3, 2016 at 19:38 Comment(0)
H
14

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

Hevesy answered 4/8, 2017 at 10:53 Comment(0)
C
12

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.

Corniculate answered 29/1, 2017 at 16:28 Comment(0)
U
9

Docker for Mac (Beta)

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

Unchristian answered 2/7, 2016 at 18:46 Comment(0)
C
7

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

Chartulary answered 15/3, 2016 at 14:57 Comment(0)
L
3

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

Legg answered 3/10, 2017 at 0:19 Comment(1)
Thanks, the direct link to the logs is docs.docker.com/config/daemon/#read-the-logsUndulatory
A
0

Also you can see logs by this command:

docker service ps --no-trunc {serviceName}
Alec answered 28/8, 2018 at 8:6 Comment(2)
This command revealed the issue with deploying one of my images!Henequen
Those are logs from containers running in swarm mode, not the logs from the dockerd daemon.Paramo
A
0

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.

Ambition answered 26/2, 2021 at 11:29 Comment(0)
E
0

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

Get-EventLog -LogName Application -Source DockerService
Erminiaerminie answered 6/1, 2022 at 18:58 Comment(0)
C
0

Short answer solution for me (On Win10 host, VMWare Player 17, Ubuntu 22.04.2 LTS installed in the VM):

  1. Start VMWare Player > Select Your VM (Ubuntu 22.04.2) on left pane.

  2. Click "Edit virtual machine settings" on right pane.

  3. Click Hardware Tab at the top > Select Processors Menu on left pane > On right pane: tick the checkboxes for:

    Virtualize Inter VT-x/EPT or AMD-V/RVI

    Virtualize CPU performance counters

  4. Click Ok.

  5. Click Play virtual machine (on main interface).

  6. Boot up Docker Desktop. Now it should work.

Prior to doing the above steps I checked my Bios Virtualization and it was enabled.

Enable virtualization SVM Mode on Window 10 Pro AMD Ryzen MSI click BIOS S

https://youtu.be/qKIcbKNI-g0

Enable Virtualization Technology (VT) on MSI computer and motherboard

https://www.ldplayer.net/blog/enable-virtualization-technology-on-msi-computer-and-motherboard.html

Comte answered 8/4, 2023 at 12:23 Comment(0)
P
0

Get-Eventlog used a 32-bit API. The results may not be accurate. It was deprecated and removed in PowerShell v7. The replacement is Get-WinEvent. This code fetches the docker logs in the last 5 minutes.

$StartTime = (Get-Date).AddMinutes(-5)
Get-WinEvent -FilterHashtable @{
  Logname='Application'
  ProviderName='Docker'
  StartTime=$StartTime
}
Patman answered 14/4, 2023 at 9:33 Comment(0)
S
-2

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.

Sadomasochism answered 11/2, 2017 at 4:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.