Merge pull request #13245 from thaJeztah/update_log_locations

troubleshoot: update locations for daemon logfiles
This commit is contained in:
Usha Mandya 2021-07-28 15:58:49 +01:00 committed by GitHub
commit 0726a7d7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 13 deletions

View File

@ -220,15 +220,30 @@ The daemon logs may help you diagnose problems. The logs may be saved in one of
a few locations, depending on the operating system configuration and the logging
subsystem used:
| Operating system | Location |
|:----------------------|:-----------------------------------------------------------------------------------------|
| RHEL, Oracle Linux | `/var/log/messages` |
| Debian | `/var/log/daemon.log` |
| Ubuntu 16.04+, CentOS | Use the command `journalctl -u docker.service` or `/var/log/syslog` |
| Ubuntu 14.10- | `/var/log/upstart/docker.log` |
| macOS (Docker 18.01+) | `~/Library/Containers/com.docker.docker/Data/vms/0/console-ring` |
| macOS (Docker <18.01) | `~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring` |
| Windows | `AppData\Local` |
| Operating system | Location |
|:------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------|
| Linux | Use the command `journalctl -xu docker.service` (or read `/var/log/syslog` or `/var/log/messages`, depending on your Linux Distribution) |
| macOS (`dockerd` logs) | `~/Library/Containers/com.docker.docker/Data/log/vm/dockerd.log` |
| macOS (`containerd` logs) | `~/Library/Containers/com.docker.docker/Data/log/vm/containerd.log` |
| Windows (WSL2) (`dockerd` logs) | `AppData\Roaming\Docker\log\vm\dockerd.log` |
| Windows (WSL2) (`containerd` logs) | `AppData\Roaming\Docker\log\vm\containerd.log` |
| Windows (Windows containers) | Logs are in the Windows Event Log |
To view the `dockerd` logs on macOS, open a terminal Window, and use the `tail`
command with the `-f` flag to "follow" the logs. Logs will be printed until you
terminate the command using `CTRL+c`:
```console
$ tail -f ~/Library/Containers/com.docker.docker/Data/log/vm/dockerd.log
2021-07-28T10:21:21Z dockerd time="2021-07-28T10:21:21.497642089Z" level=debug msg="attach: stdout: begin"
2021-07-28T10:21:21Z dockerd time="2021-07-28T10:21:21.497714291Z" level=debug msg="attach: stderr: begin"
2021-07-28T10:21:21Z dockerd time="2021-07-28T10:21:21.499798390Z" level=debug msg="Calling POST /v1.41/containers/35fc5ec0ffe1ad492d0a4fbf51fd6286a087b89d4dd66367fa3b7aec70b46a40/wait?condition=removed"
2021-07-28T10:21:21Z dockerd time="2021-07-28T10:21:21.518403686Z" level=debug msg="Calling GET /v1.41/containers/35fc5ec0ffe1ad492d0a4fbf51fd6286a087b89d4dd66367fa3b7aec70b46a40/json"
2021-07-28T10:21:21Z dockerd time="2021-07-28T10:21:21.527074928Z" level=debug msg="Calling POST /v1.41/containers/35fc5ec0ffe1ad492d0a4fbf51fd6286a087b89d4dd66367fa3b7aec70b46a40/start"
2021-07-28T10:21:21Z dockerd time="2021-07-28T10:21:21.528203579Z" level=debug msg="container mounted via layerStore: &{/var/lib/docker/overlay2/6e76ffecede030507fcaa576404e141e5f87fc4d7e1760e9ce5b52acb24
...
^C
```
### Enable debugging
@ -305,10 +320,12 @@ The Docker daemon log can be viewed by using one of the following methods:
- `/var/log/messages`, `/var/log/daemon.log`, or `/var/log/docker.log` on older
Linux systems
> **Note**: It is not possible to manually generate a stack trace on Docker Desktop for
> Mac or Docker Desktop for Windows. However, you can click the Docker taskbar icon and
> choose **Diagnose and feedback** to send information to Docker if you run into
> issues.
> **Note**
>
> It is not possible to manually generate a stack trace on Docker Desktop for
> Mac or Docker Desktop for Windows. However, you can click the Docker taskbar
> icon and choose **Troubleshoot** to send information to Docker if you
> run into issues.
Look in the Docker logs for a message like the following:

View File

@ -152,6 +152,11 @@ To read the Docker app log messages, type `docker` in the Console window search
You can use the Console Log Query to search logs, filter the results in various
ways, and create reports.
#### View the Docker Daemon logs
Refer to the [read the logs](../config/daemon/index.md#read-the-logs) section
to learn how to view the Docker Daemon logs.
<a name="troubleshoot"></a>
## Troubleshooting