Skip to content
Latchkey

docker compose logs: View Service Logs in CI

See the aggregated logs of every service in the stack.

docker compose logs shows logs from one or more services, prefixed by service name. This page covers following, tailing, and dumping logs when a CI stack fails.

What it does

docker compose logs aggregates stdout/stderr across services with a colored service prefix. You can scope to specific services and follow or tail like docker logs.

Common usage

Terminal
docker compose logs
docker compose logs -f api
docker compose logs --tail 100 db
docker compose logs --no-color > stack.log

Common errors in CI

When a compose-based CI job fails, dump docker compose logs --no-color in an always() step so you can see why a service crashed - without it the failure is opaque. logs -f follows forever and will hang a non-interactive job; use a bounded form (no -f, or --tail) in CI. Empty logs usually mean the service writes to a file, not stdout.

Related guides

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