Your app crashed. The logs are gone.
Here's the worst part about vibe coding: your AI generated the code, you deployed it, and when it crashes in production, you can't debug it because you didn't write it. And the logging tool you installed? It didn't capture the crash either. Here's why — and how to fix it.
The 4 crashes your SDK can't see
1. CPU timeout
Your Worker hits the CPU limit (50ms on free, 30s on paid). Cloudflare kills it mid-execution. Your try/catch never fires. Your logging SDK never fires. The user sees a 500. You see nothing.
2. Memory exhaustion (Error 1027)
Your Worker exceeds 128MB of memory. Instant kill. No graceful shutdown. No error handler. Your SDK had no chance to log. The AI-generated code probably loaded a huge JSON file into memory instead of streaming it.
3. Startup failure
Your Worker throws during module initialization — a bad env var, a syntax error in a dynamic import, a missing binding. Your fetch handler never even registers. Sentry's wrapper never wraps it. The SDK never loads. The crash happens before your code runs.
4. Subrequest timeout
A fetch() call inside your Worker hangs past the subrequest limit. Same outcome — runtime kills the Worker, no error handler fires, no log is written.
How FlareLog's Tail Worker fixes this
The Tail Worker is a separate Cloudflare Worker that runs afteryour app Worker finishes — whether it succeeded or crashed. It receives the execution outcome from Cloudflare's runtime, including:
- ✓ The uncaught exception with full stack trace
- ✓ CPU time used (so you can see if you hit the limit)
- ✓ Request URL, method, and headers
- ✓ Duration and response status
- ✓ The outcome (ok, exception, exceededCpu, exceededMemory, etc.)
Even if your Worker dies on line 1, the Tail Worker captures it. Even if you didn't write any logging code, the Tail Worker captures it. Even if your AI-generated code has a bug you can't find, the Tail Worker tells you exactly where it is.
Set up the Tail Worker in 5 minutes
# 1. Clone the Tail Worker template
git clone https://github.com/flarelog-dev/tail-worker.git
cd tail-worker
npm install
# 2. Set your FlareLog API key
wrangler secret put FLARELOG_API_KEY
# 3. Optional: alert webhook (Slack / Discord / HTTP)
wrangler secret put ALERT_WEBHOOK_URL
# 4. Edit wrangler.toml to point at your producer Workers
# [[tail_consumers]]
# service = "your-producer-worker-1"
# 5. Deploy
npm run deployFAQ
Why can't I see my Worker's errors in the Cloudflare dashboard?
Cloudflare's built-in log explorer only shows console.log output from successful requests. If your Worker crashes before it can log (CPU timeout, memory limit, startup error), Cloudflare shows 'Error 1101' but no stack trace. FlareLog's Tail Worker runs after your Worker finishes and receives the execution outcome — including the uncaught exception — from Cloudflare's runtime.
What's a Tail Worker?
A Tail Worker is a special Cloudflare Workers feature that runs out-of-band, after your main Worker finishes (or crashes). It receives the execution outcome — including exceptions, CPU time, and duration — without affecting your app's response time. FlareLog's Tail Worker template captures these outcomes and ships them to your dashboard.
Do I need to change my app's code to use the Tail Worker?
No. The Tail Worker is a separate Worker that you deploy alongside your app. It doesn't modify your app's code. You just clone the template, set your API key, and deploy. Your app keeps running as-is — the Tail Worker watches it from the outside.
Will the Tail Worker slow down my app?
No. Tail Workers run asynchronously, after your response is sent to the user. They have zero impact on your app's latency. Cloudflare doesn't even charge for Tail Worker invocations on most plans.