Docker Compose
docker compose logs
Retrieve recorded service output subject to logging configuration. --tail bounds returned lines per container. Inspect only approved sanitized logs. Bound log retrieval and correlate output with the same container state.
Formal Syntax & Structure
docker syntaxdocker
docker compose logs [OPTIONS] [SERVICE...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| --tail | string | Number of recent lines |
| SERVICE | string | Optional service selection |
Working Example
Example Snippetdocker
docker compose -f compose.yaml -p bm-v12-observe logs --tail 20 report