# Log (/academy/log)



A log is a diary the program writes whether you read it or not.

Every line is a fact with a clock: request in, payment charged, error here, done. New lines only ever get added. Nothing already written gets edited. That is why you trust it more than your memory of the demo.

`console.log`, `pino`, the platform's log drain — same tape. Timestamp, level, message. When it breaks after you [deploy](/academy/deploy), you do not have a debugger. You have the diary.

**Zoom: place, not trip**

A [trace](/academy/trace) follows one request across rooms. A log is one process talking to itself. Open the diary for "what did this room do tonight." Reach for a trace when you need "where did this one click go."

When a process crashes, the [stack trace](/academy/stack-trace) usually lands *in* the log. They are not rivals. The log is the pile. The stack is the last angry page.

**Write receipts, not novels**

"checkout failed user=12 code=card\_declined" is a receipt. A dump of the whole user object is a leak — and a Saturday spent scrolling. Log the fact that lets you rebuild the moment. Leave [secrets](/academy/secret) out of it.

At a hackathon, log the path the judge will hit. If you cannot find the failure in thirty seconds of tape, you logged the wrong things.

**Agents run with no screen**

An [agent](/academy/agent) on a [CLI](/academy/cli), a [headless](/academy/headless) worker, a [cron](/academy/cron) at 2 a.m. — nobody is watching. The log is how you see what it did. "Check the logs" means read the tape in order, not guess from the UI.

**What this unlocks**

When something breaks, you do not invent a story. You scroll to the timestamp and read what actually happened. The diary was already writing.
