Managed Kubernetes
Latest
Enable Debug Logging for Docker Daemon
Problem
There is a need to enable or disable debug logging for the Docker daemon.
Environment
Platform9 Managed Kubernetes - All Versions
Docker
Answer
Edit the /etc/docker/daemon.json file and set the "debug": true flag. The file should look as shown below when edited.
{
"bridge": "none",
"graph": "/var/lib/docker",
"group": "pf9group",
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "10"
},
"storage-driver": "",
"storage-opts": [ ],
"debug": true
}
Send a SIGHUP signal to the Docker daemon, triggering it to reload its configuration without restarting the process.
# ps -ef | grep docker
root 17910 1 1 XX:XX ? XX:XX:XX /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
# kill -SIGHUP 17910
To check whether the configuration has been applied, use the below command.
# docker info
Server:
Debug Mode: true
Also, if the debug parameter is enabled, the output logs will be shown as follows.
# journalctl -u docker
master2 dockerd[17910]: time="XXXX-XX-XXTXX:XX:XX7819166Z" level=debug msg="Calling GET /v1.38/containers/json?filters=%7B%22label%22%3A%7B%22io.kubernetes.docker.type%3Dpodsandbox%22%3Atrue%7D%7D&limit=0"
master2 dockerd[17910]: time="XXXX-XX-XXTXX:XX:XX7819166Z" level=debug msg="Calling GET /v1.38/containers/json?all=1&filters=%7B%22label%22%3A%7B%22io.kubernetes.docker.type%3Dcontainer%22%3Atrue%7D%2C%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0"
Note: To disable debug logging, perform both the steps again, setting "debug": false.
Additional Information
Last updated on
Was this page helpful?
Frequently Asked Questions
Solutions
How Tos
Internal Only
Templates
Powered by
