#console.log
4 messages · Page 1 of 1 (latest)
To see your Convex function logs (e.g., from console.log) in different places, here’s what you need to know:
-
By default, logs from your Convex functions (console.log, console.info, etc.) are visible in the Convex dashboard on the Logs page and in your terminal when running npx convex dev. You can also use npx convex logs to print logs only, without deploying or syncing code changes.
-
If you’re not seeing logs in your terminal with npx convex dev or npx convex logs, make sure you are connected to the correct deployment. You can confirm this by running npx convex dashboard and checking that the deployment matches the one you’re logging from. If you’re logging from a different deployment than the one your CLI is watching, you won’t see the logs in your terminal, even if they appear in the dashboard. This is a common source of confusion and was confirmed in a support thread as well.
-
If you want to see more verbose logs (for example, for debugging authentication or other components), you can enable verbose logging by setting environment variables or options, depending on the component. For example, for authentication, you can set AUTH_LOG_LEVEL to DEBUG using npx convex env set AUTH_LOG_LEVEL DEBUG, and for the Action Retrier, set ACTION_RETRIER_LOG_LEVEL to DEBUG. These logs will then appear in the dashboard logs page.
-
Note: In production, logs are not sent to the client/browser for security reasons. You must use the dashboard or CLI to view them.
Summary of steps to troubleshoot:
- Make sure you’re running npx convex dev or npx convex logs in the same deployment as your dashboard.
- Use npx convex dashboard to confirm your deployment.
- If you still don’t see logs, check your CLI and project configuration for any mismatches.
References:
- Dashboard logs page
- CLI log commands
- Support thread: CLI 'convex logs' not working
- Debugging functions
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@rugged belfry Kapa.ai is still learning and improving, please let me know how I did by reacting below.