Skip to Content

Logs and traffic

The Operations section shows how a deployed app behaves, with totals, every API request, and the log lines of handlers and cron jobs. Agents read the same data with the logs tool.

Logs and traffic start with the first deploy. Before that, the sub-sections say the app isn’t deployed yet.

In the dashboard

Open the project and pick Operations in the sidebar. It has these sub-sections:

  • Metrics: total requests, 4xx and 5xx errors, p50 and p95 response times, the busiest routes and the most frequent errors with a sample response. Pick 1 hour, 24 hours or 7 days. The chart marks each deploy, so you see at once which version made errors go up.
  • Errors: repeated 5xx errors of the last 24 hours, grouped by error message and route, with the log lines of that exact request. Open this first when users say the app is broken.
  • Traffic: every request to /api with method, path, status, time and the source that answered it. Filter by path, status and source. Click a row to see the headers and bodies of the request and the response; sensitive headers such as Authorization are masked. Copy cURL gives a command that repeats that exact request.
  • Logs: lines printed with console.log, console.warn and console.error in handlers and cron jobs. Logs can arrive about 10 seconds late. Turn on Auto-refresh to follow them, and type to filter.
  • Cron: registered cron jobs, their schedules and the history of each run. See Cron jobs.
  • Background jobs: runs of your *.job.ts files, with errors and retries.

The source column in Traffic says what answered the request:

handler your code in app/ upstream an existing system the app forwards to (app/upstream.ts) mock test data for parts of an outside system not ready yet error a request that answered with a 5xx error

Traffic is kept for 3 months.

When a handler throws

A handler that throws unexpectedly answers 500 with the body { error: "INTERNAL", message: "Máy chủ gặp lỗi, vui lòng thử lại sau." }, without the original message or the stack, so users never see internals. The detail is in Errors, Logs and on that request’s row in Traffic. An error you throw on purpose with fail(status, message, code) reaches the user as written.

Add log lines where you suspect the problem with console.log, then deploy again:

app/orders/post.ts
import { createOrder } from "./repository"; export default (c, { user, body }) => { console.log("create order", { user: user.id, productId: body.productId }); return createOrder(user, body); };

Through the agent

Ask your agent: “Check what errors the app had in the last 24 hours.” The agent calls logs with one of four types:

  • summary: totals over since minutes (default 1,440, i.e. 24 hours), with usage against the plan’s limits.
  • traffic: the request list, filtered with path, status (2xx to 5xx), source and since (default 60 minutes, at most 10,080). Pass id to read one request in full.
  • traces: HTTP calls and cron runs, with status, duration and error.
  • logs: lines from console.

limit sets the number of rows, from 1 to 200, default 50. Agents use real responses from traffic to write mocks and test scripts.

Good to know

  • Traffic stores bodies with sensitive values masked; long bodies are cut.
  • Requests made by cron jobs are not rate-limited, but they still show in the logs.
  • A request over the plan’s limits gets 429 or 503 and shows in Traffic. See Plan limits.

Next steps

Last updated