Playgrounds Logs
[MODE:DIALOG] Read-only, idempotent. Tier: brownfield.
One-shot service log fetch. Maps to Rails GET /api/playgrounds/:id/logs/:service (Api::PlaygroundsController#logs) which enqueues PlaygroundLogSnapshotJob (so reading logs from a remote Marquee doesn't block the request thread); the SDK polls the resulting request_id and returns the final payload.
When to use
- Debug a specific service's startup error.
- Read a known-bounded chunk (
taillines) before deciding whether to follow. - Pair with
fibe_playgrounds_debugfor full context (debug surfaces names; logs surface causes).
When NOT to use
- Need to wait for a pattern to appear — use
fibe_playgrounds_logs_follow. - Need debug summary, not raw logs — use
fibe_playgrounds_debug.
Inputs
| Field | Type | Required | Notes |
|---|---|---|---|
playground_id | number | one of | Numeric ID |
playground_identifier | string | one of | Numeric ID or slug-safe name |
service | string | yes | Compose service name (must exist in the Playspec) |
tail | number | no | Lines to fetch; default 50, clamped to Docker::LogFetcher::MAX_TAIL_LINES |
Output
{
"playground_id": 42,
"service": "web",
"tail": 200,
"logs": "...", // raw mixed stdout+stderr
"stdout": "...", // present when fetcher separates streams
"stderr": "...",
"fetched_at": "2026-..."
}
Schema varies slightly by Marquee Docker version; the logs field is always populated.
Behavior
- Rails validates
serviceagainst the Playspec's declared services (rejects unknown). - Clamps
tailto[1, MAX_TAIL_LINES]. - Enqueues
PlaygroundLogSnapshotJob(the worker SSHes to the Marquee and runsdocker logs --tail <N>). - Returns request_id + status_url; SDK polls.
Gotchas
- "Service not found" usually means a typo — service names come from the Playspec's
services[*].name, not always the Compose service name (Fibe sometimes prefixes/normalizes). - Marquee unreachable → polling eventually returns an error envelope. Re-check Marquee status.
- Logs may be truncated by Docker's own log driver (
max-sizeetc.);tailis best-effort. - Container restarts reset stdout/stderr buffers — recent crashes may have logs that no longer exist.
Related
fibe_playgrounds_debug— names + ports + per-service status.fibe_playgrounds_logs_follow— live streaming with pattern matching.fibe-debugskill — broader troubleshooting recipes.