[{"data":1,"prerenderedAt":3396},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-tanstack-start":308,"-frameworks-tanstack-start-surround":3391},[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":154,"body":310,"description":3381,"extension":3382,"links":3383,"meta":3387,"navigation":3388,"path":155,"seo":3389,"stem":156,"__hash__":3390},"docs\u002F4.frameworks\u002F05.tanstack-start.md",{"type":311,"value":312,"toc":3361},"minimark",[313,327,342,385,389,396,401,472,479,493,679,690,694,717,857,860,879,882,896,1260,1263,1334,1343,1347,1361,1893,1896,1972,1976,1982,2220,2223,2234,2238,2249,2491,2495,2502,2625,2800,2808,2812,2819,3058,3069,3073,3080,3254,3258,3300,3308,3318,3322,3328,3357],[314,315,316,317,321,322,326],"p",{},"TanStack Start uses ",[318,319,320],"a",{"href":150},"Nitro v3"," as its server layer, so evlog integrates via the ",[323,324,325],"code",{},"evlog\u002Fnitro\u002Fv3"," module. The same plugin-based hooks system applies.",[328,329,331,335,336,338,339,341],"callout",{"color":330,"icon":13},"info",[332,333,334],"strong",{},"TanStack Router vs TanStack Start",": TanStack Router is a client-side router and doesn't need server-side logging. This page covers ",[332,337,154],{},", the full-stack framework. If you're using TanStack Router in SPA mode, see ",[318,340,61],{"href":62}," instead.",[343,344,347,350,372],"prompt",{":actions":345,"description":346,"icon":157},"[\"copy\",\"cursor\",\"windsurf\"]","Set up evlog in my TanStack Start app",[314,348,349],{},"Set up evlog in my TanStack Start app.",[351,352,353,357,360,363,366,369],"ul",{},[354,355,356],"li",{},"Install evlog: pnpm add evlog",[354,358,359],{},"Create nitro.config.ts with evlog\u002Fnitro\u002Fv3 module and experimental.asyncContext enabled",[354,361,362],{},"Configure env.service with your app name",[354,364,365],{},"Add evlogErrorHandler middleware to the root route for structured error responses",[354,367,368],{},"Access the logger via useRequest().context.log in route handlers",[354,370,371],{},"Use log.set() to accumulate context, throw createError() for structured errors",[314,373,374,375,380,381],{},"Docs: ",[318,376,377],{"href":377,"rel":378},"https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Ftanstack-start",[379],"nofollow","\nAdapters: ",[318,382,383],{"href":383,"rel":384},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters",[379],[386,387,20],"h2",{"id":388},"quick-start",[314,390,391,392,395],{},"Starting from a TanStack Start project created with ",[323,393,394],{},"npm create @tanstack\u002Fstart@latest",":",[397,398,400],"h3",{"id":399},"_1-install","1. Install",[402,403,404,429,443,457],"code-group",{},[405,406,412],"pre",{"className":407,"code":408,"filename":409,"language":410,"meta":411,"style":411},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add evlog\n","pnpm","bash","",[323,413,414],{"__ignoreMap":411},[415,416,419,422,426],"span",{"class":417,"line":418},"line",1,[415,420,409],{"class":421},"sBMFI",[415,423,425],{"class":424},"sfazB"," add",[415,427,428],{"class":424}," evlog\n",[405,430,433],{"className":407,"code":431,"filename":432,"language":410,"meta":411,"style":411},"bun add evlog\n","bun",[323,434,435],{"__ignoreMap":411},[415,436,437,439,441],{"class":417,"line":418},[415,438,432],{"class":421},[415,440,425],{"class":424},[415,442,428],{"class":424},[405,444,447],{"className":407,"code":445,"filename":446,"language":410,"meta":411,"style":411},"yarn add evlog\n","yarn",[323,448,449],{"__ignoreMap":411},[415,450,451,453,455],{"class":417,"line":418},[415,452,446],{"class":421},[415,454,425],{"class":424},[415,456,428],{"class":424},[405,458,461],{"className":407,"code":459,"filename":460,"language":410,"meta":411,"style":411},"npm install evlog\n","npm",[323,462,463],{"__ignoreMap":411},[415,464,465,467,470],{"class":417,"line":418},[415,466,460],{"class":421},[415,468,469],{"class":424}," install",[415,471,428],{"class":424},[397,473,475,476],{"id":474},"_2-add-nitroconfigts","2. Add ",[323,477,478],{},"nitro.config.ts",[314,480,481,482,484,485,488,489,492],{},"Create a ",[323,483,478],{}," at the project root to register the evlog module. Your ",[323,486,487],{},"vite.config.ts"," already has the ",[323,490,491],{},"nitro()"," plugin from the CLI, so no changes are needed there.",[405,494,498],{"className":495,"code":496,"filename":478,"language":497,"meta":411,"style":411},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineConfig } from 'nitro'\nimport evlog from 'evlog\u002Fnitro\u002Fv3'\n\nexport default defineConfig({\n  experimental: {\n    asyncContext: true,\n  },\n  modules: [\n    evlog({\n      env: { service: 'my-app' },\n    }),\n  ],\n})\n","typescript",[323,499,500,529,546,553,571,583,598,604,615,625,651,662,670],{"__ignoreMap":411},[415,501,502,506,510,514,517,520,523,526],{"class":417,"line":418},[415,503,505],{"class":504},"s7zQu","import",[415,507,509],{"class":508},"sMK4o"," {",[415,511,513],{"class":512},"sTEyZ"," defineConfig",[415,515,516],{"class":508}," }",[415,518,519],{"class":504}," from",[415,521,522],{"class":508}," '",[415,524,525],{"class":424},"nitro",[415,527,528],{"class":508},"'\n",[415,530,532,534,537,540,542,544],{"class":417,"line":531},2,[415,533,505],{"class":504},[415,535,536],{"class":512}," evlog ",[415,538,539],{"class":504},"from",[415,541,522],{"class":508},[415,543,325],{"class":424},[415,545,528],{"class":508},[415,547,549],{"class":417,"line":548},3,[415,550,552],{"emptyLinePlaceholder":551},true,"\n",[415,554,556,559,562,565,568],{"class":417,"line":555},4,[415,557,558],{"class":504},"export",[415,560,561],{"class":504}," default",[415,563,513],{"class":564},"s2Zo4",[415,566,567],{"class":512},"(",[415,569,570],{"class":508},"{\n",[415,572,574,578,580],{"class":417,"line":573},5,[415,575,577],{"class":576},"swJcz","  experimental",[415,579,395],{"class":508},[415,581,582],{"class":508}," {\n",[415,584,586,589,591,595],{"class":417,"line":585},6,[415,587,588],{"class":576},"    asyncContext",[415,590,395],{"class":508},[415,592,594],{"class":593},"sfNiH"," true",[415,596,597],{"class":508},",\n",[415,599,601],{"class":417,"line":600},7,[415,602,603],{"class":508},"  },\n",[415,605,607,610,612],{"class":417,"line":606},8,[415,608,609],{"class":576},"  modules",[415,611,395],{"class":508},[415,613,614],{"class":512}," [\n",[415,616,618,621,623],{"class":417,"line":617},9,[415,619,620],{"class":564},"    evlog",[415,622,567],{"class":512},[415,624,570],{"class":508},[415,626,628,631,633,635,638,640,642,645,648],{"class":417,"line":627},10,[415,629,630],{"class":576},"      env",[415,632,395],{"class":508},[415,634,509],{"class":508},[415,636,637],{"class":576}," service",[415,639,395],{"class":508},[415,641,522],{"class":508},[415,643,644],{"class":424},"my-app",[415,646,647],{"class":508},"'",[415,649,650],{"class":508}," },\n",[415,652,654,657,660],{"class":417,"line":653},11,[415,655,656],{"class":508},"    }",[415,658,659],{"class":512},")",[415,661,597],{"class":508},[415,663,665,668],{"class":417,"line":664},12,[415,666,667],{"class":512},"  ]",[415,669,597],{"class":508},[415,671,673,676],{"class":417,"line":672},13,[415,674,675],{"class":508},"}",[415,677,678],{"class":512},")\n",[314,680,681,682,685,686,689],{},"Enabling ",[323,683,684],{},"asyncContext"," lets you access the request-scoped logger from anywhere in the call stack via ",[323,687,688],{},"useRequest()",".",[397,691,693],{"id":692},"_3-error-handling-middleware","3. Error handling middleware",[314,695,696,697,700,701,704,705,708,709,712,713,716],{},"TanStack Start has its own error handling layer that runs before Nitro's. To ensure ",[323,698,699],{},"throw createError()"," returns a proper JSON response with ",[323,702,703],{},"why",", ",[323,706,707],{},"fix",", and ",[323,710,711],{},"link",", add the ",[323,714,715],{},"evlogErrorHandler"," middleware to your root route:",[405,718,721],{"className":495,"code":719,"filename":720,"language":497,"meta":411,"style":411},"import { createRootRoute } from '@tanstack\u002Freact-router'\nimport { createMiddleware } from '@tanstack\u002Freact-start'\nimport { evlogErrorHandler } from 'evlog\u002Fnitro\u002Fv3'\n\nexport const Route = createRootRoute({\n  server: {\n    middleware: [createMiddleware().server(evlogErrorHandler)],\n  },\n  \u002F\u002F ... head, shellComponent, etc.\n})\n","src\u002Froutes\u002F__root.tsx",[323,722,723,743,763,782,786,806,815,841,845,851],{"__ignoreMap":411},[415,724,725,727,729,732,734,736,738,741],{"class":417,"line":418},[415,726,505],{"class":504},[415,728,509],{"class":508},[415,730,731],{"class":512}," createRootRoute",[415,733,516],{"class":508},[415,735,519],{"class":504},[415,737,522],{"class":508},[415,739,740],{"class":424},"@tanstack\u002Freact-router",[415,742,528],{"class":508},[415,744,745,747,749,752,754,756,758,761],{"class":417,"line":531},[415,746,505],{"class":504},[415,748,509],{"class":508},[415,750,751],{"class":512}," createMiddleware",[415,753,516],{"class":508},[415,755,519],{"class":504},[415,757,522],{"class":508},[415,759,760],{"class":424},"@tanstack\u002Freact-start",[415,762,528],{"class":508},[415,764,765,767,769,772,774,776,778,780],{"class":417,"line":548},[415,766,505],{"class":504},[415,768,509],{"class":508},[415,770,771],{"class":512}," evlogErrorHandler",[415,773,516],{"class":508},[415,775,519],{"class":504},[415,777,522],{"class":508},[415,779,325],{"class":424},[415,781,528],{"class":508},[415,783,784],{"class":417,"line":555},[415,785,552],{"emptyLinePlaceholder":551},[415,787,788,790,794,797,800,802,804],{"class":417,"line":573},[415,789,558],{"class":504},[415,791,793],{"class":792},"spNyl"," const",[415,795,796],{"class":512}," Route ",[415,798,799],{"class":508},"=",[415,801,731],{"class":564},[415,803,567],{"class":512},[415,805,570],{"class":508},[415,807,808,811,813],{"class":417,"line":585},[415,809,810],{"class":576},"  server",[415,812,395],{"class":508},[415,814,582],{"class":508},[415,816,817,820,822,825,828,831,833,836,839],{"class":417,"line":600},[415,818,819],{"class":576},"    middleware",[415,821,395],{"class":508},[415,823,824],{"class":512}," [",[415,826,827],{"class":564},"createMiddleware",[415,829,830],{"class":512},"()",[415,832,689],{"class":508},[415,834,835],{"class":564},"server",[415,837,838],{"class":512},"(evlogErrorHandler)]",[415,840,597],{"class":508},[415,842,843],{"class":417,"line":606},[415,844,603],{"class":508},[415,846,847],{"class":417,"line":617},[415,848,850],{"class":849},"sHwdD","  \u002F\u002F ... head, shellComponent, etc.\n",[415,852,853,855],{"class":417,"line":627},[415,854,675],{"class":508},[415,856,678],{"class":512},[314,858,859],{},"That's it. evlog automatically captures every request as a wide event with method, path, status, and duration.",[328,861,862,865,866,871,872,875,876,878],{"color":330,"icon":118},[332,863,864],{},"Using Vite?"," TanStack Start is Vite-based. The ",[318,867,868],{"href":116},[323,869,870],{},"evlog\u002Fvite"," plugin strips ",[323,873,874],{},"log.debug()"," from production builds and injects source locations, add it to your ",[323,877,487],{}," alongside the TanStack Start plugin.",[386,880,51],{"id":881},"wide-events",[314,883,884,885,888,889,891,892,895],{},"With ",[323,886,887],{},"experimental.asyncContext: true",", use ",[323,890,688],{}," from ",[323,893,894],{},"nitro\u002Fcontext"," to access the request-scoped logger and build up context progressively:",[405,897,900],{"className":495,"code":898,"filename":899,"language":497,"meta":411,"style":411},"import { createFileRoute } from '@tanstack\u002Freact-router'\nimport { useRequest } from 'nitro\u002Fcontext'\nimport type { RequestLogger } from 'evlog'\n\nexport const Route = createFileRoute('\u002Fapi\u002Fhello')({\n  server: {\n    handlers: {\n      GET: async () => {\n        const req = useRequest()\n        const log = req.context.log as RequestLogger\n\n        log.set({ user: { id: 'user_123', plan: 'pro' } })\n        log.set({ action: 'fetch_profile' })\n        log.set({ cache: { hit: true, ttl: 3600 } })\n\n        return Response.json({ ok: true })\n      },\n    },\n  },\n})\n","src\u002Froutes\u002Fapi\u002Fhello.ts",[323,901,902,921,940,963,967,993,1001,1010,1028,1044,1071,1075,1130,1158,1202,1207,1236,1242,1248,1253],{"__ignoreMap":411},[415,903,904,906,908,911,913,915,917,919],{"class":417,"line":418},[415,905,505],{"class":504},[415,907,509],{"class":508},[415,909,910],{"class":512}," createFileRoute",[415,912,516],{"class":508},[415,914,519],{"class":504},[415,916,522],{"class":508},[415,918,740],{"class":424},[415,920,528],{"class":508},[415,922,923,925,927,930,932,934,936,938],{"class":417,"line":531},[415,924,505],{"class":504},[415,926,509],{"class":508},[415,928,929],{"class":512}," useRequest",[415,931,516],{"class":508},[415,933,519],{"class":504},[415,935,522],{"class":508},[415,937,894],{"class":424},[415,939,528],{"class":508},[415,941,942,944,947,949,952,954,956,958,961],{"class":417,"line":548},[415,943,505],{"class":504},[415,945,946],{"class":504}," type",[415,948,509],{"class":508},[415,950,951],{"class":512}," RequestLogger",[415,953,516],{"class":508},[415,955,519],{"class":504},[415,957,522],{"class":508},[415,959,960],{"class":424},"evlog",[415,962,528],{"class":508},[415,964,965],{"class":417,"line":555},[415,966,552],{"emptyLinePlaceholder":551},[415,968,969,971,973,975,977,979,981,983,986,988,991],{"class":417,"line":573},[415,970,558],{"class":504},[415,972,793],{"class":792},[415,974,796],{"class":512},[415,976,799],{"class":508},[415,978,910],{"class":564},[415,980,567],{"class":512},[415,982,647],{"class":508},[415,984,985],{"class":424},"\u002Fapi\u002Fhello",[415,987,647],{"class":508},[415,989,990],{"class":512},")(",[415,992,570],{"class":508},[415,994,995,997,999],{"class":417,"line":585},[415,996,810],{"class":576},[415,998,395],{"class":508},[415,1000,582],{"class":508},[415,1002,1003,1006,1008],{"class":417,"line":600},[415,1004,1005],{"class":576},"    handlers",[415,1007,395],{"class":508},[415,1009,582],{"class":508},[415,1011,1012,1015,1017,1020,1023,1026],{"class":417,"line":606},[415,1013,1014],{"class":564},"      GET",[415,1016,395],{"class":508},[415,1018,1019],{"class":792}," async",[415,1021,1022],{"class":508}," ()",[415,1024,1025],{"class":792}," =>",[415,1027,582],{"class":508},[415,1029,1030,1033,1036,1039,1041],{"class":417,"line":617},[415,1031,1032],{"class":792},"        const",[415,1034,1035],{"class":512}," req",[415,1037,1038],{"class":508}," =",[415,1040,929],{"class":564},[415,1042,1043],{"class":576},"()\n",[415,1045,1046,1048,1051,1053,1055,1057,1060,1062,1065,1068],{"class":417,"line":627},[415,1047,1032],{"class":792},[415,1049,1050],{"class":512}," log",[415,1052,1038],{"class":508},[415,1054,1035],{"class":512},[415,1056,689],{"class":508},[415,1058,1059],{"class":512},"context",[415,1061,689],{"class":508},[415,1063,1064],{"class":512},"log",[415,1066,1067],{"class":504}," as",[415,1069,1070],{"class":421}," RequestLogger\n",[415,1072,1073],{"class":417,"line":653},[415,1074,552],{"emptyLinePlaceholder":551},[415,1076,1077,1080,1082,1085,1087,1090,1093,1095,1097,1100,1102,1104,1107,1109,1112,1115,1117,1119,1122,1124,1126,1128],{"class":417,"line":664},[415,1078,1079],{"class":512},"        log",[415,1081,689],{"class":508},[415,1083,1084],{"class":564},"set",[415,1086,567],{"class":576},[415,1088,1089],{"class":508},"{",[415,1091,1092],{"class":576}," user",[415,1094,395],{"class":508},[415,1096,509],{"class":508},[415,1098,1099],{"class":576}," id",[415,1101,395],{"class":508},[415,1103,522],{"class":508},[415,1105,1106],{"class":424},"user_123",[415,1108,647],{"class":508},[415,1110,1111],{"class":508},",",[415,1113,1114],{"class":576}," plan",[415,1116,395],{"class":508},[415,1118,522],{"class":508},[415,1120,1121],{"class":424},"pro",[415,1123,647],{"class":508},[415,1125,516],{"class":508},[415,1127,516],{"class":508},[415,1129,678],{"class":576},[415,1131,1132,1134,1136,1138,1140,1142,1145,1147,1149,1152,1154,1156],{"class":417,"line":672},[415,1133,1079],{"class":512},[415,1135,689],{"class":508},[415,1137,1084],{"class":564},[415,1139,567],{"class":576},[415,1141,1089],{"class":508},[415,1143,1144],{"class":576}," action",[415,1146,395],{"class":508},[415,1148,522],{"class":508},[415,1150,1151],{"class":424},"fetch_profile",[415,1153,647],{"class":508},[415,1155,516],{"class":508},[415,1157,678],{"class":576},[415,1159,1161,1163,1165,1167,1169,1171,1174,1176,1178,1181,1183,1185,1187,1190,1192,1196,1198,1200],{"class":417,"line":1160},14,[415,1162,1079],{"class":512},[415,1164,689],{"class":508},[415,1166,1084],{"class":564},[415,1168,567],{"class":576},[415,1170,1089],{"class":508},[415,1172,1173],{"class":576}," cache",[415,1175,395],{"class":508},[415,1177,509],{"class":508},[415,1179,1180],{"class":576}," hit",[415,1182,395],{"class":508},[415,1184,594],{"class":593},[415,1186,1111],{"class":508},[415,1188,1189],{"class":576}," ttl",[415,1191,395],{"class":508},[415,1193,1195],{"class":1194},"sbssI"," 3600",[415,1197,516],{"class":508},[415,1199,516],{"class":508},[415,1201,678],{"class":576},[415,1203,1205],{"class":417,"line":1204},15,[415,1206,552],{"emptyLinePlaceholder":551},[415,1208,1210,1213,1216,1218,1221,1223,1225,1228,1230,1232,1234],{"class":417,"line":1209},16,[415,1211,1212],{"class":504},"        return",[415,1214,1215],{"class":512}," Response",[415,1217,689],{"class":508},[415,1219,1220],{"class":564},"json",[415,1222,567],{"class":576},[415,1224,1089],{"class":508},[415,1226,1227],{"class":576}," ok",[415,1229,395],{"class":508},[415,1231,594],{"class":593},[415,1233,516],{"class":508},[415,1235,678],{"class":576},[415,1237,1239],{"class":417,"line":1238},17,[415,1240,1241],{"class":508},"      },\n",[415,1243,1245],{"class":417,"line":1244},18,[415,1246,1247],{"class":508},"    },\n",[415,1249,1251],{"class":417,"line":1250},19,[415,1252,603],{"class":508},[415,1254,1256,1258],{"class":417,"line":1255},20,[415,1257,675],{"class":508},[415,1259,678],{"class":512},[314,1261,1262],{},"All fields are merged into a single wide event emitted when the request completes:",[405,1264,1267],{"className":407,"code":1265,"filename":1266,"language":410,"meta":411,"style":411},"14:58:15 INFO [my-app] GET \u002Fapi\u002Fhello 200 in 52ms\n  ├─ cache: hit=true ttl=3600\n  ├─ action: fetch_profile\n  ├─ user: id=user_123 plan=pro\n  └─ requestId: 4a8ff3a8-...\n","Terminal output",[323,1268,1269,1280,1300,1310,1323],{"__ignoreMap":411},[415,1270,1271,1274,1277],{"class":417,"line":418},[415,1272,1273],{"class":421},"14:58:15",[415,1275,1276],{"class":424}," INFO",[415,1278,1279],{"class":512}," [my-app] GET \u002Fapi\u002Fhello 200 in 52ms\n",[415,1281,1282,1285,1288,1291,1294,1297],{"class":417,"line":531},[415,1283,1284],{"class":421},"  ├─",[415,1286,1287],{"class":424}," cache:",[415,1289,1290],{"class":424}," hit=",[415,1292,1293],{"class":508},"true",[415,1295,1296],{"class":424}," ttl=",[415,1298,1299],{"class":1194},"3600\n",[415,1301,1302,1304,1307],{"class":417,"line":548},[415,1303,1284],{"class":421},[415,1305,1306],{"class":424}," action:",[415,1308,1309],{"class":424}," fetch_profile\n",[415,1311,1312,1314,1317,1320],{"class":417,"line":555},[415,1313,1284],{"class":421},[415,1315,1316],{"class":424}," user:",[415,1318,1319],{"class":424}," id=user_123",[415,1321,1322],{"class":424}," plan=pro\n",[415,1324,1325,1328,1331],{"class":417,"line":573},[415,1326,1327],{"class":421},"  └─",[415,1329,1330],{"class":424}," requestId:",[415,1332,1333],{"class":424}," 4a8ff3a8-...\n",[328,1335,1336,1338,1339,1342],{"color":330,"icon":13},[323,1337,688],{}," is an experimental Nitro v3 feature powered by ",[323,1340,1341],{},"AsyncLocalStorage",". It works on Node.js and Bun runtimes.",[386,1344,1346],{"id":1345},"error-handling","Error Handling",[314,1348,1349,1350,1353,1354,704,1356,708,1358,1360],{},"Use ",[323,1351,1352],{},"createError"," for structured errors with ",[323,1355,703],{},[323,1357,707],{},[323,1359,711],{}," fields:",[405,1362,1365],{"className":495,"code":1363,"filename":1364,"language":497,"meta":411,"style":411},"import { createFileRoute } from '@tanstack\u002Freact-router'\nimport { useRequest } from 'nitro\u002Fcontext'\nimport { createError } from 'evlog'\nimport type { RequestLogger } from 'evlog'\n\nexport const Route = createFileRoute('\u002Fapi\u002Fcheckout')({\n  server: {\n    handlers: {\n      POST: async ({ request }) => {\n        const req = useRequest()\n        const log = req.context.log as RequestLogger\n        const body = await request.json()\n\n        log.set({ user: { id: body.userId, plan: body.plan } })\n        log.set({ cart: { items: body.items, total: body.total } })\n\n        const result = await chargeCard(body)\n\n        if (!result.success) {\n          throw createError({\n            message: 'Payment failed',\n            status: 402,\n            why: 'Card declined by issuer',\n            fix: 'Try a different payment method',\n            link: 'https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined',\n          })\n        }\n\n        return Response.json({ success: true, orderId: result.orderId })\n      },\n    },\n  },\n})\n","src\u002Froutes\u002Fapi\u002Fcheckout.ts",[323,1366,1367,1385,1403,1422,1442,1446,1471,1479,1487,1510,1522,1544,1564,1568,1616,1667,1671,1692,1696,1720,1731,1748,1761,1778,1795,1812,1820,1826,1831,1871,1876,1881,1886],{"__ignoreMap":411},[415,1368,1369,1371,1373,1375,1377,1379,1381,1383],{"class":417,"line":418},[415,1370,505],{"class":504},[415,1372,509],{"class":508},[415,1374,910],{"class":512},[415,1376,516],{"class":508},[415,1378,519],{"class":504},[415,1380,522],{"class":508},[415,1382,740],{"class":424},[415,1384,528],{"class":508},[415,1386,1387,1389,1391,1393,1395,1397,1399,1401],{"class":417,"line":531},[415,1388,505],{"class":504},[415,1390,509],{"class":508},[415,1392,929],{"class":512},[415,1394,516],{"class":508},[415,1396,519],{"class":504},[415,1398,522],{"class":508},[415,1400,894],{"class":424},[415,1402,528],{"class":508},[415,1404,1405,1407,1409,1412,1414,1416,1418,1420],{"class":417,"line":548},[415,1406,505],{"class":504},[415,1408,509],{"class":508},[415,1410,1411],{"class":512}," createError",[415,1413,516],{"class":508},[415,1415,519],{"class":504},[415,1417,522],{"class":508},[415,1419,960],{"class":424},[415,1421,528],{"class":508},[415,1423,1424,1426,1428,1430,1432,1434,1436,1438,1440],{"class":417,"line":555},[415,1425,505],{"class":504},[415,1427,946],{"class":504},[415,1429,509],{"class":508},[415,1431,951],{"class":512},[415,1433,516],{"class":508},[415,1435,519],{"class":504},[415,1437,522],{"class":508},[415,1439,960],{"class":424},[415,1441,528],{"class":508},[415,1443,1444],{"class":417,"line":573},[415,1445,552],{"emptyLinePlaceholder":551},[415,1447,1448,1450,1452,1454,1456,1458,1460,1462,1465,1467,1469],{"class":417,"line":585},[415,1449,558],{"class":504},[415,1451,793],{"class":792},[415,1453,796],{"class":512},[415,1455,799],{"class":508},[415,1457,910],{"class":564},[415,1459,567],{"class":512},[415,1461,647],{"class":508},[415,1463,1464],{"class":424},"\u002Fapi\u002Fcheckout",[415,1466,647],{"class":508},[415,1468,990],{"class":512},[415,1470,570],{"class":508},[415,1472,1473,1475,1477],{"class":417,"line":600},[415,1474,810],{"class":576},[415,1476,395],{"class":508},[415,1478,582],{"class":508},[415,1480,1481,1483,1485],{"class":417,"line":606},[415,1482,1005],{"class":576},[415,1484,395],{"class":508},[415,1486,582],{"class":508},[415,1488,1489,1492,1494,1496,1499,1503,1506,1508],{"class":417,"line":617},[415,1490,1491],{"class":564},"      POST",[415,1493,395],{"class":508},[415,1495,1019],{"class":792},[415,1497,1498],{"class":508}," ({",[415,1500,1502],{"class":1501},"sHdIc"," request",[415,1504,1505],{"class":508}," })",[415,1507,1025],{"class":792},[415,1509,582],{"class":508},[415,1511,1512,1514,1516,1518,1520],{"class":417,"line":627},[415,1513,1032],{"class":792},[415,1515,1035],{"class":512},[415,1517,1038],{"class":508},[415,1519,929],{"class":564},[415,1521,1043],{"class":576},[415,1523,1524,1526,1528,1530,1532,1534,1536,1538,1540,1542],{"class":417,"line":653},[415,1525,1032],{"class":792},[415,1527,1050],{"class":512},[415,1529,1038],{"class":508},[415,1531,1035],{"class":512},[415,1533,689],{"class":508},[415,1535,1059],{"class":512},[415,1537,689],{"class":508},[415,1539,1064],{"class":512},[415,1541,1067],{"class":504},[415,1543,1070],{"class":421},[415,1545,1546,1548,1551,1553,1556,1558,1560,1562],{"class":417,"line":664},[415,1547,1032],{"class":792},[415,1549,1550],{"class":512}," body",[415,1552,1038],{"class":508},[415,1554,1555],{"class":504}," await",[415,1557,1502],{"class":512},[415,1559,689],{"class":508},[415,1561,1220],{"class":564},[415,1563,1043],{"class":576},[415,1565,1566],{"class":417,"line":672},[415,1567,552],{"emptyLinePlaceholder":551},[415,1569,1570,1572,1574,1576,1578,1580,1582,1584,1586,1588,1590,1592,1594,1597,1599,1601,1603,1605,1607,1610,1612,1614],{"class":417,"line":1160},[415,1571,1079],{"class":512},[415,1573,689],{"class":508},[415,1575,1084],{"class":564},[415,1577,567],{"class":576},[415,1579,1089],{"class":508},[415,1581,1092],{"class":576},[415,1583,395],{"class":508},[415,1585,509],{"class":508},[415,1587,1099],{"class":576},[415,1589,395],{"class":508},[415,1591,1550],{"class":512},[415,1593,689],{"class":508},[415,1595,1596],{"class":512},"userId",[415,1598,1111],{"class":508},[415,1600,1114],{"class":576},[415,1602,395],{"class":508},[415,1604,1550],{"class":512},[415,1606,689],{"class":508},[415,1608,1609],{"class":512},"plan",[415,1611,516],{"class":508},[415,1613,516],{"class":508},[415,1615,678],{"class":576},[415,1617,1618,1620,1622,1624,1626,1628,1631,1633,1635,1638,1640,1642,1644,1647,1649,1652,1654,1656,1658,1661,1663,1665],{"class":417,"line":1204},[415,1619,1079],{"class":512},[415,1621,689],{"class":508},[415,1623,1084],{"class":564},[415,1625,567],{"class":576},[415,1627,1089],{"class":508},[415,1629,1630],{"class":576}," cart",[415,1632,395],{"class":508},[415,1634,509],{"class":508},[415,1636,1637],{"class":576}," items",[415,1639,395],{"class":508},[415,1641,1550],{"class":512},[415,1643,689],{"class":508},[415,1645,1646],{"class":512},"items",[415,1648,1111],{"class":508},[415,1650,1651],{"class":576}," total",[415,1653,395],{"class":508},[415,1655,1550],{"class":512},[415,1657,689],{"class":508},[415,1659,1660],{"class":512},"total",[415,1662,516],{"class":508},[415,1664,516],{"class":508},[415,1666,678],{"class":576},[415,1668,1669],{"class":417,"line":1209},[415,1670,552],{"emptyLinePlaceholder":551},[415,1672,1673,1675,1678,1680,1682,1685,1687,1690],{"class":417,"line":1238},[415,1674,1032],{"class":792},[415,1676,1677],{"class":512}," result",[415,1679,1038],{"class":508},[415,1681,1555],{"class":504},[415,1683,1684],{"class":564}," chargeCard",[415,1686,567],{"class":576},[415,1688,1689],{"class":512},"body",[415,1691,678],{"class":576},[415,1693,1694],{"class":417,"line":1244},[415,1695,552],{"emptyLinePlaceholder":551},[415,1697,1698,1701,1704,1707,1710,1712,1715,1718],{"class":417,"line":1250},[415,1699,1700],{"class":504},"        if",[415,1702,1703],{"class":576}," (",[415,1705,1706],{"class":508},"!",[415,1708,1709],{"class":512},"result",[415,1711,689],{"class":508},[415,1713,1714],{"class":512},"success",[415,1716,1717],{"class":576},") ",[415,1719,570],{"class":508},[415,1721,1722,1725,1727,1729],{"class":417,"line":1255},[415,1723,1724],{"class":504},"          throw",[415,1726,1411],{"class":564},[415,1728,567],{"class":576},[415,1730,570],{"class":508},[415,1732,1734,1737,1739,1741,1744,1746],{"class":417,"line":1733},21,[415,1735,1736],{"class":576},"            message",[415,1738,395],{"class":508},[415,1740,522],{"class":508},[415,1742,1743],{"class":424},"Payment failed",[415,1745,647],{"class":508},[415,1747,597],{"class":508},[415,1749,1751,1754,1756,1759],{"class":417,"line":1750},22,[415,1752,1753],{"class":576},"            status",[415,1755,395],{"class":508},[415,1757,1758],{"class":1194}," 402",[415,1760,597],{"class":508},[415,1762,1764,1767,1769,1771,1774,1776],{"class":417,"line":1763},23,[415,1765,1766],{"class":576},"            why",[415,1768,395],{"class":508},[415,1770,522],{"class":508},[415,1772,1773],{"class":424},"Card declined by issuer",[415,1775,647],{"class":508},[415,1777,597],{"class":508},[415,1779,1781,1784,1786,1788,1791,1793],{"class":417,"line":1780},24,[415,1782,1783],{"class":576},"            fix",[415,1785,395],{"class":508},[415,1787,522],{"class":508},[415,1789,1790],{"class":424},"Try a different payment method",[415,1792,647],{"class":508},[415,1794,597],{"class":508},[415,1796,1798,1801,1803,1805,1808,1810],{"class":417,"line":1797},25,[415,1799,1800],{"class":576},"            link",[415,1802,395],{"class":508},[415,1804,522],{"class":508},[415,1806,1807],{"class":424},"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined",[415,1809,647],{"class":508},[415,1811,597],{"class":508},[415,1813,1815,1818],{"class":417,"line":1814},26,[415,1816,1817],{"class":508},"          }",[415,1819,678],{"class":576},[415,1821,1823],{"class":417,"line":1822},27,[415,1824,1825],{"class":508},"        }\n",[415,1827,1829],{"class":417,"line":1828},28,[415,1830,552],{"emptyLinePlaceholder":551},[415,1832,1834,1836,1838,1840,1842,1844,1846,1849,1851,1853,1855,1858,1860,1862,1864,1867,1869],{"class":417,"line":1833},29,[415,1835,1212],{"class":504},[415,1837,1215],{"class":512},[415,1839,689],{"class":508},[415,1841,1220],{"class":564},[415,1843,567],{"class":576},[415,1845,1089],{"class":508},[415,1847,1848],{"class":576}," success",[415,1850,395],{"class":508},[415,1852,594],{"class":593},[415,1854,1111],{"class":508},[415,1856,1857],{"class":576}," orderId",[415,1859,395],{"class":508},[415,1861,1677],{"class":512},[415,1863,689],{"class":508},[415,1865,1866],{"class":512},"orderId",[415,1868,516],{"class":508},[415,1870,678],{"class":576},[415,1872,1874],{"class":417,"line":1873},30,[415,1875,1241],{"class":508},[415,1877,1879],{"class":417,"line":1878},31,[415,1880,1247],{"class":508},[415,1882,1884],{"class":417,"line":1883},32,[415,1885,603],{"class":508},[415,1887,1889,1891],{"class":417,"line":1888},33,[415,1890,675],{"class":508},[415,1892,678],{"class":512},[314,1894,1895],{},"The error is captured and logged with both the custom context and structured error fields:",[405,1897,1899],{"className":407,"code":1898,"filename":1266,"language":410,"meta":411,"style":411},"14:58:20 ERROR [my-app] POST \u002Fapi\u002Fcheckout 402 in 104ms\n  ├─ error: name=EvlogError message=Payment failed status=402\n  ├─ cart: items=3 total=9999\n  ├─ user: id=user_123 plan=pro\n  └─ requestId: 880a50ac-...\n",[323,1900,1901,1912,1934,1953,1963],{"__ignoreMap":411},[415,1902,1903,1906,1909],{"class":417,"line":418},[415,1904,1905],{"class":421},"14:58:20",[415,1907,1908],{"class":424}," ERROR",[415,1910,1911],{"class":512}," [my-app] POST \u002Fapi\u002Fcheckout 402 in 104ms\n",[415,1913,1914,1916,1919,1922,1925,1928,1931],{"class":417,"line":531},[415,1915,1284],{"class":421},[415,1917,1918],{"class":424}," error:",[415,1920,1921],{"class":424}," name=EvlogError",[415,1923,1924],{"class":424}," message=Payment",[415,1926,1927],{"class":424}," failed",[415,1929,1930],{"class":424}," status=",[415,1932,1933],{"class":1194},"402\n",[415,1935,1936,1938,1941,1944,1947,1950],{"class":417,"line":548},[415,1937,1284],{"class":421},[415,1939,1940],{"class":424}," cart:",[415,1942,1943],{"class":424}," items=",[415,1945,1946],{"class":1194},"3",[415,1948,1949],{"class":424}," total=",[415,1951,1952],{"class":1194},"9999\n",[415,1954,1955,1957,1959,1961],{"class":417,"line":555},[415,1956,1284],{"class":421},[415,1958,1316],{"class":424},[415,1960,1319],{"class":424},[415,1962,1322],{"class":424},[415,1964,1965,1967,1969],{"class":417,"line":573},[415,1966,1327],{"class":421},[415,1968,1330],{"class":424},[415,1970,1971],{"class":424}," 880a50ac-...\n",[397,1973,1975],{"id":1974},"parsing-errors-on-the-client","Parsing Errors on the Client",[314,1977,1349,1978,1981],{},[323,1979,1980],{},"parseError"," to extract the structured fields from any error response:",[405,1983,1988],{"className":1984,"code":1985,"filename":1986,"language":1987,"meta":411,"style":411},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { parseError } from 'evlog'\n\ntry {\n  const res = await fetch('\u002Fapi\u002Fcheckout', {\n    method: 'POST',\n    body: JSON.stringify({ userId: 'user_123' }),\n  })\n  if (!res.ok) throw { data: await res.json(), status: res.status }\n} catch (error) {\n  const { message, status, why, fix, link } = parseError(error)\n}\n","src\u002Froutes\u002Fcheckout.tsx","tsx",[323,1989,1990,2009,2013,2020,2047,2063,2099,2106,2162,2174,2215],{"__ignoreMap":411},[415,1991,1992,1994,1996,1999,2001,2003,2005,2007],{"class":417,"line":418},[415,1993,505],{"class":504},[415,1995,509],{"class":508},[415,1997,1998],{"class":512}," parseError",[415,2000,516],{"class":508},[415,2002,519],{"class":504},[415,2004,522],{"class":508},[415,2006,960],{"class":424},[415,2008,528],{"class":508},[415,2010,2011],{"class":417,"line":531},[415,2012,552],{"emptyLinePlaceholder":551},[415,2014,2015,2018],{"class":417,"line":548},[415,2016,2017],{"class":504},"try",[415,2019,582],{"class":508},[415,2021,2022,2025,2028,2030,2032,2035,2037,2039,2041,2043,2045],{"class":417,"line":555},[415,2023,2024],{"class":792},"  const",[415,2026,2027],{"class":512}," res",[415,2029,1038],{"class":508},[415,2031,1555],{"class":504},[415,2033,2034],{"class":564}," fetch",[415,2036,567],{"class":576},[415,2038,647],{"class":508},[415,2040,1464],{"class":424},[415,2042,647],{"class":508},[415,2044,1111],{"class":508},[415,2046,582],{"class":508},[415,2048,2049,2052,2054,2056,2059,2061],{"class":417,"line":573},[415,2050,2051],{"class":576},"    method",[415,2053,395],{"class":508},[415,2055,522],{"class":508},[415,2057,2058],{"class":424},"POST",[415,2060,647],{"class":508},[415,2062,597],{"class":508},[415,2064,2065,2068,2070,2073,2075,2078,2080,2082,2085,2087,2089,2091,2093,2095,2097],{"class":417,"line":585},[415,2066,2067],{"class":576},"    body",[415,2069,395],{"class":508},[415,2071,2072],{"class":512}," JSON",[415,2074,689],{"class":508},[415,2076,2077],{"class":564},"stringify",[415,2079,567],{"class":576},[415,2081,1089],{"class":508},[415,2083,2084],{"class":576}," userId",[415,2086,395],{"class":508},[415,2088,522],{"class":508},[415,2090,1106],{"class":424},[415,2092,647],{"class":508},[415,2094,516],{"class":508},[415,2096,659],{"class":576},[415,2098,597],{"class":508},[415,2100,2101,2104],{"class":417,"line":600},[415,2102,2103],{"class":508},"  }",[415,2105,678],{"class":576},[415,2107,2108,2111,2113,2115,2118,2120,2123,2125,2128,2130,2133,2135,2137,2139,2141,2143,2145,2147,2150,2152,2154,2156,2159],{"class":417,"line":606},[415,2109,2110],{"class":504},"  if",[415,2112,1703],{"class":576},[415,2114,1706],{"class":508},[415,2116,2117],{"class":512},"res",[415,2119,689],{"class":508},[415,2121,2122],{"class":512},"ok",[415,2124,1717],{"class":576},[415,2126,2127],{"class":504},"throw",[415,2129,509],{"class":508},[415,2131,2132],{"class":576}," data",[415,2134,395],{"class":508},[415,2136,1555],{"class":504},[415,2138,2027],{"class":512},[415,2140,689],{"class":508},[415,2142,1220],{"class":564},[415,2144,830],{"class":576},[415,2146,1111],{"class":508},[415,2148,2149],{"class":576}," status",[415,2151,395],{"class":508},[415,2153,2027],{"class":512},[415,2155,689],{"class":508},[415,2157,2158],{"class":512},"status",[415,2160,2161],{"class":508}," }\n",[415,2163,2164,2166,2169,2172],{"class":417,"line":617},[415,2165,675],{"class":508},[415,2167,2168],{"class":504}," catch",[415,2170,2171],{"class":512}," (error) ",[415,2173,570],{"class":508},[415,2175,2176,2178,2180,2183,2185,2187,2189,2192,2194,2197,2199,2202,2204,2206,2208,2210,2213],{"class":417,"line":627},[415,2177,2024],{"class":792},[415,2179,509],{"class":508},[415,2181,2182],{"class":512}," message",[415,2184,1111],{"class":508},[415,2186,2149],{"class":512},[415,2188,1111],{"class":508},[415,2190,2191],{"class":512}," why",[415,2193,1111],{"class":508},[415,2195,2196],{"class":512}," fix",[415,2198,1111],{"class":508},[415,2200,2201],{"class":512}," link",[415,2203,516],{"class":508},[415,2205,1038],{"class":508},[415,2207,1998],{"class":564},[415,2209,567],{"class":576},[415,2211,2212],{"class":512},"error",[415,2214,678],{"class":576},[415,2216,2217],{"class":417,"line":653},[415,2218,2219],{"class":508},"}\n",[386,2221,91],{"id":2222},"configuration",[314,2224,2225,2226,2229,2230,2233],{},"See the ",[318,2227,2228],{"href":92},"Configuration reference"," for all available options (",[323,2231,2232],{},"initLogger",", middleware options, sampling, silent mode, etc.).",[386,2235,2237],{"id":2236},"route-filtering","Route Filtering",[314,2239,2240,2241,2244,2245,2248],{},"Control which routes are logged with ",[323,2242,2243],{},"include"," and ",[323,2246,2247],{},"exclude"," in the module options:",[405,2250,2252],{"className":495,"code":2251,"filename":478,"language":497,"meta":411,"style":411},"import { defineConfig } from 'nitro'\nimport evlog from 'evlog\u002Fnitro\u002Fv3'\n\nexport default defineConfig({\n  experimental: { asyncContext: true },\n  modules: [\n    evlog({\n      env: { service: 'my-app' },\n      include: ['\u002Fapi\u002F**'],\n      exclude: ['\u002F_internal\u002F**', '\u002Fhealth'],\n      routes: {\n        '\u002Fapi\u002Fauth\u002F**': { service: 'auth-service' },\n        '\u002Fapi\u002Fpayment\u002F**': { service: 'payment-service' },\n      },\n    }),\n  ],\n})\n",[323,2253,2254,2272,2286,2290,2302,2319,2327,2335,2355,2376,2405,2414,2441,2467,2471,2479,2485],{"__ignoreMap":411},[415,2255,2256,2258,2260,2262,2264,2266,2268,2270],{"class":417,"line":418},[415,2257,505],{"class":504},[415,2259,509],{"class":508},[415,2261,513],{"class":512},[415,2263,516],{"class":508},[415,2265,519],{"class":504},[415,2267,522],{"class":508},[415,2269,525],{"class":424},[415,2271,528],{"class":508},[415,2273,2274,2276,2278,2280,2282,2284],{"class":417,"line":531},[415,2275,505],{"class":504},[415,2277,536],{"class":512},[415,2279,539],{"class":504},[415,2281,522],{"class":508},[415,2283,325],{"class":424},[415,2285,528],{"class":508},[415,2287,2288],{"class":417,"line":548},[415,2289,552],{"emptyLinePlaceholder":551},[415,2291,2292,2294,2296,2298,2300],{"class":417,"line":555},[415,2293,558],{"class":504},[415,2295,561],{"class":504},[415,2297,513],{"class":564},[415,2299,567],{"class":512},[415,2301,570],{"class":508},[415,2303,2304,2306,2308,2310,2313,2315,2317],{"class":417,"line":573},[415,2305,577],{"class":576},[415,2307,395],{"class":508},[415,2309,509],{"class":508},[415,2311,2312],{"class":576}," asyncContext",[415,2314,395],{"class":508},[415,2316,594],{"class":593},[415,2318,650],{"class":508},[415,2320,2321,2323,2325],{"class":417,"line":585},[415,2322,609],{"class":576},[415,2324,395],{"class":508},[415,2326,614],{"class":512},[415,2328,2329,2331,2333],{"class":417,"line":600},[415,2330,620],{"class":564},[415,2332,567],{"class":512},[415,2334,570],{"class":508},[415,2336,2337,2339,2341,2343,2345,2347,2349,2351,2353],{"class":417,"line":606},[415,2338,630],{"class":576},[415,2340,395],{"class":508},[415,2342,509],{"class":508},[415,2344,637],{"class":576},[415,2346,395],{"class":508},[415,2348,522],{"class":508},[415,2350,644],{"class":424},[415,2352,647],{"class":508},[415,2354,650],{"class":508},[415,2356,2357,2360,2362,2364,2366,2369,2371,2374],{"class":417,"line":617},[415,2358,2359],{"class":576},"      include",[415,2361,395],{"class":508},[415,2363,824],{"class":512},[415,2365,647],{"class":508},[415,2367,2368],{"class":424},"\u002Fapi\u002F**",[415,2370,647],{"class":508},[415,2372,2373],{"class":512},"]",[415,2375,597],{"class":508},[415,2377,2378,2381,2383,2385,2387,2390,2392,2394,2396,2399,2401,2403],{"class":417,"line":627},[415,2379,2380],{"class":576},"      exclude",[415,2382,395],{"class":508},[415,2384,824],{"class":512},[415,2386,647],{"class":508},[415,2388,2389],{"class":424},"\u002F_internal\u002F**",[415,2391,647],{"class":508},[415,2393,1111],{"class":508},[415,2395,522],{"class":508},[415,2397,2398],{"class":424},"\u002Fhealth",[415,2400,647],{"class":508},[415,2402,2373],{"class":512},[415,2404,597],{"class":508},[415,2406,2407,2410,2412],{"class":417,"line":653},[415,2408,2409],{"class":576},"      routes",[415,2411,395],{"class":508},[415,2413,582],{"class":508},[415,2415,2416,2419,2422,2424,2426,2428,2430,2432,2434,2437,2439],{"class":417,"line":664},[415,2417,2418],{"class":508},"        '",[415,2420,2421],{"class":576},"\u002Fapi\u002Fauth\u002F**",[415,2423,647],{"class":508},[415,2425,395],{"class":508},[415,2427,509],{"class":508},[415,2429,637],{"class":576},[415,2431,395],{"class":508},[415,2433,522],{"class":508},[415,2435,2436],{"class":424},"auth-service",[415,2438,647],{"class":508},[415,2440,650],{"class":508},[415,2442,2443,2445,2448,2450,2452,2454,2456,2458,2460,2463,2465],{"class":417,"line":672},[415,2444,2418],{"class":508},[415,2446,2447],{"class":576},"\u002Fapi\u002Fpayment\u002F**",[415,2449,647],{"class":508},[415,2451,395],{"class":508},[415,2453,509],{"class":508},[415,2455,637],{"class":576},[415,2457,395],{"class":508},[415,2459,522],{"class":508},[415,2461,2462],{"class":424},"payment-service",[415,2464,647],{"class":508},[415,2466,650],{"class":508},[415,2468,2469],{"class":417,"line":1160},[415,2470,1241],{"class":508},[415,2472,2473,2475,2477],{"class":417,"line":1204},[415,2474,656],{"class":508},[415,2476,659],{"class":512},[415,2478,597],{"class":508},[415,2480,2481,2483],{"class":417,"line":1209},[415,2482,667],{"class":512},[415,2484,597],{"class":508},[415,2486,2487,2489],{"class":417,"line":1238},[415,2488,675],{"class":508},[415,2490,678],{"class":512},[386,2492,2494],{"id":2493},"drain-enrichers","Drain & Enrichers",[314,2496,2497,2498,2501],{},"Since TanStack Start uses Nitro v3, configure drains and enrichers via Nitro plugins. Create a ",[323,2499,2500],{},"server\u002Fplugins\u002F"," directory and register hooks:",[405,2503,2506],{"className":495,"code":2504,"filename":2505,"language":497,"meta":411,"style":411},"import { definePlugin } from 'nitro'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nexport default definePlugin((nitroApp) => {\n  const axiom = createAxiomDrain()\n\n  nitroApp.hooks.hook('evlog:drain', axiom)\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[323,2507,2508,2527,2547,2551,2572,2585,2589,2619],{"__ignoreMap":411},[415,2509,2510,2512,2514,2517,2519,2521,2523,2525],{"class":417,"line":418},[415,2511,505],{"class":504},[415,2513,509],{"class":508},[415,2515,2516],{"class":512}," definePlugin",[415,2518,516],{"class":508},[415,2520,519],{"class":504},[415,2522,522],{"class":508},[415,2524,525],{"class":424},[415,2526,528],{"class":508},[415,2528,2529,2531,2533,2536,2538,2540,2542,2545],{"class":417,"line":531},[415,2530,505],{"class":504},[415,2532,509],{"class":508},[415,2534,2535],{"class":512}," createAxiomDrain",[415,2537,516],{"class":508},[415,2539,519],{"class":504},[415,2541,522],{"class":508},[415,2543,2544],{"class":424},"evlog\u002Faxiom",[415,2546,528],{"class":508},[415,2548,2549],{"class":417,"line":548},[415,2550,552],{"emptyLinePlaceholder":551},[415,2552,2553,2555,2557,2559,2561,2563,2566,2568,2570],{"class":417,"line":555},[415,2554,558],{"class":504},[415,2556,561],{"class":504},[415,2558,2516],{"class":564},[415,2560,567],{"class":512},[415,2562,567],{"class":508},[415,2564,2565],{"class":1501},"nitroApp",[415,2567,659],{"class":508},[415,2569,1025],{"class":792},[415,2571,582],{"class":508},[415,2573,2574,2576,2579,2581,2583],{"class":417,"line":573},[415,2575,2024],{"class":792},[415,2577,2578],{"class":512}," axiom",[415,2580,1038],{"class":508},[415,2582,2535],{"class":564},[415,2584,1043],{"class":576},[415,2586,2587],{"class":417,"line":585},[415,2588,552],{"emptyLinePlaceholder":551},[415,2590,2591,2594,2596,2599,2601,2604,2606,2608,2611,2613,2615,2617],{"class":417,"line":600},[415,2592,2593],{"class":512},"  nitroApp",[415,2595,689],{"class":508},[415,2597,2598],{"class":512},"hooks",[415,2600,689],{"class":508},[415,2602,2603],{"class":564},"hook",[415,2605,567],{"class":576},[415,2607,647],{"class":508},[415,2609,2610],{"class":424},"evlog:drain",[415,2612,647],{"class":508},[415,2614,1111],{"class":508},[415,2616,2578],{"class":512},[415,2618,678],{"class":576},[415,2620,2621,2623],{"class":417,"line":606},[415,2622,675],{"class":508},[415,2624,678],{"class":512},[405,2626,2629],{"className":495,"code":2627,"filename":2628,"language":497,"meta":411,"style":411},"import { definePlugin } from 'nitro'\nimport { createUserAgentEnricher, createRequestSizeEnricher } from 'evlog\u002Fenrichers'\n\nexport default definePlugin((nitroApp) => {\n  const enrichers = [createUserAgentEnricher(), createRequestSizeEnricher()]\n\n  nitroApp.hooks.hook('evlog:enrich', (ctx) => {\n    for (const enricher of enrichers) enricher(ctx)\n  })\n})\n","server\u002Fplugins\u002Fevlog-enrich.ts",[323,2630,2631,2649,2674,2678,2698,2721,2725,2759,2788,2794],{"__ignoreMap":411},[415,2632,2633,2635,2637,2639,2641,2643,2645,2647],{"class":417,"line":418},[415,2634,505],{"class":504},[415,2636,509],{"class":508},[415,2638,2516],{"class":512},[415,2640,516],{"class":508},[415,2642,519],{"class":504},[415,2644,522],{"class":508},[415,2646,525],{"class":424},[415,2648,528],{"class":508},[415,2650,2651,2653,2655,2658,2660,2663,2665,2667,2669,2672],{"class":417,"line":531},[415,2652,505],{"class":504},[415,2654,509],{"class":508},[415,2656,2657],{"class":512}," createUserAgentEnricher",[415,2659,1111],{"class":508},[415,2661,2662],{"class":512}," createRequestSizeEnricher",[415,2664,516],{"class":508},[415,2666,519],{"class":504},[415,2668,522],{"class":508},[415,2670,2671],{"class":424},"evlog\u002Fenrichers",[415,2673,528],{"class":508},[415,2675,2676],{"class":417,"line":548},[415,2677,552],{"emptyLinePlaceholder":551},[415,2679,2680,2682,2684,2686,2688,2690,2692,2694,2696],{"class":417,"line":555},[415,2681,558],{"class":504},[415,2683,561],{"class":504},[415,2685,2516],{"class":564},[415,2687,567],{"class":512},[415,2689,567],{"class":508},[415,2691,2565],{"class":1501},[415,2693,659],{"class":508},[415,2695,1025],{"class":792},[415,2697,582],{"class":508},[415,2699,2700,2702,2705,2707,2709,2712,2714,2716,2718],{"class":417,"line":573},[415,2701,2024],{"class":792},[415,2703,2704],{"class":512}," enrichers",[415,2706,1038],{"class":508},[415,2708,824],{"class":576},[415,2710,2711],{"class":564},"createUserAgentEnricher",[415,2713,830],{"class":576},[415,2715,1111],{"class":508},[415,2717,2662],{"class":564},[415,2719,2720],{"class":576},"()]\n",[415,2722,2723],{"class":417,"line":585},[415,2724,552],{"emptyLinePlaceholder":551},[415,2726,2727,2729,2731,2733,2735,2737,2739,2741,2744,2746,2748,2750,2753,2755,2757],{"class":417,"line":600},[415,2728,2593],{"class":512},[415,2730,689],{"class":508},[415,2732,2598],{"class":512},[415,2734,689],{"class":508},[415,2736,2603],{"class":564},[415,2738,567],{"class":576},[415,2740,647],{"class":508},[415,2742,2743],{"class":424},"evlog:enrich",[415,2745,647],{"class":508},[415,2747,1111],{"class":508},[415,2749,1703],{"class":508},[415,2751,2752],{"class":1501},"ctx",[415,2754,659],{"class":508},[415,2756,1025],{"class":792},[415,2758,582],{"class":508},[415,2760,2761,2764,2766,2769,2772,2775,2777,2779,2782,2784,2786],{"class":417,"line":606},[415,2762,2763],{"class":504},"    for",[415,2765,1703],{"class":576},[415,2767,2768],{"class":792},"const",[415,2770,2771],{"class":512}," enricher",[415,2773,2774],{"class":508}," of",[415,2776,2704],{"class":512},[415,2778,1717],{"class":576},[415,2780,2781],{"class":564},"enricher",[415,2783,567],{"class":576},[415,2785,2752],{"class":512},[415,2787,678],{"class":576},[415,2789,2790,2792],{"class":417,"line":617},[415,2791,2103],{"class":508},[415,2793,678],{"class":576},[415,2795,2796,2798],{"class":417,"line":627},[415,2797,675],{"class":508},[415,2799,678],{"class":512},[328,2801,2225,2802,2244,2805,2807],{"color":330,"icon":13},[318,2803,213],{"href":2804},"\u002Fadapters\u002Foverview",[318,2806,293],{"href":298}," docs for all available drain adapters and enrichers.",[397,2809,2811],{"id":2810},"pipeline-batching-retry","Pipeline (Batching & Retry)",[314,2813,2814,2815,2818],{},"For production, wrap your adapter with ",[323,2816,2817],{},"createDrainPipeline"," to batch events and retry on failure:",[405,2820,2822],{"className":495,"code":2821,"filename":2505,"language":497,"meta":411,"style":411},"import { definePlugin } from 'nitro'\nimport type { DrainContext } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nexport default definePlugin((nitroApp) => {\n  const pipeline = createDrainPipeline\u003CDrainContext>({\n    batch: { size: 50, intervalMs: 5000 },\n    retry: { maxAttempts: 3 },\n  })\n  const drain = pipeline(createAxiomDrain())\n\n  nitroApp.hooks.hook('evlog:drain', drain)\n})\n",[323,2823,2824,2842,2863,2881,2901,2905,2925,2949,2978,2997,3003,3022,3026,3052],{"__ignoreMap":411},[415,2825,2826,2828,2830,2832,2834,2836,2838,2840],{"class":417,"line":418},[415,2827,505],{"class":504},[415,2829,509],{"class":508},[415,2831,2516],{"class":512},[415,2833,516],{"class":508},[415,2835,519],{"class":504},[415,2837,522],{"class":508},[415,2839,525],{"class":424},[415,2841,528],{"class":508},[415,2843,2844,2846,2848,2850,2853,2855,2857,2859,2861],{"class":417,"line":531},[415,2845,505],{"class":504},[415,2847,946],{"class":504},[415,2849,509],{"class":508},[415,2851,2852],{"class":512}," DrainContext",[415,2854,516],{"class":508},[415,2856,519],{"class":504},[415,2858,522],{"class":508},[415,2860,960],{"class":424},[415,2862,528],{"class":508},[415,2864,2865,2867,2869,2871,2873,2875,2877,2879],{"class":417,"line":548},[415,2866,505],{"class":504},[415,2868,509],{"class":508},[415,2870,2535],{"class":512},[415,2872,516],{"class":508},[415,2874,519],{"class":504},[415,2876,522],{"class":508},[415,2878,2544],{"class":424},[415,2880,528],{"class":508},[415,2882,2883,2885,2887,2890,2892,2894,2896,2899],{"class":417,"line":555},[415,2884,505],{"class":504},[415,2886,509],{"class":508},[415,2888,2889],{"class":512}," createDrainPipeline",[415,2891,516],{"class":508},[415,2893,519],{"class":504},[415,2895,522],{"class":508},[415,2897,2898],{"class":424},"evlog\u002Fpipeline",[415,2900,528],{"class":508},[415,2902,2903],{"class":417,"line":573},[415,2904,552],{"emptyLinePlaceholder":551},[415,2906,2907,2909,2911,2913,2915,2917,2919,2921,2923],{"class":417,"line":585},[415,2908,558],{"class":504},[415,2910,561],{"class":504},[415,2912,2516],{"class":564},[415,2914,567],{"class":512},[415,2916,567],{"class":508},[415,2918,2565],{"class":1501},[415,2920,659],{"class":508},[415,2922,1025],{"class":792},[415,2924,582],{"class":508},[415,2926,2927,2929,2932,2934,2936,2939,2942,2945,2947],{"class":417,"line":600},[415,2928,2024],{"class":792},[415,2930,2931],{"class":512}," pipeline",[415,2933,1038],{"class":508},[415,2935,2889],{"class":564},[415,2937,2938],{"class":508},"\u003C",[415,2940,2941],{"class":421},"DrainContext",[415,2943,2944],{"class":508},">",[415,2946,567],{"class":576},[415,2948,570],{"class":508},[415,2950,2951,2954,2956,2958,2961,2963,2966,2968,2971,2973,2976],{"class":417,"line":606},[415,2952,2953],{"class":576},"    batch",[415,2955,395],{"class":508},[415,2957,509],{"class":508},[415,2959,2960],{"class":576}," size",[415,2962,395],{"class":508},[415,2964,2965],{"class":1194}," 50",[415,2967,1111],{"class":508},[415,2969,2970],{"class":576}," intervalMs",[415,2972,395],{"class":508},[415,2974,2975],{"class":1194}," 5000",[415,2977,650],{"class":508},[415,2979,2980,2983,2985,2987,2990,2992,2995],{"class":417,"line":617},[415,2981,2982],{"class":576},"    retry",[415,2984,395],{"class":508},[415,2986,509],{"class":508},[415,2988,2989],{"class":576}," maxAttempts",[415,2991,395],{"class":508},[415,2993,2994],{"class":1194}," 3",[415,2996,650],{"class":508},[415,2998,2999,3001],{"class":417,"line":627},[415,3000,2103],{"class":508},[415,3002,678],{"class":576},[415,3004,3005,3007,3010,3012,3014,3016,3019],{"class":417,"line":653},[415,3006,2024],{"class":792},[415,3008,3009],{"class":512}," drain",[415,3011,1038],{"class":508},[415,3013,2931],{"class":564},[415,3015,567],{"class":576},[415,3017,3018],{"class":564},"createAxiomDrain",[415,3020,3021],{"class":576},"())\n",[415,3023,3024],{"class":417,"line":664},[415,3025,552],{"emptyLinePlaceholder":551},[415,3027,3028,3030,3032,3034,3036,3038,3040,3042,3044,3046,3048,3050],{"class":417,"line":672},[415,3029,2593],{"class":512},[415,3031,689],{"class":508},[415,3033,2598],{"class":512},[415,3035,689],{"class":508},[415,3037,2603],{"class":564},[415,3039,567],{"class":576},[415,3041,647],{"class":508},[415,3043,2610],{"class":424},[415,3045,647],{"class":508},[415,3047,1111],{"class":508},[415,3049,3009],{"class":512},[415,3051,678],{"class":576},[415,3053,3054,3056],{"class":417,"line":1160},[415,3055,675],{"class":508},[415,3057,678],{"class":512},[328,3059,3060,3061,3064,3065,3068],{"color":330,"icon":13},"Call ",[323,3062,3063],{},"drain.flush()"," on server shutdown to ensure all buffered events are sent. See the ",[318,3066,3067],{"href":279},"Pipeline docs"," for all options.",[386,3070,3072],{"id":3071},"tail-sampling","Tail Sampling",[314,3074,3075,3076,3079],{},"Use the ",[323,3077,3078],{},"evlog:emit:keep"," hook to force-retain specific events regardless of head sampling:",[405,3081,3084],{"className":495,"code":3082,"filename":3083,"language":497,"meta":411,"style":411},"import { definePlugin } from 'nitro'\n\nexport default definePlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:emit:keep', (ctx) => {\n    if (ctx.duration && ctx.duration > 2000) ctx.shouldKeep = true\n    if (ctx.status && ctx.status >= 500) ctx.shouldKeep = true\n  })\n})\n","server\u002Fplugins\u002Fevlog-keep.ts",[323,3085,3086,3104,3108,3128,3160,3204,3242,3248],{"__ignoreMap":411},[415,3087,3088,3090,3092,3094,3096,3098,3100,3102],{"class":417,"line":418},[415,3089,505],{"class":504},[415,3091,509],{"class":508},[415,3093,2516],{"class":512},[415,3095,516],{"class":508},[415,3097,519],{"class":504},[415,3099,522],{"class":508},[415,3101,525],{"class":424},[415,3103,528],{"class":508},[415,3105,3106],{"class":417,"line":531},[415,3107,552],{"emptyLinePlaceholder":551},[415,3109,3110,3112,3114,3116,3118,3120,3122,3124,3126],{"class":417,"line":548},[415,3111,558],{"class":504},[415,3113,561],{"class":504},[415,3115,2516],{"class":564},[415,3117,567],{"class":512},[415,3119,567],{"class":508},[415,3121,2565],{"class":1501},[415,3123,659],{"class":508},[415,3125,1025],{"class":792},[415,3127,582],{"class":508},[415,3129,3130,3132,3134,3136,3138,3140,3142,3144,3146,3148,3150,3152,3154,3156,3158],{"class":417,"line":555},[415,3131,2593],{"class":512},[415,3133,689],{"class":508},[415,3135,2598],{"class":512},[415,3137,689],{"class":508},[415,3139,2603],{"class":564},[415,3141,567],{"class":576},[415,3143,647],{"class":508},[415,3145,3078],{"class":424},[415,3147,647],{"class":508},[415,3149,1111],{"class":508},[415,3151,1703],{"class":508},[415,3153,2752],{"class":1501},[415,3155,659],{"class":508},[415,3157,1025],{"class":792},[415,3159,582],{"class":508},[415,3161,3162,3165,3167,3169,3171,3174,3177,3180,3182,3184,3187,3190,3192,3194,3196,3199,3201],{"class":417,"line":573},[415,3163,3164],{"class":504},"    if",[415,3166,1703],{"class":576},[415,3168,2752],{"class":512},[415,3170,689],{"class":508},[415,3172,3173],{"class":512},"duration",[415,3175,3176],{"class":508}," &&",[415,3178,3179],{"class":512}," ctx",[415,3181,689],{"class":508},[415,3183,3173],{"class":512},[415,3185,3186],{"class":508}," >",[415,3188,3189],{"class":1194}," 2000",[415,3191,1717],{"class":576},[415,3193,2752],{"class":512},[415,3195,689],{"class":508},[415,3197,3198],{"class":512},"shouldKeep",[415,3200,1038],{"class":508},[415,3202,3203],{"class":593}," true\n",[415,3205,3206,3208,3210,3212,3214,3216,3218,3220,3222,3224,3227,3230,3232,3234,3236,3238,3240],{"class":417,"line":585},[415,3207,3164],{"class":504},[415,3209,1703],{"class":576},[415,3211,2752],{"class":512},[415,3213,689],{"class":508},[415,3215,2158],{"class":512},[415,3217,3176],{"class":508},[415,3219,3179],{"class":512},[415,3221,689],{"class":508},[415,3223,2158],{"class":512},[415,3225,3226],{"class":508}," >=",[415,3228,3229],{"class":1194}," 500",[415,3231,1717],{"class":576},[415,3233,2752],{"class":512},[415,3235,689],{"class":508},[415,3237,3198],{"class":512},[415,3239,1038],{"class":508},[415,3241,3203],{"class":593},[415,3243,3244,3246],{"class":417,"line":600},[415,3245,2103],{"class":508},[415,3247,678],{"class":576},[415,3249,3250,3252],{"class":417,"line":606},[415,3251,675],{"class":508},[415,3253,678],{"class":512},[386,3255,3257],{"id":3256},"run-locally","Run Locally",[405,3259,3262],{"className":407,"code":3260,"filename":3261,"language":410,"meta":411,"style":411},"git clone https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog.git\ncd evlog\u002Fexamples\u002Ftanstack-start\nbun install\nbun run dev\n","Terminal",[323,3263,3264,3275,3283,3290],{"__ignoreMap":411},[415,3265,3266,3269,3272],{"class":417,"line":418},[415,3267,3268],{"class":421},"git",[415,3270,3271],{"class":424}," clone",[415,3273,3274],{"class":424}," https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog.git\n",[415,3276,3277,3280],{"class":417,"line":531},[415,3278,3279],{"class":564},"cd",[415,3281,3282],{"class":424}," evlog\u002Fexamples\u002Ftanstack-start\n",[415,3284,3285,3287],{"class":417,"line":548},[415,3286,432],{"class":421},[415,3288,3289],{"class":424}," install\n",[415,3291,3292,3294,3297],{"class":417,"line":555},[415,3293,432],{"class":421},[415,3295,3296],{"class":424}," run",[415,3298,3299],{"class":424}," dev\n",[314,3301,3302,3303,3307],{},"Open ",[318,3304,3305],{"href":3305,"rel":3306},"http:\u002F\u002Flocalhost:3000",[379]," and navigate to the evlog Demo page to test the API endpoints.",[3309,3310,3311],"card-group",{},[3312,3313,3317],"card",{"icon":3314,"title":3315,"to":3316},"i-simple-icons-github","Source Code","https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Ftanstack-start","Browse the complete TanStack Start example source on GitHub.",[386,3319,3321],{"id":3320},"next-steps","Next Steps",[314,3323,3324,3325,3327],{},"Deepen your ",[332,3326,154],{}," integration:",[351,3329,3330,3335,3340,3345],{},[354,3331,3332,3334],{},[318,3333,51],{"href":52},": Design comprehensive events with context layering",[354,3336,3337,3339],{},[318,3338,213],{"href":2804},": Send logs to Axiom, Sentry, PostHog, and more",[354,3341,3342,3344],{},[318,3343,96],{"href":97},": Control log volume with head and tail sampling",[354,3346,3347,3349,3350,704,3352,708,3354,3356],{},[318,3348,56],{"href":57},": Throw errors with ",[323,3351,703],{},[323,3353,707],{},[323,3355,711],{}," fields",[3358,3359,3360],"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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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}",{"title":411,"searchDepth":531,"depth":531,"links":3362},[3363,3369,3370,3373,3374,3375,3378,3379,3380],{"id":388,"depth":531,"text":20,"children":3364},[3365,3366,3368],{"id":399,"depth":548,"text":400},{"id":474,"depth":548,"text":3367},"2. Add nitro.config.ts",{"id":692,"depth":548,"text":693},{"id":881,"depth":531,"text":51},{"id":1345,"depth":531,"text":1346,"children":3371},[3372],{"id":1974,"depth":548,"text":1975},{"id":2222,"depth":531,"text":91},{"id":2236,"depth":531,"text":2237},{"id":2493,"depth":531,"text":2494,"children":3376},[3377],{"id":2810,"depth":548,"text":2811},{"id":3071,"depth":531,"text":3072},{"id":3256,"depth":531,"text":3257},{"id":3320,"depth":531,"text":3321},"Automatic wide events, structured errors, and logging in TanStack Start API routes and server functions.","md",[3384],{"label":3315,"icon":3314,"to":3316,"color":3385,"variant":3386},"neutral","subtle",{},{"title":154,"icon":157},{"title":154,"description":3381},"yvLucWmsZlVWTNiH1yeIVuDGj1nXy3s05Cuiet17Sk4",[3392,3394],{"title":149,"path":150,"stem":151,"description":3393,"icon":152,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in Nitro v2 and v3 applications.",{"title":159,"path":160,"stem":161,"description":3395,"icon":162,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in NestJS applications.",1777667168099]