Logs
tori logs reads retained application stdout and stderr for the app in ./tori.json. Platform and queue-proxy lines are not in this stream. Static sites have no process, so a static app’s log range is usually empty even when storage is healthy.
npx tori.host logs --since 1h --limit 500npx tori.host logs --followSee tori logs for flags. In the console, open the app → logs.
One-shot and follow
Section titled “One-shot and follow”One-shot reads show the latest matching lines in chronological order. --since accepts seconds, minutes, or hours (1s–24h, default 15m). --limit is 1–500 (default 200).
--follow polls every three seconds. Ctrl-C stops it, and the CLI exits 130 (143 on SIGTERM), also when run through npx; lines already printed are complete. Each poll replays a 30-second window so a line that landed late still appears. There is no delivery guarantee for a queued record that arrives after that overlap: pause follow and run a historical read with a wider --since.
The console offers 15 minutes, 1 hour, or 24 hours, follow, refresh, and older pages. It keeps at most 2,000 lines on screen.
Retention and empty results
Section titled “Retention and empty results”Each successful logs response includes retentionDays. On the launch zone this is 7 days. Lines older than that window are gone (HTTP 410, logs_retention_expired). The window is a store setting, not a plan column; read it from the response rather than from memory.
No matching lines in range is HTTP 200 with an empty list. The CLI prints → no logs from <app> in the last 15m (the window as --since spells it) and suggests a wider --since. Missing storage is a different error (logs_unavailable, HTTP 503). Do not treat an empty range as an outage, and do not treat an outage as “the app printed nothing”.
Follow stops with an explicit error if the store is unavailable. Refresh to resume. Token revocation is checked on every poll; a revoked token ends follow.
What the CLI prints
Section titled “What the CLI prints”The output depends on where it goes, and the piped form is the one to script against.
| Format | |
|---|---|
| Terminal | 14:03:22.104 err connect ECONNREFUSED — local time, out/err. A line from another day carries MM-DD in front of the clock, because --since reaches 24h. |
| Piped or redirected | 2026-09-20T12:03:22.104Z stderr connect ECONNREFUSED — RFC 3339 UTC, stdout/stderr, one line per entry, unchanged from earlier versions. |
Each entry is one line of output without its line ending. A blank line the app printed, such as the gaps npm or a Node.js stack trace leave, is an entry with an empty message and prints as a line with nothing after the stream.
Application output is untrusted. The CLI escapes terminal control characters.
start=$(date -u -v-15M +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -d '15 minutes ago' +%Y-%m-%dT%H:%M:%SZ)end=$(date -u +%Y-%m-%dT%H:%M:%SZ)curl -sS -H "Authorization: Bearer $TORI_TOKEN" \ "https://api.tori.host/api/apps/<slug>/logs?start=${start}&end=${end}&limit=200"Query parameters, cursors, and error codes: API reference (listLogs). Maximum range is 24 hours; limit is 1–500.
Download this page as Markdown.