Docker logging and container runtime logging
When you are trying to troubleshoot problems with your application, it helps to have detailed logs for both the application itself and from whatever system it runs. Every Docker container, whether it is run locally or with a cloud container runtime manager such as Kubernetes, produces its own logs that you can query.
In previous chapters, we've used both the docker logs
command and the kubectl logs
command in order to examine logs for the demo application when run both on a local workstation and in the cloud with Kubernetes. These commands can yield insight into events that are critical to your system, including both application logging messages and error and exception logs. They are still the bedrock tools you will reach for; but particularly when we need to scale out our application with Kubernetes, we will need a more sophisticated approach.
Understanding Kubernetes container logging
Every Docker container running in every...