Every time your bot handles a message, anyDocumentation Index
Fetch the complete documentation index at: https://howto.paigeme.dev/llms.txt
Use this file to discover all available pages before exploring further.
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
Go to Logs
In the project sidebar, click Logs. The logs panel shows the most recent execution output for your bot.
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.