Troubleshooting

Let’s learn to troubleshoot a swarm service using its logs.

We'll cover the following

Service logs

You can inspect a service’s logs with the docker service logs command. It gathers the logs from every replica and displays them in a single output.

If you’ve been following along, you’ll have a service called uber-svc with 12 replicas mapped to a port 8080 on every cluster node. Open a browser tab to the IP address of any cluster node on the port 8080 and refresh the page a few times.

Now run a docker service logs command to see any log messages generated by the service.

Get hands-on with 1300+ tech skills courses.