Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/get-convex/convex-backend/llms.txt

Use this file to discover all available pages before exploring further.

Stream function logs from your Convex deployment. By default, this streams from your project’s dev deployment.

Usage

npx convex logs [options]

Options

--history
number
Show n most recent logs. Defaults to showing all available logs.
npx convex logs --history 50
--success
boolean
Print a log line for every successful function execution. By default, only errors and console logs are shown.
npx convex logs --success
--jsonl
boolean
Output raw log events as JSONL (JSON Lines) format for parsing with other tools.
npx convex logs --jsonl > logs.jsonl
--prod
boolean
Watch logs from this project’s production deployment instead of dev.
npx convex logs --prod
--env-file
string
Path to a custom file of environment variables for choosing the deployment. Same format as .env.local or .env files, and overrides them.
npx convex logs --env-file .env.staging

Examples

Stream dev deployment logs

Watch logs from your development deployment:
npx convex logs

View recent production logs

See the last 100 logs from production:
npx convex logs --prod --history 100

Monitor all executions including successes

Watch all function executions, including successful ones:
npx convex logs --success

Export logs for analysis

Output logs in JSONL format for processing:
npx convex logs --jsonl > app-logs.jsonl

Debug production issues

View recent production logs with full execution details:
npx convex logs --prod --history 200 --success

Log output format

By default, logs are displayed in a human-readable format showing:
  • Timestamp
  • Function name and type (query/mutation/action)
  • Execution status (success/error)
  • Console output from your functions
  • Error messages and stack traces
With --jsonl, each log line is a JSON object containing structured data about the execution.

Common use cases

Development debugging

Leave logs running while developing to see real-time feedback:
npx convex logs --success

Production monitoring

Monitor production errors in real-time:
npx convex logs --prod

Log aggregation

Collect logs for external analysis tools:
npx convex logs --jsonl --prod | your-log-processor