Checklists /Cloudflare /Monitoring
High
Turn on Workers logs and traces
A Worker that throws shows the visitor a Cloudflare error code and shows you nothing unless logs are enabled. Error 1101 means the script threw. Error 1102 means it ran too long. Both are much easier to fix if the stack trace is in the log.
How to check
- wrangler.jsonc should set observability.enabled and observability.traces.enabled to true. The top-level flag alone does not enable traces.
- Log JSON with console.log for normal events and console.error for failures.
- Deploy a preview or production version, hit one route, and find that event in Workers logs.
- Confirm logs do not contain secrets or full payment payloads.
Prompt
Fix prompt
You are working in this repository. Do not add features. Goal: Workers logs and traces are enabled, and handlers log structured JSON on failure. Steps: 1. In wrangler.jsonc set observability.enabled to true, and set both logs and traces enabled. Use a trace head_sampling_rate below 1 if you want to limit volume, and keep logs at 1 while you launch. 2. On caught errors, console.error a JSON object with the path and message, not the request headers. 3. Do not log env values. 4. Do not deploy. 5. Tell me how to tail logs with wrangler tail once I have an account.