Container Logs and Log Drivers
Cheat sheet · https://pcornel.dk/topic.php?topic=6138
Answer
Container logs are the process's stdout/stderr captured by the runtime via a log driver (json-file, journald, local, fluentd…) or, on Kubernetes, files on the node collected by a log agent.
Remember
Apps should log to stdout/stderr. Configure log rotation (max-size, max-file) or disks fill up. Kubernetes keeps only the current and previous container logs locally.
First checks
docker ps -a— containers and exit codesdocker logs <c>— container outputdocker inspect <c>— config, mounts, network, state
Commands
docker logskubectl logs
Verify in this order
stdout/stderr → log driver/node file → rotation → agent → central store
Where it usually breaks
Changing daemon.json does not affect existing containers.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6138