Basic log access

Show recent logs

docker logs app

Example:

docker logs --tail 200 app

Follow live logs

docker logs -f app

Example:

docker logs -f --since 10m app

Filter by time and format

Logs since timestamp

docker logs --since "2026-01-01T10:00:00" app

Example:

docker logs --until "2026-01-01T11:00:00" app

Include timestamps

docker logs -t app

Example:

docker logs -f -t app

Compose service logs

View one service logs

docker compose logs app

Example:

docker compose logs -f --tail 100 api

All services with follow

docker compose logs -f

Example:

docker compose logs db worker

Common mistakes / Errores comunes

  • Relying on docker logs for long-term retention is risky without external logging.
  • Huge unbounded logs consume disk; configure log rotation driver options.
  • Missing --tail on busy containers can flood terminal and hide useful lines.
Last updated: February 2026