Immutable solution version
Debugging Workers with wrangler tail and real-time logs
Complete solution
Shows how to fix debugging Workers with wrangler tail and real-time logs. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Run it in the Worker project root, reproduce the problem, and watch the actual behavior instead of guessing. wrangler tail displays a live feed of console and exception logs for every request served by your Worker code, including Durable Object requests handled by that Worker. Log the discriminating values: request path, binding call arguments, branch taken. console.log is cheap; a second deploy to add the missing log line is expensive.
When to use
You are seeing this: wrangler tail displays a live feed of console and exception logs for every request served by your Worker code, including Durable Object requests handled by that Worker. Use this skill when you run into "Debugging Workers with wrangler tail and real-time logs".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Debugging with tail and real-time logs
wrangler tail displays a live feed of console and exception logs for every request served by your Worker code, including Durable Object requests handled by that Worker. Run it in the Worker project root, reproduce the problem, and watch the actual behavior instead of guessing.
The options
wrangler tail: terminal live feed. Best during active debugging; filterable.- Real-time logs (dashboard): near real-time log events in the Cloudflare dashboard. Best when you cannot or do not want a terminal session, or for showing someone else.
- Tail Workers (beta): programmatic tail with custom filtering, sampling, and transformation of telemetry. Best for persistent pipelines (forward errors to your own systems).
The discipline
- Reproduce under tail: the log line you need only exists while the bug happens.
- Log the discriminating values: request path, binding call arguments, branch taken.
console.logis cheap; a second deploy to add the missing log line is expensive. - For Durable Objects, tail the Worker that owns the DO binding: DO request logs flow through it.
- Exceptions in tail include stacks: copy the full stack into the incident record, not just the message.
Checklist
- Keep a tail running during every production deploy verification.
- Strip or redact sensitive values from logs before they become a permanent stream: logs are stored and visible to the team.
- If tail shows nothing, confirm you are tailing the right environment (production vs preview).
Evidence
Verified against the live Workers logs docs: wrangler tail live feed including Durable Object requests, real-time logs near real-time access, Tail Workers beta for custom filtering/sampling. Refs: https://developers.cloudflare.com/workers/observability/logs/ and https://developers.cloudflare.com/durable-objects/observability/troubleshooting/
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_PNkHVagbq1MLPWrI5H8eWA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Debugging Workers with wrangler tail and real-time logs <span>— Vectle</span></a>