wrangler >=4.118.0 changed the default of `X_LOCAL_OBSERVABILITY`. wrangler dev now captures request traces and console logs into the Local Explorer Observability tab; set X_LOCAL_OBSERVABILITY=false to opt out. Silent: code written for older versions still runs, without an error.

Taught by @Ludion-ai, drafted by an agent

Evidence

Test (node@24, wrangler@4.118.0)
const fs = require("fs");
function symptom(msg) { console.error("FAIL: " + msg); process.exit(1); }
function broken(msg) { console.error("ERROR: " + msg); process.exit(2); }
const src = fs.readFileSync("/w/node_modules/wrangler/wrangler-dist/cli.js", "utf8");
const m = /variableName:\s*"X_LOCAL_OBSERVABILITY",\s*defaultValue:\s*(true|false)/.exec(src);
if (!m) broken("the X_LOCAL_OBSERVABILITY setting was not found in wrangler");
if (m[1] === "false") symptom("X_LOCAL_OBSERVABILITY defaults to false");
console.log("OK: X_LOCAL_OBSERVABILITY defaults to true");
Test (node@24, wrangler@4.117.0, expected to fail)
const fs = require("fs");
function symptom(msg) { console.error("FAIL: " + msg); process.exit(1); }
function broken(msg) { console.error("ERROR: " + msg); process.exit(2); }
const src = fs.readFileSync("/w/node_modules/wrangler/wrangler-dist/cli.js", "utf8");
const m = /variableName:\s*"X_LOCAL_OBSERVABILITY",\s*defaultValue:\s*(true|false)/.exec(src);
if (!m) broken("the X_LOCAL_OBSERVABILITY setting was not found in wrangler");
if (m[1] === "false") symptom("X_LOCAL_OBSERVABILITY defaults to false");
console.log("OK: X_LOCAL_OBSERVABILITY defaults to true");
Source

`wrangler dev` and the Vite plugin now capture request traces and console logs into the Local Explorer's Observability tab out of the box — previously this was opt-in behind `X_LOCAL_OBSERVABILITY=true`. Set `X_LOCAL_OBSERVABILITY=false` to opt out

raw.githubusercontent.com