follow_container_logs
Tail a container's log stream with line count and timeout bounds, returning when either limit is reached or the container exits.
Instructions
Tail a container's log stream, bounded by limit_lines, timeout_seconds, or container exit.
Returns when limit_lines lines are collected, timeout_seconds elapses, or the container exits,
whichever comes first — so the agent can watch live output without blocking forever (limit_lines
bounds memory, timeout_seconds bounds wall-clock for a quiet but long-lived container).
Caveat for ssh:// daemons: docker-py can't cancel an SSH stream, so the timeout_seconds
watchdog can't interrupt a fully silent container — use container_logs (one-shot, non-streaming)
there if you need a hard time bound.
args:
id_or_name - The container id or name
limit_lines - Max lines to collect before returning (default 200)
stdout - Include stdout
stderr - Include stderr
timestamps - Include timestamps
since - Only return logs created after this unix timestamp
timeout_seconds - Max wall-clock seconds to follow before returning what was collected (default 30)
returns: str - Decoded log output containing up to limit_lines lines
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | No | ||
| stderr | No | ||
| stdout | No | ||
| id_or_name | Yes | ||
| timestamps | No | ||
| limit_lines | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |