Skip to Content

logs

The logs tool shows the agent recent requests, backend console output, the app’s traffic log and a metrics summary, to find errors and test flows after a deploy.

Logs start with the first deploy. A project that was never deployed returns an empty list with a note, not an error.

logs

  • Parameters:
    • project.
    • type: traces (default), logs, traffic or summary.
    • limit: 1–200 rows, default 50.
    • id: with traffic, opens one request in detail.
    • path: with traffic, filters by part of the path.
    • status: 2xx, 3xx, 4xx or 5xx.
    • source: handler, upstream, mock or error.
    • since: the last N minutes, 1–10,080. Default 60 for traffic, 1,440 for summary.
  • When the agent calls it: after a deploy, to see whether each flow works; when a user reports a bug; when it writes mocks from an outside system’s real responses.

Four types

  • traces: recent HTTP requests with status, duration and error. Cron runs show as CRON <path>.
  • logs: console.log / console.error lines from handlers and cron. They can lag about 10 seconds.
  • traffic: the app’s own request log, kept for 3 months. One row per /api request, newest first, with the source that answered: handler (the app’s code), upstream (the outside system in app/upstream.ts), mock (fake data), error. Pass id to see one request’s headers and bodies (sensitive parts masked, up to 6 KB).
  • summary: the app’s state over since minutes: total requests, 4xx and 5xx counts, p50 / p95 response time, busiest routes, most frequent errors with a sample body, and the change against the previous period. It also returns quota: usage against the plan’s limits.
logs({ project, type: "summary" }) → any 5xx errors? logs({ project, type: "traffic", status: "5xx" }) → which requests failed logs({ project, type: "traffic", id: 1842 }) → that request's headers and bodies

An unexpected throw in a handler answers 500 with { "error": "INTERNAL", "message": "Máy chủ gặp lỗi, vui lòng thử lại sau." }, without the original message or stack. The detail is in logs (a [handler error] … line).

Next steps

Last updated