[{"data":1,"prerenderedAt":2286},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-cloudflare-workers":308,"-frameworks-cloudflare-workers-surround":2281},[4,35,80,124,212,292],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,75],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":66,"path":67,"stem":68,"icon":69},"AI SDK Integration","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk","i-simple-icons-vercel",{"title":71,"path":72,"stem":73,"icon":74},"Better Auth Integration","\u002Flogging\u002Fbetter-auth","2.logging\u002F6.better-auth","i-simple-icons-betterauth",{"title":76,"path":77,"stem":78,"icon":79},"Audit Logs","\u002Flogging\u002Faudit","2.logging\u002F7.audit","i-lucide-shield-check",{"title":81,"path":82,"stem":83,"children":84,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[85,90,95,100,105,109,114,119],{"title":86,"path":87,"stem":88,"icon":89},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":91,"path":92,"stem":93,"icon":94},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":96,"path":97,"stem":98,"icon":99},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":101,"path":102,"stem":103,"icon":104},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":106,"path":107,"stem":108,"icon":79},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":110,"path":111,"stem":112,"icon":113},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance","i-lucide-gauge",{"title":115,"path":116,"stem":117,"icon":118},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":120,"path":121,"stem":122,"icon":123},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":125,"path":126,"stem":127,"children":128,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[129,133,138,143,148,153,158,163,168,173,178,183,188,193,197,202,207],{"title":41,"path":130,"stem":131,"icon":132},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":134,"path":135,"stem":136,"icon":137},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":139,"path":140,"stem":141,"icon":142},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":144,"path":145,"stem":146,"icon":147},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":149,"path":150,"stem":151,"icon":152},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":154,"path":155,"stem":156,"icon":157},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":159,"path":160,"stem":161,"icon":162},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":164,"path":165,"stem":166,"icon":167},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":169,"path":170,"stem":171,"icon":172},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":174,"path":175,"stem":176,"icon":177},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":179,"path":180,"stem":181,"icon":182},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":184,"path":185,"stem":186,"icon":187},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":189,"path":190,"stem":191,"icon":192},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":194,"path":195,"stem":196,"icon":104},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":198,"path":199,"stem":200,"icon":201},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":203,"path":204,"stem":205,"icon":206},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":208,"path":209,"stem":210,"icon":211},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":213,"path":214,"stem":215,"children":216,"page":34},"Adapters","\u002Fadapters","6.adapters",[217,257,272],{"title":218,"path":219,"stem":220,"children":221,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[222,227,232,237,242,247,252],{"title":223,"path":224,"stem":225,"icon":226},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":228,"path":229,"stem":230,"icon":231},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":233,"path":234,"stem":235,"icon":236},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":238,"path":239,"stem":240,"icon":241},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":243,"path":244,"stem":245,"icon":246},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":248,"path":249,"stem":250,"icon":251},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":253,"path":254,"stem":255,"icon":256},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":258,"path":259,"stem":260,"children":261,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[262,267],{"title":263,"path":264,"stem":265,"icon":266},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":268,"path":269,"stem":270,"icon":271},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":273,"path":274,"stem":275,"children":276,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[277,282,287],{"title":278,"path":279,"stem":280,"icon":281},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":283,"path":284,"stem":285,"icon":286},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":288,"path":289,"stem":290,"icon":291},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom","i-lucide-code",{"title":293,"path":294,"stem":295,"children":296,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[297,300,304],{"title":41,"path":298,"stem":299,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":301,"path":302,"stem":303,"icon":211},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":305,"path":306,"stem":307,"icon":291},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":309,"title":189,"body":310,"description":2274,"extension":2275,"links":2276,"meta":2277,"navigation":2278,"path":190,"seo":2279,"stem":191,"__hash__":2280},"docs\u002F4.frameworks\u002F12.cloudflare-workers.md",{"type":311,"value":312,"toc":2261},"minimark",[313,326,375,379,384,455,459,712,743,760,789,792,795,1229,1295,1299,1306,1849,1852,1863,1867,1873,2160,2169,2173,2176,2205,2209,2223,2227,2257],[314,315,316,317,321,322,325],"p",{},"The ",[318,319,320],"code",{},"evlog\u002Fworkers"," adapter provides factory functions for creating request-scoped loggers with Cloudflare-specific context. Unlike framework integrations, Workers require manual ",[318,323,324],{},"log.emit()"," calls since there is no middleware lifecycle to hook into.",[327,328,331,334,361],"prompt",{":actions":329,"description":330,"icon":192},"[\"copy\",\"cursor\",\"windsurf\"]","Set up evlog in my Cloudflare Worker",[314,332,333],{},"Set up evlog in my Cloudflare Worker.",[335,336,337,341,344,347,355,358],"ul",{},[338,339,340],"li",{},"Install evlog: pnpm add evlog",[338,342,343],{},"Import initWorkersLogger and defineWorkerFetch from 'evlog\u002Fworkers'",[338,345,346],{},"Call initWorkersLogger({ env: { service: 'my-worker' } }) at the top level",[338,348,349,350,354],{},"In the fetch handler, use ",[351,352,353],"strong",{},"defineWorkerFetch"," (recommended) or createWorkersLogger(request, { executionCtx: ctx })",[338,356,357],{},"Use log.set() to accumulate context throughout the request",[338,359,360],{},"Call log.emit() manually before returning the response (no middleware lifecycle)",[314,362,363,364,370,371],{},"Docs: ",[365,366,367],"a",{"href":367,"rel":368},"https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Fcloudflare-workers",[369],"nofollow","\nAdapters: ",[365,372,373],{"href":373,"rel":374},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters",[369],[376,377,20],"h2",{"id":378},"quick-start",[380,381,383],"h3",{"id":382},"_1-install","1. Install",[385,386,387,412,426,440],"code-group",{},[388,389,395],"pre",{"className":390,"code":391,"filename":392,"language":393,"meta":394,"style":394},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add evlog\n","pnpm","bash","",[318,396,397],{"__ignoreMap":394},[398,399,402,405,409],"span",{"class":400,"line":401},"line",1,[398,403,392],{"class":404},"sBMFI",[398,406,408],{"class":407},"sfazB"," add",[398,410,411],{"class":407}," evlog\n",[388,413,416],{"className":390,"code":414,"filename":415,"language":393,"meta":394,"style":394},"bun add evlog\n","bun",[318,417,418],{"__ignoreMap":394},[398,419,420,422,424],{"class":400,"line":401},[398,421,415],{"class":404},[398,423,408],{"class":407},[398,425,411],{"class":407},[388,427,430],{"className":390,"code":428,"filename":429,"language":393,"meta":394,"style":394},"yarn add evlog\n","yarn",[318,431,432],{"__ignoreMap":394},[398,433,434,436,438],{"class":400,"line":401},[398,435,429],{"class":404},[398,437,408],{"class":407},[398,439,411],{"class":407},[388,441,444],{"className":390,"code":442,"filename":443,"language":393,"meta":394,"style":394},"npm install evlog\n","npm",[318,445,446],{"__ignoreMap":394},[398,447,448,450,453],{"class":400,"line":401},[398,449,443],{"class":404},[398,451,452],{"class":407}," install",[398,454,411],{"class":407},[380,456,458],{"id":457},"_2-initialize-and-create-request-loggers","2. Initialize and create request loggers",[388,460,465],{"className":461,"code":462,"filename":463,"language":464,"meta":394,"style":394},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineWorkerFetch, initWorkersLogger } from 'evlog\u002Fworkers'\n\ninitWorkersLogger({\n  env: { service: 'my-worker' },\n})\n\nexport default defineWorkerFetch(async (request, _env, _ctx, log) => {\n  log.set({ action: 'handle_request' })\n\n  \u002F\u002F ... your handler logic\n\n  log.emit()\n  return Response.json({ ok: true })\n})\n","src\u002Fworker.ts","typescript",[318,466,467,501,508,521,549,558,563,611,644,649,656,661,674,705],{"__ignoreMap":394},[398,468,469,473,477,481,484,487,490,493,496,498],{"class":400,"line":401},[398,470,472],{"class":471},"s7zQu","import",[398,474,476],{"class":475},"sMK4o"," {",[398,478,480],{"class":479},"sTEyZ"," defineWorkerFetch",[398,482,483],{"class":475},",",[398,485,486],{"class":479}," initWorkersLogger",[398,488,489],{"class":475}," }",[398,491,492],{"class":471}," from",[398,494,495],{"class":475}," '",[398,497,320],{"class":407},[398,499,500],{"class":475},"'\n",[398,502,504],{"class":400,"line":503},2,[398,505,507],{"emptyLinePlaceholder":506},true,"\n",[398,509,511,515,518],{"class":400,"line":510},3,[398,512,514],{"class":513},"s2Zo4","initWorkersLogger",[398,516,517],{"class":479},"(",[398,519,520],{"class":475},"{\n",[398,522,524,528,531,533,536,538,540,543,546],{"class":400,"line":523},4,[398,525,527],{"class":526},"swJcz","  env",[398,529,530],{"class":475},":",[398,532,476],{"class":475},[398,534,535],{"class":526}," service",[398,537,530],{"class":475},[398,539,495],{"class":475},[398,541,542],{"class":407},"my-worker",[398,544,545],{"class":475},"'",[398,547,548],{"class":475}," },\n",[398,550,552,555],{"class":400,"line":551},5,[398,553,554],{"class":475},"}",[398,556,557],{"class":479},")\n",[398,559,561],{"class":400,"line":560},6,[398,562,507],{"emptyLinePlaceholder":506},[398,564,566,569,572,574,576,580,583,587,589,592,594,597,599,602,605,608],{"class":400,"line":565},7,[398,567,568],{"class":471},"export",[398,570,571],{"class":471}," default",[398,573,480],{"class":513},[398,575,517],{"class":479},[398,577,579],{"class":578},"spNyl","async",[398,581,582],{"class":475}," (",[398,584,586],{"class":585},"sHdIc","request",[398,588,483],{"class":475},[398,590,591],{"class":585}," _env",[398,593,483],{"class":475},[398,595,596],{"class":585}," _ctx",[398,598,483],{"class":475},[398,600,601],{"class":585}," log",[398,603,604],{"class":475},")",[398,606,607],{"class":578}," =>",[398,609,610],{"class":475}," {\n",[398,612,614,617,620,623,625,628,631,633,635,638,640,642],{"class":400,"line":613},8,[398,615,616],{"class":479},"  log",[398,618,619],{"class":475},".",[398,621,622],{"class":513},"set",[398,624,517],{"class":526},[398,626,627],{"class":475},"{",[398,629,630],{"class":526}," action",[398,632,530],{"class":475},[398,634,495],{"class":475},[398,636,637],{"class":407},"handle_request",[398,639,545],{"class":475},[398,641,489],{"class":475},[398,643,557],{"class":526},[398,645,647],{"class":400,"line":646},9,[398,648,507],{"emptyLinePlaceholder":506},[398,650,652],{"class":400,"line":651},10,[398,653,655],{"class":654},"sHwdD","  \u002F\u002F ... your handler logic\n",[398,657,659],{"class":400,"line":658},11,[398,660,507],{"emptyLinePlaceholder":506},[398,662,664,666,668,671],{"class":400,"line":663},12,[398,665,616],{"class":479},[398,667,619],{"class":475},[398,669,670],{"class":513},"emit",[398,672,673],{"class":526},"()\n",[398,675,677,680,683,685,688,690,692,695,697,701,703],{"class":400,"line":676},13,[398,678,679],{"class":471},"  return",[398,681,682],{"class":479}," Response",[398,684,619],{"class":475},[398,686,687],{"class":513},"json",[398,689,517],{"class":526},[398,691,627],{"class":475},[398,693,694],{"class":526}," ok",[398,696,530],{"class":475},[398,698,700],{"class":699},"sfNiH"," true",[398,702,489],{"class":475},[398,704,557],{"class":526},[398,706,708,710],{"class":400,"line":707},14,[398,709,554],{"class":475},[398,711,557],{"class":479},[314,713,714,716,717,720,721,724,725,730,731,734,735,738,739,742],{},[318,715,353],{}," passes ",[318,718,719],{},"ExecutionContext"," into ",[318,722,723],{},"createWorkersLogger"," for you, so async ",[351,726,727],{},[318,728,729],{},"drain"," calls (PostHog, Axiom, …) stay alive via ",[318,732,733],{},"waitUntil"," after the response is returned. Use raw ",[318,736,737],{},"export default { fetch }"," + ",[318,740,741],{},"createWorkersLogger(request, { executionCtx: ctx })"," only if you prefer not to use the wrapper.",[314,744,745,747,748,751,752,755,756,759],{},[318,746,723],{}," still auto-extracts ",[318,749,750],{},"method",", ",[318,753,754],{},"path",", and ",[318,757,758],{},"cf-ray"," from the request.",[761,762,764,765,767,768,772,773,775,776,778,779,782,783,786,787,619],"callout",{"color":763,"icon":13},"info","You must call ",[318,766,324],{}," manually before returning a response. Workers don't have a request lifecycle hook to auto-emit. With ",[351,769,770],{},[318,771,353],{},", async ",[318,774,729],{}," work is tied to ",[318,777,733],{}," automatically; with a raw ",[318,780,781],{},"{ fetch }"," handler, pass ",[318,784,785],{},"{ executionCtx: ctx }"," to ",[318,788,723],{},[376,790,51],{"id":791},"wide-events",[314,793,794],{},"Build up context progressively, then emit at the end:",[388,796,798],{"className":461,"code":797,"filename":463,"language":464,"meta":394,"style":394},"import { defineWorkerFetch, initWorkersLogger } from 'evlog\u002Fworkers'\n\ninitWorkersLogger({\n  env: { service: 'my-worker' },\n})\n\nexport default defineWorkerFetch(async (request, env, _ctx, log) => {\n  const url = new URL(request.url)\n\n  log.set({ route: url.pathname })\n\n  const user = await env.DB.prepare('SELECT * FROM users WHERE id = ?').bind(url.searchParams.get('userId')).first()\n  log.set({ user: { id: user.id, plan: user.plan } })\n\n  const orders = await env.DB.prepare('SELECT COUNT(*) as count FROM orders WHERE user_id = ?').bind(user.id).first()\n  log.set({ orders: { count: orders.count } })\n\n  log.emit()\n  return Response.json({ user, orders })\n})\n",[318,799,800,822,826,834,854,860,864,899,927,931,959,963,1036,1086,1090,1144,1181,1186,1197,1222],{"__ignoreMap":394},[398,801,802,804,806,808,810,812,814,816,818,820],{"class":400,"line":401},[398,803,472],{"class":471},[398,805,476],{"class":475},[398,807,480],{"class":479},[398,809,483],{"class":475},[398,811,486],{"class":479},[398,813,489],{"class":475},[398,815,492],{"class":471},[398,817,495],{"class":475},[398,819,320],{"class":407},[398,821,500],{"class":475},[398,823,824],{"class":400,"line":503},[398,825,507],{"emptyLinePlaceholder":506},[398,827,828,830,832],{"class":400,"line":510},[398,829,514],{"class":513},[398,831,517],{"class":479},[398,833,520],{"class":475},[398,835,836,838,840,842,844,846,848,850,852],{"class":400,"line":523},[398,837,527],{"class":526},[398,839,530],{"class":475},[398,841,476],{"class":475},[398,843,535],{"class":526},[398,845,530],{"class":475},[398,847,495],{"class":475},[398,849,542],{"class":407},[398,851,545],{"class":475},[398,853,548],{"class":475},[398,855,856,858],{"class":400,"line":551},[398,857,554],{"class":475},[398,859,557],{"class":479},[398,861,862],{"class":400,"line":560},[398,863,507],{"emptyLinePlaceholder":506},[398,865,866,868,870,872,874,876,878,880,882,885,887,889,891,893,895,897],{"class":400,"line":565},[398,867,568],{"class":471},[398,869,571],{"class":471},[398,871,480],{"class":513},[398,873,517],{"class":479},[398,875,579],{"class":578},[398,877,582],{"class":475},[398,879,586],{"class":585},[398,881,483],{"class":475},[398,883,884],{"class":585}," env",[398,886,483],{"class":475},[398,888,596],{"class":585},[398,890,483],{"class":475},[398,892,601],{"class":585},[398,894,604],{"class":475},[398,896,607],{"class":578},[398,898,610],{"class":475},[398,900,901,904,907,910,913,916,918,920,922,925],{"class":400,"line":613},[398,902,903],{"class":578},"  const",[398,905,906],{"class":479}," url",[398,908,909],{"class":475}," =",[398,911,912],{"class":475}," new",[398,914,915],{"class":513}," URL",[398,917,517],{"class":526},[398,919,586],{"class":479},[398,921,619],{"class":475},[398,923,924],{"class":479},"url",[398,926,557],{"class":526},[398,928,929],{"class":400,"line":646},[398,930,507],{"emptyLinePlaceholder":506},[398,932,933,935,937,939,941,943,946,948,950,952,955,957],{"class":400,"line":651},[398,934,616],{"class":479},[398,936,619],{"class":475},[398,938,622],{"class":513},[398,940,517],{"class":526},[398,942,627],{"class":475},[398,944,945],{"class":526}," route",[398,947,530],{"class":475},[398,949,906],{"class":479},[398,951,619],{"class":475},[398,953,954],{"class":479},"pathname",[398,956,489],{"class":475},[398,958,557],{"class":526},[398,960,961],{"class":400,"line":658},[398,962,507],{"emptyLinePlaceholder":506},[398,964,965,967,970,972,975,977,979,982,984,987,989,991,994,996,998,1000,1003,1005,1007,1009,1012,1014,1017,1019,1021,1024,1026,1029,1031,1034],{"class":400,"line":663},[398,966,903],{"class":578},[398,968,969],{"class":479}," user",[398,971,909],{"class":475},[398,973,974],{"class":471}," await",[398,976,884],{"class":479},[398,978,619],{"class":475},[398,980,981],{"class":479},"DB",[398,983,619],{"class":475},[398,985,986],{"class":513},"prepare",[398,988,517],{"class":526},[398,990,545],{"class":475},[398,992,993],{"class":407},"SELECT * FROM users WHERE id = ?",[398,995,545],{"class":475},[398,997,604],{"class":526},[398,999,619],{"class":475},[398,1001,1002],{"class":513},"bind",[398,1004,517],{"class":526},[398,1006,924],{"class":479},[398,1008,619],{"class":475},[398,1010,1011],{"class":479},"searchParams",[398,1013,619],{"class":475},[398,1015,1016],{"class":513},"get",[398,1018,517],{"class":526},[398,1020,545],{"class":475},[398,1022,1023],{"class":407},"userId",[398,1025,545],{"class":475},[398,1027,1028],{"class":526},"))",[398,1030,619],{"class":475},[398,1032,1033],{"class":513},"first",[398,1035,673],{"class":526},[398,1037,1038,1040,1042,1044,1046,1048,1050,1052,1054,1057,1059,1061,1063,1066,1068,1071,1073,1075,1077,1080,1082,1084],{"class":400,"line":676},[398,1039,616],{"class":479},[398,1041,619],{"class":475},[398,1043,622],{"class":513},[398,1045,517],{"class":526},[398,1047,627],{"class":475},[398,1049,969],{"class":526},[398,1051,530],{"class":475},[398,1053,476],{"class":475},[398,1055,1056],{"class":526}," id",[398,1058,530],{"class":475},[398,1060,969],{"class":479},[398,1062,619],{"class":475},[398,1064,1065],{"class":479},"id",[398,1067,483],{"class":475},[398,1069,1070],{"class":526}," plan",[398,1072,530],{"class":475},[398,1074,969],{"class":479},[398,1076,619],{"class":475},[398,1078,1079],{"class":479},"plan",[398,1081,489],{"class":475},[398,1083,489],{"class":475},[398,1085,557],{"class":526},[398,1087,1088],{"class":400,"line":707},[398,1089,507],{"emptyLinePlaceholder":506},[398,1091,1093,1095,1098,1100,1102,1104,1106,1108,1110,1112,1114,1116,1119,1121,1123,1125,1127,1129,1132,1134,1136,1138,1140,1142],{"class":400,"line":1092},15,[398,1094,903],{"class":578},[398,1096,1097],{"class":479}," orders",[398,1099,909],{"class":475},[398,1101,974],{"class":471},[398,1103,884],{"class":479},[398,1105,619],{"class":475},[398,1107,981],{"class":479},[398,1109,619],{"class":475},[398,1111,986],{"class":513},[398,1113,517],{"class":526},[398,1115,545],{"class":475},[398,1117,1118],{"class":407},"SELECT COUNT(*) as count FROM orders WHERE user_id = ?",[398,1120,545],{"class":475},[398,1122,604],{"class":526},[398,1124,619],{"class":475},[398,1126,1002],{"class":513},[398,1128,517],{"class":526},[398,1130,1131],{"class":479},"user",[398,1133,619],{"class":475},[398,1135,1065],{"class":479},[398,1137,604],{"class":526},[398,1139,619],{"class":475},[398,1141,1033],{"class":513},[398,1143,673],{"class":526},[398,1145,1147,1149,1151,1153,1155,1157,1159,1161,1163,1166,1168,1170,1172,1175,1177,1179],{"class":400,"line":1146},16,[398,1148,616],{"class":479},[398,1150,619],{"class":475},[398,1152,622],{"class":513},[398,1154,517],{"class":526},[398,1156,627],{"class":475},[398,1158,1097],{"class":526},[398,1160,530],{"class":475},[398,1162,476],{"class":475},[398,1164,1165],{"class":526}," count",[398,1167,530],{"class":475},[398,1169,1097],{"class":479},[398,1171,619],{"class":475},[398,1173,1174],{"class":479},"count",[398,1176,489],{"class":475},[398,1178,489],{"class":475},[398,1180,557],{"class":526},[398,1182,1184],{"class":400,"line":1183},17,[398,1185,507],{"emptyLinePlaceholder":506},[398,1187,1189,1191,1193,1195],{"class":400,"line":1188},18,[398,1190,616],{"class":479},[398,1192,619],{"class":475},[398,1194,670],{"class":513},[398,1196,673],{"class":526},[398,1198,1200,1202,1204,1206,1208,1210,1212,1214,1216,1218,1220],{"class":400,"line":1199},19,[398,1201,679],{"class":471},[398,1203,682],{"class":479},[398,1205,619],{"class":475},[398,1207,687],{"class":513},[398,1209,517],{"class":526},[398,1211,627],{"class":475},[398,1213,969],{"class":479},[398,1215,483],{"class":475},[398,1217,1097],{"class":479},[398,1219,489],{"class":475},[398,1221,557],{"class":526},[398,1223,1225,1227],{"class":400,"line":1224},20,[398,1226,554],{"class":475},[398,1228,557],{"class":479},[388,1230,1233],{"className":390,"code":1231,"filename":1232,"language":393,"meta":394,"style":394},"14:58:15 INFO [my-worker] GET \u002Fapi\u002Fusers 200 in 12ms\n  ├─ orders: count=5\n  ├─ user: id=usr_123 plan=pro\n  ├─ route: \u002Fapi\u002Fusers\n  └─ requestId: 4a8ff3a8-...\n","Terminal output",[318,1234,1235,1246,1261,1274,1284],{"__ignoreMap":394},[398,1236,1237,1240,1243],{"class":400,"line":401},[398,1238,1239],{"class":404},"14:58:15",[398,1241,1242],{"class":407}," INFO",[398,1244,1245],{"class":479}," [my-worker] GET \u002Fapi\u002Fusers 200 in 12ms\n",[398,1247,1248,1251,1254,1257],{"class":400,"line":503},[398,1249,1250],{"class":404},"  ├─",[398,1252,1253],{"class":407}," orders:",[398,1255,1256],{"class":407}," count=",[398,1258,1260],{"class":1259},"sbssI","5\n",[398,1262,1263,1265,1268,1271],{"class":400,"line":510},[398,1264,1250],{"class":404},[398,1266,1267],{"class":407}," user:",[398,1269,1270],{"class":407}," id=usr_123",[398,1272,1273],{"class":407}," plan=pro\n",[398,1275,1276,1278,1281],{"class":400,"line":523},[398,1277,1250],{"class":404},[398,1279,1280],{"class":407}," route:",[398,1282,1283],{"class":407}," \u002Fapi\u002Fusers\n",[398,1285,1286,1289,1292],{"class":400,"line":551},[398,1287,1288],{"class":404},"  └─",[398,1290,1291],{"class":407}," requestId:",[398,1293,1294],{"class":407}," 4a8ff3a8-...\n",[376,1296,1298],{"id":1297},"error-handling","Error Handling",[314,1300,1301,1302,1305],{},"Use ",[318,1303,1304],{},"createError"," for structured errors and handle them with try\u002Fcatch:",[388,1307,1309],{"className":461,"code":1308,"filename":463,"language":464,"meta":394,"style":394},"import { createError, parseError } from 'evlog'\nimport { defineWorkerFetch, initWorkersLogger } from 'evlog\u002Fworkers'\n\ninitWorkersLogger({ env: { service: 'my-worker' } })\n\nexport default defineWorkerFetch(async (request, env, _ctx, log) => {\n  try {\n    const body = await request.json()\n    log.set({ payment: { amount: body.amount } })\n\n    if (body.amount \u003C= 0) {\n      throw createError({\n        status: 400,\n        message: 'Invalid payment amount',\n        why: 'The amount must be a positive number',\n        fix: 'Pass a positive integer in cents',\n      })\n    }\n\n    log.emit()\n    return Response.json({ success: true })\n  } catch (error) {\n    log.error(error instanceof Error ? error : new Error(String(error)))\n    log.emit()\n\n    const parsed = parseError(error)\n    return Response.json({\n      message: parsed.message,\n      why: parsed.why,\n      fix: parsed.fix,\n    }, { status: parsed.status })\n  }\n})\n",[318,1310,1311,1336,1358,1362,1392,1396,1430,1437,1458,1496,1500,1525,1536,1549,1565,1581,1597,1604,1609,1613,1623,1650,1668,1712,1723,1728,1746,1761,1778,1795,1812,1836,1842],{"__ignoreMap":394},[398,1312,1313,1315,1317,1320,1322,1325,1327,1329,1331,1334],{"class":400,"line":401},[398,1314,472],{"class":471},[398,1316,476],{"class":475},[398,1318,1319],{"class":479}," createError",[398,1321,483],{"class":475},[398,1323,1324],{"class":479}," parseError",[398,1326,489],{"class":475},[398,1328,492],{"class":471},[398,1330,495],{"class":475},[398,1332,1333],{"class":407},"evlog",[398,1335,500],{"class":475},[398,1337,1338,1340,1342,1344,1346,1348,1350,1352,1354,1356],{"class":400,"line":503},[398,1339,472],{"class":471},[398,1341,476],{"class":475},[398,1343,480],{"class":479},[398,1345,483],{"class":475},[398,1347,486],{"class":479},[398,1349,489],{"class":475},[398,1351,492],{"class":471},[398,1353,495],{"class":475},[398,1355,320],{"class":407},[398,1357,500],{"class":475},[398,1359,1360],{"class":400,"line":510},[398,1361,507],{"emptyLinePlaceholder":506},[398,1363,1364,1366,1368,1370,1372,1374,1376,1378,1380,1382,1384,1386,1388,1390],{"class":400,"line":523},[398,1365,514],{"class":513},[398,1367,517],{"class":479},[398,1369,627],{"class":475},[398,1371,884],{"class":526},[398,1373,530],{"class":475},[398,1375,476],{"class":475},[398,1377,535],{"class":526},[398,1379,530],{"class":475},[398,1381,495],{"class":475},[398,1383,542],{"class":407},[398,1385,545],{"class":475},[398,1387,489],{"class":475},[398,1389,489],{"class":475},[398,1391,557],{"class":479},[398,1393,1394],{"class":400,"line":551},[398,1395,507],{"emptyLinePlaceholder":506},[398,1397,1398,1400,1402,1404,1406,1408,1410,1412,1414,1416,1418,1420,1422,1424,1426,1428],{"class":400,"line":560},[398,1399,568],{"class":471},[398,1401,571],{"class":471},[398,1403,480],{"class":513},[398,1405,517],{"class":479},[398,1407,579],{"class":578},[398,1409,582],{"class":475},[398,1411,586],{"class":585},[398,1413,483],{"class":475},[398,1415,884],{"class":585},[398,1417,483],{"class":475},[398,1419,596],{"class":585},[398,1421,483],{"class":475},[398,1423,601],{"class":585},[398,1425,604],{"class":475},[398,1427,607],{"class":578},[398,1429,610],{"class":475},[398,1431,1432,1435],{"class":400,"line":565},[398,1433,1434],{"class":471},"  try",[398,1436,610],{"class":475},[398,1438,1439,1442,1445,1447,1449,1452,1454,1456],{"class":400,"line":613},[398,1440,1441],{"class":578},"    const",[398,1443,1444],{"class":479}," body",[398,1446,909],{"class":475},[398,1448,974],{"class":471},[398,1450,1451],{"class":479}," request",[398,1453,619],{"class":475},[398,1455,687],{"class":513},[398,1457,673],{"class":526},[398,1459,1460,1463,1465,1467,1469,1471,1474,1476,1478,1481,1483,1485,1487,1490,1492,1494],{"class":400,"line":646},[398,1461,1462],{"class":479},"    log",[398,1464,619],{"class":475},[398,1466,622],{"class":513},[398,1468,517],{"class":526},[398,1470,627],{"class":475},[398,1472,1473],{"class":526}," payment",[398,1475,530],{"class":475},[398,1477,476],{"class":475},[398,1479,1480],{"class":526}," amount",[398,1482,530],{"class":475},[398,1484,1444],{"class":479},[398,1486,619],{"class":475},[398,1488,1489],{"class":479},"amount",[398,1491,489],{"class":475},[398,1493,489],{"class":475},[398,1495,557],{"class":526},[398,1497,1498],{"class":400,"line":651},[398,1499,507],{"emptyLinePlaceholder":506},[398,1501,1502,1505,1507,1510,1512,1514,1517,1520,1523],{"class":400,"line":658},[398,1503,1504],{"class":471},"    if",[398,1506,582],{"class":526},[398,1508,1509],{"class":479},"body",[398,1511,619],{"class":475},[398,1513,1489],{"class":479},[398,1515,1516],{"class":475}," \u003C=",[398,1518,1519],{"class":1259}," 0",[398,1521,1522],{"class":526},") ",[398,1524,520],{"class":475},[398,1526,1527,1530,1532,1534],{"class":400,"line":663},[398,1528,1529],{"class":471},"      throw",[398,1531,1319],{"class":513},[398,1533,517],{"class":526},[398,1535,520],{"class":475},[398,1537,1538,1541,1543,1546],{"class":400,"line":676},[398,1539,1540],{"class":526},"        status",[398,1542,530],{"class":475},[398,1544,1545],{"class":1259}," 400",[398,1547,1548],{"class":475},",\n",[398,1550,1551,1554,1556,1558,1561,1563],{"class":400,"line":707},[398,1552,1553],{"class":526},"        message",[398,1555,530],{"class":475},[398,1557,495],{"class":475},[398,1559,1560],{"class":407},"Invalid payment amount",[398,1562,545],{"class":475},[398,1564,1548],{"class":475},[398,1566,1567,1570,1572,1574,1577,1579],{"class":400,"line":1092},[398,1568,1569],{"class":526},"        why",[398,1571,530],{"class":475},[398,1573,495],{"class":475},[398,1575,1576],{"class":407},"The amount must be a positive number",[398,1578,545],{"class":475},[398,1580,1548],{"class":475},[398,1582,1583,1586,1588,1590,1593,1595],{"class":400,"line":1146},[398,1584,1585],{"class":526},"        fix",[398,1587,530],{"class":475},[398,1589,495],{"class":475},[398,1591,1592],{"class":407},"Pass a positive integer in cents",[398,1594,545],{"class":475},[398,1596,1548],{"class":475},[398,1598,1599,1602],{"class":400,"line":1183},[398,1600,1601],{"class":475},"      }",[398,1603,557],{"class":526},[398,1605,1606],{"class":400,"line":1188},[398,1607,1608],{"class":475},"    }\n",[398,1610,1611],{"class":400,"line":1199},[398,1612,507],{"emptyLinePlaceholder":506},[398,1614,1615,1617,1619,1621],{"class":400,"line":1224},[398,1616,1462],{"class":479},[398,1618,619],{"class":475},[398,1620,670],{"class":513},[398,1622,673],{"class":526},[398,1624,1626,1629,1631,1633,1635,1637,1639,1642,1644,1646,1648],{"class":400,"line":1625},21,[398,1627,1628],{"class":471},"    return",[398,1630,682],{"class":479},[398,1632,619],{"class":475},[398,1634,687],{"class":513},[398,1636,517],{"class":526},[398,1638,627],{"class":475},[398,1640,1641],{"class":526}," success",[398,1643,530],{"class":475},[398,1645,700],{"class":699},[398,1647,489],{"class":475},[398,1649,557],{"class":526},[398,1651,1653,1656,1659,1661,1664,1666],{"class":400,"line":1652},22,[398,1654,1655],{"class":475},"  }",[398,1657,1658],{"class":471}," catch",[398,1660,582],{"class":526},[398,1662,1663],{"class":479},"error",[398,1665,1522],{"class":526},[398,1667,520],{"class":475},[398,1669,1671,1673,1675,1677,1679,1681,1684,1687,1690,1693,1696,1698,1700,1702,1705,1707,1709],{"class":400,"line":1670},23,[398,1672,1462],{"class":479},[398,1674,619],{"class":475},[398,1676,1663],{"class":513},[398,1678,517],{"class":526},[398,1680,1663],{"class":479},[398,1682,1683],{"class":475}," instanceof",[398,1685,1686],{"class":404}," Error",[398,1688,1689],{"class":475}," ?",[398,1691,1692],{"class":479}," error",[398,1694,1695],{"class":475}," :",[398,1697,912],{"class":475},[398,1699,1686],{"class":513},[398,1701,517],{"class":526},[398,1703,1704],{"class":513},"String",[398,1706,517],{"class":526},[398,1708,1663],{"class":479},[398,1710,1711],{"class":526},")))\n",[398,1713,1715,1717,1719,1721],{"class":400,"line":1714},24,[398,1716,1462],{"class":479},[398,1718,619],{"class":475},[398,1720,670],{"class":513},[398,1722,673],{"class":526},[398,1724,1726],{"class":400,"line":1725},25,[398,1727,507],{"emptyLinePlaceholder":506},[398,1729,1731,1733,1736,1738,1740,1742,1744],{"class":400,"line":1730},26,[398,1732,1441],{"class":578},[398,1734,1735],{"class":479}," parsed",[398,1737,909],{"class":475},[398,1739,1324],{"class":513},[398,1741,517],{"class":526},[398,1743,1663],{"class":479},[398,1745,557],{"class":526},[398,1747,1749,1751,1753,1755,1757,1759],{"class":400,"line":1748},27,[398,1750,1628],{"class":471},[398,1752,682],{"class":479},[398,1754,619],{"class":475},[398,1756,687],{"class":513},[398,1758,517],{"class":526},[398,1760,520],{"class":475},[398,1762,1764,1767,1769,1771,1773,1776],{"class":400,"line":1763},28,[398,1765,1766],{"class":526},"      message",[398,1768,530],{"class":475},[398,1770,1735],{"class":479},[398,1772,619],{"class":475},[398,1774,1775],{"class":479},"message",[398,1777,1548],{"class":475},[398,1779,1781,1784,1786,1788,1790,1793],{"class":400,"line":1780},29,[398,1782,1783],{"class":526},"      why",[398,1785,530],{"class":475},[398,1787,1735],{"class":479},[398,1789,619],{"class":475},[398,1791,1792],{"class":479},"why",[398,1794,1548],{"class":475},[398,1796,1798,1801,1803,1805,1807,1810],{"class":400,"line":1797},30,[398,1799,1800],{"class":526},"      fix",[398,1802,530],{"class":475},[398,1804,1735],{"class":479},[398,1806,619],{"class":475},[398,1808,1809],{"class":479},"fix",[398,1811,1548],{"class":475},[398,1813,1815,1818,1820,1823,1825,1827,1829,1832,1834],{"class":400,"line":1814},31,[398,1816,1817],{"class":475},"    },",[398,1819,476],{"class":475},[398,1821,1822],{"class":526}," status",[398,1824,530],{"class":475},[398,1826,1735],{"class":479},[398,1828,619],{"class":475},[398,1830,1831],{"class":479},"status",[398,1833,489],{"class":475},[398,1835,557],{"class":526},[398,1837,1839],{"class":400,"line":1838},32,[398,1840,1841],{"class":475},"  }\n",[398,1843,1845,1847],{"class":400,"line":1844},33,[398,1846,554],{"class":475},[398,1848,557],{"class":479},[376,1850,91],{"id":1851},"configuration",[314,1853,1854,1855,1858,1859,1862],{},"See the ",[365,1856,1857],{"href":92},"Configuration reference"," for all available options (",[318,1860,1861],{},"initLogger",", middleware options, sampling, silent mode, etc.).",[376,1864,1866],{"id":1865},"drain-enrichers","Drain & Enrichers",[314,1868,1869,1870,1872],{},"Configure drain and enrichers via ",[318,1871,514],{}," options:",[388,1874,1876],{"className":461,"code":1875,"filename":463,"language":464,"meta":394,"style":394},"import { initWorkersLogger, createWorkersLogger } from 'evlog\u002Fworkers'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createUserAgentEnricher } from 'evlog\u002Fenrichers'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport type { DrainContext } from 'evlog'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({\n  batch: { size: 50, intervalMs: 5000 },\n})\nconst drain = pipeline(createAxiomDrain())\nconst userAgent = createUserAgentEnricher()\n\ninitWorkersLogger({\n  env: { service: 'my-worker' },\n  drain,\n  enrich: (ctx) => {\n    userAgent(ctx)\n  },\n})\n",[318,1877,1878,1901,1921,1941,1961,1983,1987,2013,2042,2048,2068,2081,2085,2093,2113,2120,2138,2149,2154],{"__ignoreMap":394},[398,1879,1880,1882,1884,1886,1888,1891,1893,1895,1897,1899],{"class":400,"line":401},[398,1881,472],{"class":471},[398,1883,476],{"class":475},[398,1885,486],{"class":479},[398,1887,483],{"class":475},[398,1889,1890],{"class":479}," createWorkersLogger",[398,1892,489],{"class":475},[398,1894,492],{"class":471},[398,1896,495],{"class":475},[398,1898,320],{"class":407},[398,1900,500],{"class":475},[398,1902,1903,1905,1907,1910,1912,1914,1916,1919],{"class":400,"line":503},[398,1904,472],{"class":471},[398,1906,476],{"class":475},[398,1908,1909],{"class":479}," createAxiomDrain",[398,1911,489],{"class":475},[398,1913,492],{"class":471},[398,1915,495],{"class":475},[398,1917,1918],{"class":407},"evlog\u002Faxiom",[398,1920,500],{"class":475},[398,1922,1923,1925,1927,1930,1932,1934,1936,1939],{"class":400,"line":510},[398,1924,472],{"class":471},[398,1926,476],{"class":475},[398,1928,1929],{"class":479}," createUserAgentEnricher",[398,1931,489],{"class":475},[398,1933,492],{"class":471},[398,1935,495],{"class":475},[398,1937,1938],{"class":407},"evlog\u002Fenrichers",[398,1940,500],{"class":475},[398,1942,1943,1945,1947,1950,1952,1954,1956,1959],{"class":400,"line":523},[398,1944,472],{"class":471},[398,1946,476],{"class":475},[398,1948,1949],{"class":479}," createDrainPipeline",[398,1951,489],{"class":475},[398,1953,492],{"class":471},[398,1955,495],{"class":475},[398,1957,1958],{"class":407},"evlog\u002Fpipeline",[398,1960,500],{"class":475},[398,1962,1963,1965,1968,1970,1973,1975,1977,1979,1981],{"class":400,"line":551},[398,1964,472],{"class":471},[398,1966,1967],{"class":471}," type",[398,1969,476],{"class":475},[398,1971,1972],{"class":479}," DrainContext",[398,1974,489],{"class":475},[398,1976,492],{"class":471},[398,1978,495],{"class":475},[398,1980,1333],{"class":407},[398,1982,500],{"class":475},[398,1984,1985],{"class":400,"line":560},[398,1986,507],{"emptyLinePlaceholder":506},[398,1988,1989,1992,1995,1998,2000,2003,2006,2009,2011],{"class":400,"line":565},[398,1990,1991],{"class":578},"const",[398,1993,1994],{"class":479}," pipeline ",[398,1996,1997],{"class":475},"=",[398,1999,1949],{"class":513},[398,2001,2002],{"class":475},"\u003C",[398,2004,2005],{"class":404},"DrainContext",[398,2007,2008],{"class":475},">",[398,2010,517],{"class":479},[398,2012,520],{"class":475},[398,2014,2015,2018,2020,2022,2025,2027,2030,2032,2035,2037,2040],{"class":400,"line":613},[398,2016,2017],{"class":526},"  batch",[398,2019,530],{"class":475},[398,2021,476],{"class":475},[398,2023,2024],{"class":526}," size",[398,2026,530],{"class":475},[398,2028,2029],{"class":1259}," 50",[398,2031,483],{"class":475},[398,2033,2034],{"class":526}," intervalMs",[398,2036,530],{"class":475},[398,2038,2039],{"class":1259}," 5000",[398,2041,548],{"class":475},[398,2043,2044,2046],{"class":400,"line":646},[398,2045,554],{"class":475},[398,2047,557],{"class":479},[398,2049,2050,2052,2055,2057,2060,2062,2065],{"class":400,"line":651},[398,2051,1991],{"class":578},[398,2053,2054],{"class":479}," drain ",[398,2056,1997],{"class":475},[398,2058,2059],{"class":513}," pipeline",[398,2061,517],{"class":479},[398,2063,2064],{"class":513},"createAxiomDrain",[398,2066,2067],{"class":479},"())\n",[398,2069,2070,2072,2075,2077,2079],{"class":400,"line":658},[398,2071,1991],{"class":578},[398,2073,2074],{"class":479}," userAgent ",[398,2076,1997],{"class":475},[398,2078,1929],{"class":513},[398,2080,673],{"class":479},[398,2082,2083],{"class":400,"line":663},[398,2084,507],{"emptyLinePlaceholder":506},[398,2086,2087,2089,2091],{"class":400,"line":676},[398,2088,514],{"class":513},[398,2090,517],{"class":479},[398,2092,520],{"class":475},[398,2094,2095,2097,2099,2101,2103,2105,2107,2109,2111],{"class":400,"line":707},[398,2096,527],{"class":526},[398,2098,530],{"class":475},[398,2100,476],{"class":475},[398,2102,535],{"class":526},[398,2104,530],{"class":475},[398,2106,495],{"class":475},[398,2108,542],{"class":407},[398,2110,545],{"class":475},[398,2112,548],{"class":475},[398,2114,2115,2118],{"class":400,"line":1092},[398,2116,2117],{"class":479},"  drain",[398,2119,1548],{"class":475},[398,2121,2122,2125,2127,2129,2132,2134,2136],{"class":400,"line":1146},[398,2123,2124],{"class":513},"  enrich",[398,2126,530],{"class":475},[398,2128,582],{"class":475},[398,2130,2131],{"class":585},"ctx",[398,2133,604],{"class":475},[398,2135,607],{"class":578},[398,2137,610],{"class":475},[398,2139,2140,2143,2145,2147],{"class":400,"line":1183},[398,2141,2142],{"class":513},"    userAgent",[398,2144,517],{"class":526},[398,2146,2131],{"class":479},[398,2148,557],{"class":526},[398,2150,2151],{"class":400,"line":1188},[398,2152,2153],{"class":475},"  },\n",[398,2155,2156,2158],{"class":400,"line":1199},[398,2157,554],{"class":475},[398,2159,557],{"class":479},[761,2161,1854,2162,2165,2166,2168],{"color":763,"icon":13},[365,2163,213],{"href":2164},"\u002Fadapters\u002Foverview"," and ",[365,2167,293],{"href":298}," docs for all available drain adapters and enrichers.",[376,2170,2172],{"id":2171},"wrangler-configuration","Wrangler Configuration",[314,2174,2175],{},"Disable Cloudflare's default invocation logs to avoid duplicates when using evlog:",[388,2177,2182],{"className":2178,"code":2179,"filename":2180,"language":2181,"meta":394,"style":394},"language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[observability]\nenabled = false\n","wrangler.toml","toml",[318,2183,2184,2195],{"__ignoreMap":394},[398,2185,2186,2189,2192],{"class":400,"line":401},[398,2187,2188],{"class":475},"[",[398,2190,2191],{"class":404},"observability",[398,2193,2194],{"class":475},"]\n",[398,2196,2197,2200,2202],{"class":400,"line":503},[398,2198,2199],{"class":479},"enabled ",[398,2201,1997],{"class":475},[398,2203,2204],{"class":699}," false\n",[376,2206,2208],{"id":2207},"run-locally","Run Locally",[388,2210,2213],{"className":390,"code":2211,"filename":2212,"language":393,"meta":394,"style":394},"wrangler dev\n","Terminal",[318,2214,2215],{"__ignoreMap":394},[398,2216,2217,2220],{"class":400,"line":401},[398,2218,2219],{"class":404},"wrangler",[398,2221,2222],{"class":407}," dev\n",[376,2224,2226],{"id":2225},"next-steps","Next Steps",[335,2228,2229,2234,2239,2244],{},[338,2230,2231,2233],{},[365,2232,51],{"href":52},": Design comprehensive events with context layering",[338,2235,2236,2238],{},[365,2237,213],{"href":2164},": Send logs to Axiom, Sentry, PostHog, and more",[338,2240,2241,2243],{},[365,2242,96],{"href":97},": Control log volume with head and tail sampling",[338,2245,2246,2248,2249,751,2251,755,2253,2256],{},[365,2247,56],{"href":57},": Throw errors with ",[318,2250,1792],{},[318,2252,1809],{},[318,2254,2255],{},"link"," fields",[2258,2259,2260],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":394,"searchDepth":503,"depth":503,"links":2262},[2263,2267,2268,2269,2270,2271,2272,2273],{"id":378,"depth":503,"text":20,"children":2264},[2265,2266],{"id":382,"depth":510,"text":383},{"id":457,"depth":510,"text":458},{"id":791,"depth":503,"text":51},{"id":1297,"depth":503,"text":1298},{"id":1851,"depth":503,"text":91},{"id":1865,"depth":503,"text":1866},{"id":2171,"depth":503,"text":2172},{"id":2207,"depth":503,"text":2208},{"id":2225,"depth":503,"text":2226},"Wide events, structured errors, and logging in Cloudflare Workers and Durable Objects.","md",null,{},{"title":189,"icon":192},{"title":189,"description":2274},"ZXs1yKjKKzQ80CGPR6TwDh4NwsfkH3rPw22EB1gcgm8",[2282,2284],{"title":184,"path":185,"stem":186,"description":2283,"icon":187,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in React Router applications.",{"title":194,"path":195,"stem":196,"description":2285,"icon":104,"children":-1},"Use evlog in standalone TypeScript scripts, CLI tools, queues, cron jobs, and any TypeScript process.",1777667166768]