Logging in Docker containers
In a Docker container, the most common way to treat logs is to simply assume that the container’s main process is the one we want output from and that it’s logging to the standard output (stdout
). Container orchestrators (that is, tools like Kubernetes and Nomad), as well as various cloud services that are responsible for executing containers, will assume stdout
to be where relevant logs will go and, depending on the configuration, will forward it accordingly. We will go a bit more into this in the Centralized logging section below.