#129 · Cloudflare Logpush configuration: ship structured Worker logs to R2
Last checked with GitLab: . Status comes from GitLab using a 2-minute cache. Merge events clear affected cached statuses. An already-open page does not update itself. Refresh page.
An MR completes this bounty when it is merged into main with Closes #129 and GitLab closes the issue. A mention or an updated timestamp is not completion. Awarded points appear in Activity.
cp .dev.vars.example .dev.vars && pnpm dev, after rebasing on main) and fully test your change before opening the MR.
Description
Background
v5.13.7 shipped \createLogger()\ and 8 Workers now emit JSON-per-line logs to \console.log\. Cloudflare Workers Logs captures these but retention is only 30 minutes (free tier).
To operationalize: configure Cloudflare Logpush jobs that ship those logs to R2 for retention, queryable post-hoc with \SELECT\ over R2 bucket prefixes.
Needs Cloudflare dashboard access; can't be done by code alone.
Scope
- Confirm Account → Logs → Logpush is enabled on the account (paid feature on Workers Paid plan — \$5/mo if not already)
- For each of the 8 adopting Workers, create a Logpush job to an R2 bucket (\
irregularchat-worker-logs\or similar — create if not exists)
- Field set: \
Outcome\, \EventTimestampMs\, \ScriptName\, \Logs.Message\, \Logs.Level\ - Filter: \
Outcome != "ok"\initially (focus on errors/exceptions/canceled), expand later - Compression: Gzip; bucket path \
worker-logs/{service}/{date}/\
- Set up an R2 lifecycle rule: transition objects older than 30d to Standard-IA storage class to reduce cost
- Document in a new runbook \
docs/runbooks/worker-logs.md\:
- How to query logs via \
wrangler r2 object list\+ \jq\ - How to add a new Worker to Logpush (since the bot-auth helper migration enables 4 more soon)
- Cost ceiling estimate (Logpush + R2 storage)
Acceptance
- All 8 logger-adopting Workers send logs to R2
- New runbook \
docs/runbooks/worker-logs.md\exists, links from \docs/runbooks/README.md\index - An on-call can grep yesterday's career-board errors with one command
Bounty: S
Pure config work + one runbook. No code changes.
Relevant files
No relevant files linked yet.
Hints
No hints yet.
Activity
No points have been awarded for this bounty yet.
Comments
Sign in to join the discussion.
No comments yet. Be the first to weigh in.