compose_logs
Retrieve a bounded slice of logs from a Docker Compose project. Filters by service, tail lines, time range, and timestamps, returning promptly without following.
Instructions
Fetch a bounded slice of logs from a compose project (never follows).
Bounded and non-following by design, so it always returns promptly. For one container's logs
use container_logs; for a swarm service use service_logs. Log text arrives on stdout.
Does not raise on a non-zero CLI exit (a missing compose plugin or a timeout still raises) - inspect
returncode/stderr in the result.
Args:
project_dir: Dir with the compose file (default: server cwd; copied to the target host if no local plugin)
files: Explicit compose file paths (repeatable, -f)
project_name: Compose project name override
services: Restrict to these services (default: all)
tail: Lines per container, or the literal "all" (still capped at MAX_CLI_OUTPUT_BYTES)
since: Show logs since this timestamp/duration (e.g. "10m", "2024-01-01T00:00:00")
until: Show logs before this timestamp/duration
timestamps: Include per-line timestamps
Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | ||
| files | No | ||
| since | No | ||
| until | No | ||
| services | No | ||
| timestamps | No | ||
| project_dir | No | ||
| project_name | No |