Real-time logs
With Real-time logs, access all your log events in near real-time for log events happening globally. Real-time logs is helpful for immediate feedback, such as the status of a new deployment.
Real-time logs captures execution logs, custom logs, errors, and uncaught exceptions. For high-traffic applications, real-time logs may enter sampling mode, which means some messages will be dropped and a warning will appear in your logs.
View logs from the dashboard
To view real-time logs associated with any deployed Worker using the Cloudflare dashboard:
- Log in to the Cloudflare dashboard ↗ and select your account.
- In Account Home, go to Workers & Pages.
- In Overview, select your Worker.
- Select Logs.
- In the right-hand navigation bar, select Live.
View logs using wrangler tail
To view real-time logs associated with any deployed Worker using Wrangler:
- Go to your Worker project directory.
- Run
npx wrangler tail
.
This will log any incoming requests to your application available in your local terminal.
The output of each wrangler tail
log is a structured JSON object:
By piping the output to tools like jq
↗, you can query and manipulate the requests to look for specific information:
You can customize how wrangler tail
works to fit your needs. Refer to the wrangler tail
documentation for available configuration options.
Limits
Note that:
- Real-time logs does not store Workers Logs. To store logs, use Workers Logs.
- If your Worker has a high volume of traffic, the real-time logs might enter sampling mode. This will cause some of your messages to be dropped and a warning to appear in your logs.
- Logs from any Durable Objects your Worker is using will show up in the dashboard.
- A maximum of 10 clients can view a Worker’s logs at one time. This can be a combination of either dashboard sessions or
wrangler tail
calls.
Persist logs
Logs can be persisted, filtered, and analyzed with Workers Logs. To send logs to a third party, use Workers Logpush or Tail Workers.
Related resources
- Errors and exceptions - Review common Workers errors.
- Local development and testing - Develop and test you Workers locally.
- Workers Logs - Collect, store, filter and analyze logging data emitted from Cloudflare Workers.
- Logpush - Learn how to push Workers Trace Event Logs to supported destinations.
- Tail Workers - Learn how to attach Tail Workers to transform your logs and send them to HTTP endpoints.
- Source maps and stack traces - Learn how to enable source maps and generate stack traces for Workers.