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

NameTypeDescription
--tailstringNumber of recent lines
SERVICEstringOptional service selection

Working Example

Example Snippetdocker
docker compose -f compose.yaml -p bm-v12-observe logs --tail 20 report
Docker Reference