✦ For Cloudflare Workers · Tail Workers · Hono · KV · D1 · Queues ✦

01For Cloudflare Workers

Your Worker crashed at 2am.
Cloudflare's dashboard showed green.

Cloudflare only keeps logs for 7 days. Error 1101 gives you none. CPU timeouts vanish. FlareLog uses a Tail Worker + SDK to capture it all — even when your code never fires.

$npm install @flarelog/sdk
Live — cf-prod-01Tail Worker connected
nowERRORHTTP 500 — Uncaught TypeError: Cannot read properties of undefined
12sWARNCPU duration 498ms (limit 500ms)
45sERRORKV write failed: network timeout
1mINFOQueue consumer exhausted retries (3/3)
3mWARND1 query timeout after 5000ms
5mINFOR2 upload complete
02FlareLog vs Cloudflare native

Workers Logs is a good start.
Production debugging needs more.

Capability
FlareLog
Cloudflare Native
Crash visibility
SDK + Tail Worker (catches CPU timeouts & init crashes)
SDK errors only — misses init failures
Log retention
7 days free, 90 days on Pro
7 days on Workers Free/Pro
Error 1101
Captured via Tail Worker with exit reason
No logs shown
KV cost burn
Real-time cost burn alerts before invoice
$5/million writes — bill arrives later
Stack traces
Readable file/line references
Minified src/index.js:1:342
Searchable history
Search by path, error, status for 90 days
Real-time stream, limited lookback
OTel / traces
W3C propagation + multi-backend fan-out
Basic
Alerting
Email + Slack alerts
None for Workers logs
032-minute setup

Catch everything,
however you build.

Start with the Tail Worker for zero-code crash capture. Add the SDK for structured logs. Use Hono if that's your framework.

wrangler.toml + terminal
# 1. Clone the FlareLog Tail Worker template
git clone https://github.com/flarelog-dev/tail-worker.git
cd tail-worker
npm install

# 2. Add your FlareLog API key
wrangler secret put FLARELOG_API_KEY

# 3. Point your producer Workers at this Tail Worker
# In each Worker's wrangler.toml:
[[tail_consumers]]
service = "your-worker-name"

# 4. Deploy
npm run deploy

Captures HTTP 500s, CPU timeouts, and uncaught errors even when your SDK never loads.

.env / wrangler.toml
# Add your FlareLog project API key
wrangler secret put FLARELOG_API_KEY

# Optional: set environment and release
FLARELOG_ENVIRONMENT=production
FLARELOG_RELEASE=1.0.0
04Cloudflare-only failure modes

The crashes Cloudflare
doesn't explain

Error 1101: No logs? Here's why

Error 1101 means your Worker was terminated before it could log. It happens on CPU limits, memory limits, or runtime exceptions during initialization. Because the error occurs before your SDK runs, you'll never see it in Workers Logs. The FlareLog Tail Worker attaches at the edge runtime layer and records the failure anyway.

CPU timeout: the invisible killer

Workers silently return 500 when they exceed 50 ms (free) or 500 ms (bundled) of CPU time. Cloudflare's dashboard shows the request, but without context. FlareLog records the exact CPU duration per request, surfaces the route, and alerts you when you're approaching the limit.

KV cost burn: $5 per million writes

KV writes are cheap until they aren't. A misconfigured loop or an over-eager cache layer can write millions of keys before the bill arrives. FlareLog counts KV operations per request, estimates cost in real time, and fires a Slack or email alert before the invoice lands.

D1 timeouts, Queue retries, R2 failures

D1 has a 30-second query timeout. Queues retry 3 times and give up. R2 returns vague 5xx errors. Without structured logs that survive the Worker lifecycle, you're stuck guessing. FlareLog flushes all of them via ctx.waitUntil() so they reach your dashboard.

The 7-day retention cliff

Cloudflare keeps Workers Logs for 7 days. If a customer reports an issue from last week, you have no context. FlareLog keeps 90 days on Pro, with full-text search by route, error, status, and custom metadata.
05What you get

What's inside the
Cloudflare Workers integration

Tail Worker

Crash capture without code

Add one Tail Worker to capture HTTP 500s, CPU timeouts, OOM, and uncaught errors across your whole account — even when the producer's SDK never loads.

Cost

Real-time cost burn alerts

KV writes, R2 operations, and CPU duration are estimated per request. Get alerted on Slack or email when spend crosses your threshold.

Search

90-day searchable history

Filter by route, error type, status code, or any JSON metadata. Retain logs for 90 days on Pro instead of Cloudflare's 7-day limit.

OTel

W3C trace propagation

Inject trace context into service bindings and outbound fetch calls. Trace requests across multiple Workers, clouds, and backends.

SDK

Zero-dependency, tiny bundle

The SDK is zero-dependency and Workers-native. workerFetch() and honoMiddleware handle flushing via ctx.waitUntil() automatically.

MCP

AI-native debugging

Ask Cursor or Claude "why did my Worker 500 in fra?" The MCP server returns live logs with full context and suggests fixes.

90d

retention on Pro

10k

free logs/mo

$19

flat Pro bucket

0

runtime dependencies

06FAQ

Questions Cloudflare Workers
operators ask

Do I need to change my Worker's code?

Not for crash capture. The Tail Worker attaches externally and sees failures even when your own SDK never loads. For structured logging, add the SDK — it's one middleware line.

Will this slow down my Worker?

No. The Tail Worker runs out-of-band and has zero impact on request latency. The SDK flushes asynchronously via ctx.waitUntil(), adding sub-millisecond overhead per invocation.

Can I use this on the Workers Free plan?

Yes. Tail Workers are available on all plans. FlareLog's free tier includes 10,000 logs/mo and 7-day retention.

What if I use Hono, Itty-Router, or Durable Objects?

The SDK has dedicated support for Hono and works with any fetch-based framework via workerFetch(). Durable Objects, Queues, Cron, and R2 are all covered in the docs.

How does cost alerting work?

FlareLog reads CPU time, subrequests, KV operations, and other metadata from Tail Worker events. It estimates per-request cost and alerts you via Slack or email when a threshold is crossed.

Is my data safe with a third-party Tail Worker?

The Tail Worker only forwards telemetry — logs, errors, and resource metadata — to FlareLog. It doesn't proxy user traffic or read request bodies unless you explicitly log them.

07Start today

Add the Tail Worker in 2 minutes.
Start logging free.

Free tier includes 10,000 logs/month and Tail Worker crash capture. No credit card. No changes to your core Workers.