commands.sh

docker compose logs

all

View output from containers in a Docker Compose application.

More info →

Options (3)

-f, --followboolean

View logs and follow new output (like `tail --follow`)

Example: docker compose logs {{[-f|--follow]}}
-t, --timestampsboolean

View logs with timestamps

Example: docker compose logs {{[-t|--timestamps]}}
-n, --tailboolean

View only the last `n` lines of logs for each container

Example: docker compose logs {{[-n|--tail]}} {{n}}

Examples (8)

View logs for all services

View logs for a specific service

docker compose logs service_name

View logs and follow new output (like `tail --follow`)

docker compose logs [-f|--follow]

View logs with timestamps

docker compose logs [-t|--timestamps]

View only the last `n` lines of logs for each container

View logs from a specific time onwards

docker compose logs --since timestamp

View logs until a specific time

docker compose logs --until timestamp

View logs for multiple specific services

docker compose logs service1 service2 ...
made by @shridhargupta | data from tldr-pages