# Logs: your app's diary (and where to find them)

> A log is your app's diary—one structured line recorded for each important event with its level, route, request ID and duration—kept free of secrets or personal data and found in four places: the browser console, your local terminal, Vercel build logs and Vercel runtime logs.

## Analogy

Think of a ship's logbook. Every watch, the captain writes one dated line: the weather, the heading, and any warning light. When the ship hits rough water, you don't guess what happened—you open the logbook to that exact minute.

## How it works

A log is your app's diary: one line written each time something notable happens. To make logs easy for both you and your coding-agent to search, your app writes **structured logs**—one JSON line per event containing a level (`info` for normal events, `warn` for something unusual, `error` when an action failed), a plain message, a short request ID, the page or route, and how long it took (duration).

Just as important is what must **never** go into a log: never record a secret, token, password, personal data (such as emails or phone numbers), or AI prompts and model outputs. For AI calls, your app logs only the price (`X-Tokentide-Charge-USD`), the request ID, the feature name and which provider answered.

When you work on your computer, logs live in two places: **1. The browser console** (Right-click → **Inspect** → **Console**) for frontend events that happen on the screen, and **2. Your local terminal** running `npm run dev` for backend events that happen on the server.

When your app runs on vercel, there are two more places: **3. Vercel build logs** (`npx vercel inspect <url> --logs`), which explain why a deployment failed to build, and **4. Vercel runtime logs** (`npx vercel logs <url>`, kept for 1 hour on the Hobby plan), which show what the live or Preview server is doing right now.

## In your project

You don't have to hunt through logs by hand. Tell your agent what happened and whether it was on `localhost` or on a Vercel link, and it will check the terminal or run `npx vercel logs` itself and summarize what the diary says.

## Copy for your agent

```text
Check our app's logging setup: make sure server events write one structured JSON line (level, message, requestId, route, duration) and verify we never log secrets, personal data, prompts or model outputs.
```

---
Source: [Agentic Makers](https://agenticmakers.app/en/learn/logs) · License: CC BY 4.0
