StoicBuilder

HandbookIII the CastraLogs

IIIthe Castra, Stay in control

Logs

1 min readUpdated 28 November

In plain words

Logs are the timestamped lines your app writes as it runs, so when something breaks you can see what happened, in what order, and for whom.

Where you see it

A user says checkout failed at 14:02. You open the Logs tab in Vercel or the Logs page in Supabase, filter to that minute and find "No such price: 'price_1Q2w'". Without logs, you and the agent are guessing.

app/api/orders/route.tsserver
console.error("checkout failed", { orderId: order.id, userId: user.id, error: err.message,});
Say what failed and for which order. Leave out card numbers, tokens and passwords.

What goes wrong

  1. Logging secrets and personal data

    Printing whole requests puts login tokens and emails into a dashboard your whole team, and your log provider, can read.

    console.log("request", req.headers, body);
  2. Log lines with no detail

    "something went wrong" or "here 2" tells you that it broke, not what or for whom. Include the action, the record ID and the error message.

  3. Looking only in the browser console

    Server code writes its logs on the host, not in your browser. If the bug is in an API route, the answer is in Vercel or Supabase.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Log the start, success or failure of each important server action with the action name, record ID and error message. Never log passwords, tokens, API keys or full request bodies, and tell me where to find these logs on our host.

Quick check

Sign in to earn +10 XP for it

Your API route throws an error, but the browser console shows only "500". Where's the real message?

Got a prompt that touches logs?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.