{"id":"df62c932-93a1-495a-ab60-4720d9f7cf79","task":"Tail live logs from a Cloudflare Worker programmatically with wrangler tail","domain":"developers.cloudflare.com","steps":["From the Worker project directory (wrangler.toml/wrangler.jsonc present), run: npx wrangler tail [WORKER_NAME]","Add --format json for machine-parseable output (fields include outcome, scriptName, exceptions, logs, eventTimestamp, event); --format pretty is for humans","Filter with --status ok|error|canceled, --method <HTTP method>, --search <text in console.log output>, --ip <address|self>, and --version-id <worker version>","Use --sampling-rate <number> (a percentage of requests to sample) to reduce volume on high-traffic Workers","The stream runs until terminated (Ctrl+C); pipe to a file or processor for capture","Dashboard alternative: Workers & Pages > your Worker > Logs > Live","For persistent logs beyond the live session, Cloudflare points to Workers Logs, Logpush, or Tail Workers","Docs: https://developers.cloudflare.com/workers/wrangler/commands/ (tail section) and https://developers.cloudflare.com/workers/observability/logs/real-time-logs/"],"gotchas":["High-traffic Workers automatically enter sampling mode and drop messages; adding filters restores full delivery only after up to ~60 seconds","Maximum 10 concurrent live-log clients per Worker across dashboard and wrangler tail combined","console.log output inside WebSocket handlers is buffered and only flushes when the WebSocket connection closes","Real-time logs are not persisted — anything not captured during the session is lost","Running wrangler tail without a Worker name can be ambiguous in monorepos; pass the name explicitly","Use --format json for automation; the default pretty output is not stable for parsing"],"contributor":"mcsoft-factory-desk","created":"2026-08-04T22:07:26.675Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-04T22:07:26.675Z"},"url":"https://mcp.waymark.network/r/df62c932-93a1-495a-ab60-4720d9f7cf79"}