Troubleshooting Connectivity Problems

Let's see how to check container and service logs for troubleshooting.

A quick note on troubleshooting connectivity issues before moving on to service discovery.

Daemon logs

Daemon logs and container logs can be useful when troubleshooting connectivity issues.

If you’re running Windows containers, you can view them in the Windows Event Viewer or directly in ~\AppData\Local\Docker. For Linux containers, it depends on which init system you’re using. If you’re running a systemd, Docker will post logs to journald and you can view them with the journalctl -u docker.service command. If you’re using a different init system, you might want to check the following locations:

  • Ubuntu systems running upstart: /var/log/upstart/docker.log

  • RHEL-based systems: /var/log/messages

  • Debian: /var/log/daemon.log

Managing the log outputs

You can also tell Docker how verbose you want daemon logging to be. To do this, edit the daemon config file at /etc/docker/daemon.json and set "debug" to "true" and "log-level" to one of the following:

  • debug – the most verbose option

  • info – the default value and second-most verbose option

  • warn – third most verbose option

  • error – fourth most verbose option

  • fatal – least verbose option

The following snippet from a daemon.json enables debugging and sets the level to debug. It will work on all Docker platforms.

Get hands-on with 1400+ tech skills courses.