# docker compose logs Command Reference

> Reference for docker compose logs in CI: view aggregated service logs with --tail, --no-color, and --timestamps to debug a failed stack in pipelines.

Source: https://latchkey.dev/learn/command-reference/docker-compose-logs-command-reference  
Updated: 2026-06-26

View aggregated output from compose services.

docker compose logs prints the combined logs of all services in a project, prefixed by service name. In CI it is the diagnostic dump for a stack that failed to come up or a test that could not reach a dependency.

## Common flags

- `--tail` - limit to the last N lines per service, e.g. --tail 100
- `-f, --follow` - stream output (avoid in foreground CI steps)
- `--no-color` - plain output, easier to read in CI logs
- `-t, --timestamps` - prefix lines with timestamps
- Positional service names limit output to those services

## Example

```shell
docker compose logs --no-color --tail 200 --timestamps
```

## In CI

Add docker compose logs --no-color --tail 200 in an always() step so a failing stack leaves readable diagnostics. --no-color avoids ANSI escape noise in plaintext CI logs. Do not use -f in a normal step; it never returns.

## FAQ

### docker compose logs Command Reference?

docker compose logs prints the combined logs of all services in a project, prefixed by service name. In CI it is the diagnostic dump for a stack that failed to come up or a test that could not reach a dependency.

### In CI?

Add docker compose logs --no-color --tail 200 in an always() step so a failing stack leaves readable diagnostics. --no-color avoids ANSI escape noise in plaintext CI logs. Do not use -f in a normal step; it never returns.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
