service_logs
Fetch a bounded snapshot of a Docker swarm service's logs, capped at a configurable byte limit to prevent memory overflow.
Instructions
Get a bounded snapshot of a swarm service's logs (never follows).
follow is intentionally not exposed: the stream is joined into one string before returning, so
following would block forever and grow unbounded. Collection is capped at max_bytes (ValueError
if exceeded) so a noisy service can't OOM the server. The default tail="all" returns the whole
buffer, which can be huge on long-running services and exceed the agent's context — pass an
integer (e.g. tail=500) or use since to constrain output.
args: service_id - The service id or name details - Show extra details stdout - Include stdout stderr - Include stderr since - Show logs since this Unix timestamp timestamps - Include timestamps tail - Number of lines from the end, or the literal "all" max_bytes - Abort with ValueError if the buffered logs exceed this many bytes (default 32 MiB) returns: str - Decoded log output
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | all | |
| since | No | ||
| stderr | No | ||
| stdout | No | ||
| details | No | ||
| max_bytes | No | ||
| service_id | Yes | ||
| timestamps | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |