console.log, console.error, console.warn, or console.info calls in your code are captured as execution logs. You can view these logs from the Paige dashboard to understand exactly what happened during a conversation — which is especially useful when your bot behaves differently than you expected.
View logs from the dashboard
1
Open your project
From the Paige dashboard, select the project you want to inspect.
2
Go to Tools → Logs
Open the Tools tab and select Logs. The panel shows the most recent execution output for your bot, newest at the bottom, grouped under Today and Yesterday headings.
3
Pick which bot you're looking at
Switch between Preview and Production at the top. This is the first thing to check when a log you expect isn’t there — see below.
4
Filter by log level
Use the level filter to narrow results — All Levels, Error, Warn, Info, or Log. Search box next to it matches on message text.
Preview vs Production — which bot am I reading?
You have two bots running, and they keep separate logs. The toggle at the top of the panel decides which set you’re reading, and it defaults to Preview.- Preview is the bot you’re testing — what runs when you chat in the preview panel or message through Paige Dev.
- Production is the live bot your customers are talking to on your own WhatsApp number.
Log levels
Paige captures four log levels, matching the standard browser console methods:log — General output
log — General output
Use
console.log() for general debugging information: variable values, which branch of logic ran, or any output that helps you trace execution flow.error — Errors and failures
error — Errors and failures
Use
console.error() to record errors. These are shown prominently in the logs panel and are the first place to look when your bot stops responding correctly.warn — Warnings and unexpected conditions
warn — Warnings and unexpected conditions
Use
console.warn() for situations that aren’t failures but signal something unexpected — for example, a missing optional field or a fallback path being triggered.info — Informational milestones
info — Informational milestones
Use
console.info() for high-level events like a flow completing, a payment being confirmed, or a user reaching a specific step.Add useful logging to your bot code
Good logging makes debugging much faster. A few practices that help:- Log inputs at the start of a handler — record the incoming message text and any user state you retrieve, so you can see exactly what your code was working with.
- Log before and after external calls — if your bot calls an API or queries the database, log the request and response so you can spot failures quickly.
- Log which branch ran — in conditional logic, add a short log to each branch so you can confirm the right path was taken.
- Include identifiers — log user IDs or conversation IDs alongside messages so you can correlate log entries with specific users.
Common error patterns
Unhandled promise rejections
If your bot makes async calls without
try/catch, an error in that call will silently fail. Wrap async operations and log the error to surface the cause.Undefined variables
A
TypeError: Cannot read properties of undefined in the logs usually means a database record or API response wasn’t what you expected. Log the value before you access it.Unexpected message types
Users can send images, voice notes, and reactions — not just text. If your bot only handles text, log the incoming message type so you can see when non-text messages arrive.
Infinite loops or repeated triggers
If the same log entry appears many times in rapid succession, your bot may be re-triggering itself. Check your reply logic for conditions that might cause a loop.
Let the Code agent read your logs
You don’t have to diagnose things from the logs yourself. The Code agent reads these same entries — just describe the symptom in chat and it will go and look:“Customers say the booking confirmation never arrives. Check the logs.”By default it searches both Preview and Production and tells you which one each line came from, which is often enough to establish whether a bug is live or only in your test copy. It’s the fastest route from “something’s broken” to a fix, because it can read the logs and change the code in the same conversation.
A single run records at most 500 log entries. If your code is unusually chatty — logging inside a loop over every contact, say — you’ll see
Log limit reached (500). Remaining logs truncated. and the rest of that run’s output is dropped. Individual messages are cut off at 4,000 characters.