docker/logs
Read a container's recent stdout and stderr logs, interleaved, with optional time and line filters. Use for debugging container output without following.
Instructions
Reads one container's recent logs, the container counterpart of logs/journal-control: stdout and stderr interleaved in Docker's order, the last lines lines (default 100), never a follow. Read-only. since/until take a unix timestamp (1759005000) or an RFC3339 time; stdout and stderr default to true (both false returns nothing); timestamps prefixes each line. The answer is capped at 1 MiB and an oversized tail is cut at the END without a marker, so the newest lines can be lost: ask for fewer lines. Only containers in the grant's containers: list; always runs as root, refused unless the grant has allowed: true. Plain log text by default (Container X (ID) has no log output for this selection. when empty); output_format: json returns container, id, lines, logs. To run a command use docker/exec; for host logs logs/journal-control.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | Tail this many lines (default 100) | |
| since | No | Only entries after this time: unix timestamp (e.g. 1759005000) or RFC3339 | |
| until | No | Only entries before this time: unix timestamp or RFC3339 | |
| stderr | No | Include stderr (default true) | |
| stdout | No | Include stdout (default true) | |
| container | Yes | Container name, full ID or ID prefix | |
| timestamps | No | Prefix every line with Docker's own timestamp | |
| output_format | No | json returns container, id, lines, logs; default is raw log text |