Skip to content
Latchkey

docker logs: View Container Logs & Tail in CI

See what a container printed to stdout and stderr.

docker logs retrieves the logs of a container - the output written to stdout and stderr. This page covers following, tailing, and the limits of the logs command.

What it does

docker logs prints captured stdout/stderr for a container using the default json-file logging driver. It works on running and exited containers, which makes it the first tool for a crashed CI container.

Common usage

Terminal
docker logs web
docker logs -f web                     # follow
docker logs --tail 100 web
docker logs --since 5m --timestamps web

Common errors in CI

"Error response from daemon: configured logging driver does not support reading" appears when the container uses a driver other than json-file or journald (e.g. awslogs). In that case read logs from the backend, not docker logs. If logs are empty, the process may write to a file rather than stdout - that is an app config issue, not a Docker bug; in containers, log to stdout/stderr.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →