Skip to content

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:

  1. Log in to the Cloudflare dashboard and select your account.
  2. In Account Home, go to Workers & Pages.
  3. In Overview, select your Worker.
  4. Select Logs.
  5. 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:

  1. Go to your Worker project directory.
  2. 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:

{
"outcome": "ok",
"scriptName": null,
"exceptions": [],
"logs": [],
"eventTimestamp": 1590680082349,
"event": {
"request": {
"url": "https://www.bytesized.xyz/",
"method": "GET",
"headers": {},
"cf": {}
}
}
}

By piping the output to tools like jq, you can query and manipulate the requests to look for specific information:

Terminal window
npx wrangler tail | jq .event.request.url
"https://www.bytesized.xyz/"
"https://www.bytesized.xyz/component---src-pages-index-js-a77e385e3bde5b78dbf6.js"
"https://www.bytesized.xyz/page-data/app-data.json"

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.