Forwarding logs from all containers running anywhere inside a Swarm cluster

How can we forward logs from all the containers no matter where they’re running? One possible solution would be to configure logging drivers (https://docs.docker.com/engine/admin/logging/overview/). We could use the --log-driver argument to specify a driver for each service. The driver could be syslog or any other supported option. That would solve our log shipping problem. However, using the argument for each service is tedious and, more importantly, we could easily forget to specify it for a service or two and discover the omission only after we encounter a problem and are in need of logs. Let's see if there is another option to accomplish the same result.

We could ...

Get The DevOps 2.1 Toolkit: Docker Swarm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.