Since pods are collections of containers which are run by the container runtime, in our case docker, logs for every pod is collected based on the default logging driver used by Docker. The default is json-file, which writes logs for each container to a JSON file on the agent node where the pod is running.
There are a lot of pluggable log drivers available. As of Docker v17, there are nine supported drivers https://docs.docker.com/engine/admin/logging/overview/#supported-logging-drivers. To switch drivers, the Docker daemon running on k8s agent nodes can be started with one of these drivers:
$ /usr/bin/docker daemon -H fd:// --storage-driver=overlay --logging-driver=fluentd
Docker also lets us specify logging driver per container.
The fluentd, one of the nine drivers, claims to be an is an open source data collector for unified logging layer. fluentd driver runs...