Skip to content

View Cloudflare Workers Logs Live in a Browser (wrangler tail + Logdy) ​

To inspect live Cloudflare Workers logs without squinting at scrolling terminal JSON or clicking through the Cloudflare dashboard, pipe npx wrangler tail --format json (or cf observability tail) through jq -c --unbuffered into Logdy. Each Worker invocation opens in a local browser UI at http://127.0.0.1:8080 where you can filter by outcome, scriptName, HTTP method, url, and console.log entries in real time.

Definition: wrangler tail is Cloudflare's CLI command for streaming live invocation envelopes—including HTTP request metadata, console.* logs, and uncaught exceptions—from a deployed Cloudflare Worker to stdout without requiring Workers Logs storage to be enabled.

Quick Start: Pipe wrangler tail into Logdy ​

Step 1: Install Logdy ​

bash
brew install logdy
# or: curl https://logdy.dev/install.sh | sh

Step 2: Stream Pretty-Printed wrangler tail JSON as NDJSON into Logdy ​

By default, wrangler tail --format json outputs multi-line pretty-printed JSON objects—one envelope per Worker invocation. Logdy expects one JSON object per line (NDJSON) for automatic field parsing, so add jq -c --unbuffered '.' in the middle of the pipe:

bash
npx wrangler tail --format json \
  | jq -c --unbuffered '.' \
  | logdy --port 8080

Open http://127.0.0.1:8080 in your browser. Every Worker invocation appears as a structured row with expandable JSON for event.request, logs, and exceptions.

Flatten Key Fields for One-Click Facets ​

Because wrangler tail nests request details inside .event.request and console.log calls inside .logs[], projecting the fields you care about with jq gives Logdy clean top-level columns immediately:

bash
npx wrangler tail --format json \
  | jq -c --unbuffered '{
      ts: .eventTimestamp,
      outcome: .outcome,
      worker: .scriptName,
      method: .event.request.method,
      url: .event.request.url,
      log_count: (.logs | length),
      exception_count: (.exceptions | length),
      logs: .logs,
      exceptions: .exceptions
    }' \
  | logdy --port 8080

Using cf observability tail (Already NDJSON) ​

If your Worker has Workers Logs enabled (observability.enabled = true in wrangler.toml / wrangler.jsonc), Cloudflare's newer cf observability tail CLI already emits newline-delimited JSON directly—so you can pipe it straight into Logdy without jq:

bash
cf observability tail --worker my-worker | logdy --port 8080

You can also pre-filter server-side with --filters before events reach Logdy:

bash
cf observability tail --worker my-worker \
  --filters '{"filterCombination":"and","filters":[{"key":"$metadata.level","type":"string","operation":"eq","value":"error"}]}' \
  | logdy --port 8080

Useful wrangler tail Server-Side Filter Flags ​

On high-traffic Workers, wrangler tail can enter Cloudflare's sampling mode and drop events. Use Wrangler's built-in filter flags (verified against the official Cloudflare Wrangler CLI docs) to reduce volume before piping to Logdy:

wrangler tail FlagValues / TypeWhat It FiltersExample
--format"json" | "pretty"Output encoding--format json
--status"ok" | "error" | "canceled"Worker invocation outcome--status error
--methodHTTP verb stringIncoming HTTP method--method POST
--searchstringSubstring match in console.log messages--search "webhook"
--headerstringIncoming HTTP header filter--header "X-Debug:1"
--ipIP address or "self"Originating client IP--ip self
--sampling-ratenumber (0–1)Percentage of requests to sample--sampling-rate 0.25
--version-idstringSpecific Worker version ID--version-id <uuid>

Example—watch only failing POST requests from your own IP during a production test, while saving a rotating local capture file:

bash
npx wrangler tail my-worker \
  --format json \
  --status error \
  --method POST \
  --ip self \
  | jq -c --unbuffered '.' \
  | logdy --port 8080 --append-to-file ./worker-errors.log --rotate-file-size 20M

Tail Multiple Cloudflare Workers in One Browser Tab ​

Need to watch an API Worker and an Auth Worker side by side? Start Logdy in multi-port socket mode and forward each wrangler tail stream to its own port:

bash
# Terminal 1: Logdy web UI listening on two local TCP ports
logdy socket 8123 8124 --port 8080

# Terminal 2: API Worker
npx wrangler tail api-worker --format json | jq -c --unbuffered '.' | logdy forward 8123

# Terminal 3: Auth Worker
npx wrangler tail auth-worker --format json | jq -c --unbuffered '.' | logdy forward 8124

Both Workers stream into one browser tab, and Logdy's origin-port facet lets you toggle between 8123 and 8124 in one click.

wrangler tail + Logdy vs Cloudflare Dashboard vs Workers Logs ​

ApproachReal-Time Live View?Historical Search?Multi-Worker Combined View?Requires observability.enabled?
wrangler tail + LogdyYes (local browser UI)No (session buffer only)Yes (logdy socket + forward)No
Cloudflare Dashboard LiveYes (in browser)NoOne Worker per tabNo
Cloudflare Workers LogsNear real-time + cf observability tailYes (persisted in Cloudflare)Yes (account-wide queries)Yes

Honest Limits (Both Cloudflare and Logdy) ​

  • Cloudflare live-tail limits still apply: Per Cloudflare's Real-time logs documentation, wrangler tail does not persist logs, allows at most 10 concurrent tail clients per Worker (dashboard + CLI combined), enters sampling mode under high traffic (and may take up to 60 seconds to exit sampling after adding filters), and buffers console.log inside WebSocket handlers until the WebSocket connection closes.
  • No long-term storage in Logdy: Logdy holds the latest 100,000 messages in memory by default (--max-message-count). Use Cloudflare Workers Logs, Logpush, or Tail Workers for durable production log retention.
  • Requires jq for wrangler tail --format json: Because wrangler tail prints multi-line JSON objects, omitting jq -c --unbuffered will split each invocation across multiple raw lines in Logdy.

FAQ ​

Why do I need jq -c --unbuffered between wrangler tail and logdy? ​

wrangler tail --format json pretty-prints each invocation across multiple lines. jq -c compacts each JSON object onto a single line (NDJSON) so Logdy parses it cleanly, and --unbuffered flushes each event immediately instead of waiting for a stdout buffer to fill.

Does wrangler tail work for Cloudflare Pages Functions too? ​

Yes. Use npx wrangler pages deployment tail --format json | jq -c --unbuffered '.' | logdy to stream live logs from a Pages deployment's Functions.

Can I keep seeing logs in my terminal while streaming to Logdy? ​

Yes. Add --fallthrough (-t) to Logdy (... | logdy --fallthrough) so incoming stdin lines are echoed to your terminal while also streaming to the browser UI.

Does Logdy send my Cloudflare Worker logs anywhere? ​

No. Logdy runs locally on 127.0.0.1:8080 and never uploads log payloads. Pass --no-analytics (-n) and --no-updates (-u) if you also want to disable anonymous CLI usage stats and startup update checks.

How do I share a snapshot of a failing Worker invocation with a teammate? ​

Use --append-to-file ./worker-capture.log when starting Logdy, or export filtered rows directly from the Logdy browser UI.


Related guides: Local JSON Log Viewer · Self-Hosted Papertrail & Better Stack Alternative · AI Coding Agent Skills for Live Log Debugging