Recent log lines of a running app
The last lines of what the app printed (console.log, console.error, uncaught errors) and of the host’s own lines about it
(a request line per request, a worker that stopped), oldest first, as plain text lines. The control plane stores none of it: the
lines come from the app’s host, which keeps up to about 16 MiB or 7 days of output per app (retention in the answer).
Lines have no level here (the host does not record one) and no time in their text; times has the time each line was stored, in the same order (the live stream has times too).
What is removed before a line is returned: the query string of every request URL in the host’s request lines, and every value
of the app’s secrets of 8 characters or more (also URL-encoded, JSON-escaped, base64 and hex), replaced by [redacted].
Redaction is best effort: a secret the app slices, hashes or re-encodes is not matched, and a value shorter than 8 characters
never is. A line over 16 KiB is cut with an ellipsis.
/v1/apps/{project}/logsAuthorizationBearer token · headerrequiredA team API key, sbk_..., from Settings, API keys.
x-api-keyAPI key · headerrequiredThe same key, in a header of its own.
projectstringrequiredThe app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.
linesintegerHow many of the last lines, 1 to 1000. Default 100.
The lines.
projectstringrequiredlinesstring[]requiredtimesinteger[]The time the host stored each line of lines, ms since the epoch, in the same order; null for a line an older host stored (it has no stamp). Absent from a control plane before logs step 2.
retentionstringrequiredHow long the host keeps the app's output, in words.
The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredinvaliderrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerNo key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key lacks a grant (reason: forbidden, need: "<resource>:<action>").
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredforbiddenneedstringrequiredThe grant, as <resource>:<action>, for example app:write.
No such app, build, secret, manifest or claim in this team (another team's resource looks the same).
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerData routes: too many requests in flight or an empty bucket (rate; note retry_after, without _s), or key-rate-limited. Honor Retry-After.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredkey-rate-limitedretry_after_sintegerrequiredSeconds to wait; also the Retry-After header.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredrateretry_afterintegerrequiredSeconds to wait; also the Retry-After header.
The host agent answered something the Cloud could not handle (reason: agent-error).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredagent-errorThe app's host is not reachable (host-unavailable), the app is not running on it yet (app-not-ready), or the audit log could not record the request (audit-unavailable). Retry shortly.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredhost-unavailableerrorstringrequiredA message for people. Do not parse it.
reasonstringrequiredapp-not-readyerrorstringrequiredA message for people. Do not parse it.
reasonstringrequiredaudit-unavailable