v1

latestOpenAPI 3.1.02026-07-2676123203.9 KB
Serverless

Stream serverless worker logs

Streams a serverless worker's logs as Server-Sent Events. The source query parameter selects which log source to include.

The SSE data payload shape is: { "source": "container", "line": "...", "ts": "..." }. Log-event id values are the event ts timestamp so browser/EventSource reconnects can resume with Last-Event-ID.

get/v2/serverless/{id}/workers/{workerId}/logs

Query parameters

source'container' | 'system'

Log source to include in a log stream.

  • container — container stdout/stderr log stream
  • system — host lifecycle/userlogs stream

Log source to stream. Omit to include both container and system logs.

tailinteger

Number of historical lines to backfill before streaming. Defaults to 100 when omitted; set 0 to stream live with no backfill. Maximum 5000. Ignored when since or Last-Event-ID is provided — the resume cursor drives the backfill instead.

sincestring date-time

RFC3339 timestamp to resume from. Ignored when Last-Event-ID is provided. When set, the stream resumes from this point and tail is ignored.

Headers

Last-Event-IDstring date-time

SSE reconnect cursor — a timestamp emitted by this endpoint. Takes precedence over since and tail: when present, the stream resumes from this point. Sent automatically by EventSource on reconnect.

Response

Worker log event stream