Docker Compose Cheat Sheet/Tail logs for one service

Shows only recent log lines for a service.

Section: Logs, Exec, and Shell Access

Tail logs for one service

bash
bash
docker compose logs --tail=100 web
Explanation

Keeps output focused during triage.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Logs, Exec, and Shell Access
Show logs
Prints aggregated logs for the project.
OpenIn sheetbashsame section
Follow logs
Streams live logs from services.
OpenIn sheetbashsame section
Open shell in running service
Executes a shell inside an already-running service container.
OpenIn sheetbashsame section
Open bash in running service
Runs Bash inside the running service container.
OpenIn sheetbashsame section
Run one-off command
Starts a fresh container for a one-off task and removes it after exit.
OpenIn sheetbashsame section
Show running processes
Displays processes running inside service containers.
OpenIn sheetbashsame section