[{"data":1,"prerenderedAt":2522},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-tanstack-start":243,"-frameworks-tanstack-start-surround":2517},[4,30,110,159,213,229],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24],{"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",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Frameworks","\u002Fframeworks","2.frameworks",[35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Fframeworks\u002Foverview","2.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":41,"path":42,"stem":43,"icon":44},"Nuxt","\u002Fframeworks\u002Fnuxt","2.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":46,"path":47,"stem":48,"icon":49},"Next.js","\u002Fframeworks\u002Fnextjs","2.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":51,"path":52,"stem":53,"icon":54},"SvelteKit","\u002Fframeworks\u002Fsveltekit","2.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":56,"path":57,"stem":58,"icon":59},"Nitro","\u002Fframeworks\u002Fnitro","2.frameworks\u002F04.nitro","i-custom-nitro",{"title":61,"path":62,"stem":63,"icon":64},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","2.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":66,"path":67,"stem":68,"icon":69},"NestJS","\u002Fframeworks\u002Fnestjs","2.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":71,"path":72,"stem":73,"icon":74},"Express","\u002Fframeworks\u002Fexpress","2.frameworks\u002F07.express","i-simple-icons-express",{"title":76,"path":77,"stem":78,"icon":79},"Hono","\u002Fframeworks\u002Fhono","2.frameworks\u002F08.hono","i-simple-icons-hono",{"title":81,"path":82,"stem":83,"icon":84},"Fastify","\u002Fframeworks\u002Ffastify","2.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":86,"path":87,"stem":88,"icon":89},"Elysia","\u002Fframeworks\u002Felysia","2.frameworks\u002F10.elysia","i-custom-elysia",{"title":91,"path":92,"stem":93,"icon":94},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","2.frameworks\u002F11.cloudflare-workers","i-simple-icons-cloudflare",{"title":96,"path":97,"stem":98,"icon":99},"Standalone","\u002Fframeworks\u002Fstandalone","2.frameworks\u002F12.standalone","i-simple-icons-typescript",{"title":101,"path":102,"stem":103,"icon":104},"Astro","\u002Fframeworks\u002Fastro","2.frameworks\u002F13.astro","i-simple-icons-astro",{"title":106,"path":107,"stem":108,"icon":109},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","2.frameworks\u002F14.custom-integration","i-lucide-puzzle",{"title":111,"path":112,"stem":113,"children":114,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[115,120,125,130,135,139,144,149,154],{"title":116,"path":117,"stem":118,"icon":119},"Request Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":121,"path":122,"stem":123,"icon":124},"Wide Events","\u002Fcore-concepts\u002Fwide-events","3.core-concepts\u002F1.wide-events","i-lucide-layers",{"title":126,"path":127,"stem":128,"icon":129},"Structured Errors","\u002Fcore-concepts\u002Fstructured-errors","3.core-concepts\u002F2.structured-errors","i-lucide-shield-alert",{"title":131,"path":132,"stem":133,"icon":134},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F3.best-practices","i-lucide-shield-check",{"title":136,"path":137,"stem":138,"icon":99},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F4.typed-fields",{"title":140,"path":141,"stem":142,"icon":143},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F5.sampling","i-lucide-filter",{"title":145,"path":146,"stem":147,"icon":148},"Client Logging","\u002Fcore-concepts\u002Fclient-logging","3.core-concepts\u002F6.client-logging","i-lucide-monitor",{"title":150,"path":151,"stem":152,"icon":153},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F7.configuration","i-lucide-settings",{"title":155,"path":156,"stem":157,"icon":158},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F8.performance","i-lucide-gauge",{"title":160,"path":161,"stem":162,"children":163,"page":29},"Adapters","\u002Fadapters","4.adapters",[164,168,173,178,183,188,193,198,203,208],{"title":36,"path":165,"stem":166,"icon":167},"\u002Fadapters\u002Foverview","4.adapters\u002F1.overview","i-custom-plug",{"title":169,"path":170,"stem":171,"icon":172},"Browser","\u002Fadapters\u002Fbrowser","4.adapters\u002F10.browser","i-lucide-globe",{"title":174,"path":175,"stem":176,"icon":177},"Axiom","\u002Fadapters\u002Faxiom","4.adapters\u002F2.axiom","i-custom-axiom",{"title":179,"path":180,"stem":181,"icon":182},"OTLP","\u002Fadapters\u002Fotlp","4.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":184,"path":185,"stem":186,"icon":187},"PostHog","\u002Fadapters\u002Fposthog","4.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":189,"path":190,"stem":191,"icon":192},"Sentry","\u002Fadapters\u002Fsentry","4.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":194,"path":195,"stem":196,"icon":197},"Better Stack","\u002Fadapters\u002Fbetter-stack","4.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":199,"path":200,"stem":201,"icon":202},"File System","\u002Fadapters\u002Ffs","4.adapters\u002F7.fs","i-lucide-hard-drive",{"title":204,"path":205,"stem":206,"icon":207},"Custom Adapters","\u002Fadapters\u002Fcustom","4.adapters\u002F8.custom","i-lucide-code",{"title":209,"path":210,"stem":211,"icon":212},"Pipeline","\u002Fadapters\u002Fpipeline","4.adapters\u002F9.pipeline","i-lucide-workflow",{"title":214,"path":215,"stem":216,"children":217,"page":29},"Enrichers","\u002Fenrichers","5.enrichers",[218,221,225],{"title":36,"path":219,"stem":220,"icon":28},"\u002Fenrichers\u002Foverview","5.enrichers\u002F1.overview",{"title":222,"path":223,"stem":224,"icon":109},"Built-in","\u002Fenrichers\u002Fbuilt-in","5.enrichers\u002F2.built-in",{"title":226,"path":227,"stem":228,"icon":207},"Custom","\u002Fenrichers\u002Fcustom","5.enrichers\u002F3.custom",{"title":230,"path":231,"stem":232,"children":233,"page":29},"NuxtHub","\u002Fnuxthub","6.nuxthub",[234,238],{"title":36,"path":235,"stem":236,"icon":237},"\u002Fnuxthub\u002Foverview","6.nuxthub\u002F1.overview","i-lucide-database",{"title":239,"path":240,"stem":241,"icon":242},"Retention","\u002Fnuxthub\u002Fretention","6.nuxthub\u002F2.retention","i-lucide-clock",{"id":244,"title":61,"body":245,"description":2507,"extension":2508,"links":2509,"meta":2513,"navigation":2514,"path":62,"seo":2515,"stem":63,"__hash__":2516},"docs\u002F2.frameworks\u002F05.tanstack-start.md",{"type":246,"value":247,"toc":2492},"minimark",[248,257,338,342,349,354,374,381,395,569,580,584,607,747,750,753,767,1131,1134,1205,1216,1220,1234,1766,1769,1845,1849,1855,2092,2095,2107,2111,2118,2241,2416,2424,2428,2469,2478,2488],[249,250,251,252,256],"p",{},"TanStack Start uses Nitro v3 as its server layer, so evlog integrates via the ",[253,254,255],"code",{},"evlog\u002Fnitro\u002Fv3"," module. The same plugin-based hooks system applies.",[258,259,260],"code-collapse",{},[261,262,268],"pre",{"className":263,"code":264,"filename":265,"language":266,"meta":267,"style":267},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Set up evlog in my TanStack Start app.\n\n- Install evlog: pnpm add evlog\n- Create nitro.config.ts with evlog\u002Fnitro\u002Fv3 module and experimental.asyncContext enabled\n- Configure env.service with your app name\n- Add evlogErrorHandler middleware to the root route for structured error responses\n- Access the logger via useRequest().context.log in route handlers\n- Use log.set() to accumulate context, throw createError() for structured errors\n\nDocs: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Ftanstack-start\nAdapters: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\n","Prompt","txt","",[253,269,270,278,285,291,297,303,309,315,321,326,332],{"__ignoreMap":267},[271,272,275],"span",{"class":273,"line":274},"line",1,[271,276,277],{},"Set up evlog in my TanStack Start app.\n",[271,279,281],{"class":273,"line":280},2,[271,282,284],{"emptyLinePlaceholder":283},true,"\n",[271,286,288],{"class":273,"line":287},3,[271,289,290],{},"- Install evlog: pnpm add evlog\n",[271,292,294],{"class":273,"line":293},4,[271,295,296],{},"- Create nitro.config.ts with evlog\u002Fnitro\u002Fv3 module and experimental.asyncContext enabled\n",[271,298,300],{"class":273,"line":299},5,[271,301,302],{},"- Configure env.service with your app name\n",[271,304,306],{"class":273,"line":305},6,[271,307,308],{},"- Add evlogErrorHandler middleware to the root route for structured error responses\n",[271,310,312],{"class":273,"line":311},7,[271,313,314],{},"- Access the logger via useRequest().context.log in route handlers\n",[271,316,318],{"class":273,"line":317},8,[271,319,320],{},"- Use log.set() to accumulate context, throw createError() for structured errors\n",[271,322,324],{"class":273,"line":323},9,[271,325,284],{"emptyLinePlaceholder":283},[271,327,329],{"class":273,"line":328},10,[271,330,331],{},"Docs: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Ftanstack-start\n",[271,333,335],{"class":273,"line":334},11,[271,336,337],{},"Adapters: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\n",[339,340,20],"h2",{"id":341},"quick-start",[249,343,344,345,348],{},"Starting from a TanStack Start project created with ",[253,346,347],{},"npm create @tanstack\u002Fstart@latest",":",[350,351,353],"h3",{"id":352},"_1-install","1. Install",[261,355,359],{"className":356,"code":357,"language":358,"meta":267,"style":267},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","bun add evlog\n","bash",[253,360,361],{"__ignoreMap":267},[271,362,363,367,371],{"class":273,"line":274},[271,364,366],{"class":365},"sBMFI","bun",[271,368,370],{"class":369},"sfazB"," add",[271,372,373],{"class":369}," evlog\n",[350,375,377,378],{"id":376},"_2-add-nitroconfigts","2. Add ",[253,379,380],{},"nitro.config.ts",[249,382,383,384,386,387,390,391,394],{},"Create a ",[253,385,380],{}," at the project root to register the evlog module. Your ",[253,388,389],{},"vite.config.ts"," already has the ",[253,392,393],{},"nitro()"," plugin from the CLI, so no changes are needed there.",[261,396,400],{"className":397,"code":398,"filename":380,"language":399,"meta":267,"style":267},"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",[253,401,402,431,447,451,468,479,493,498,508,517,542,552,560],{"__ignoreMap":267},[271,403,404,408,412,416,419,422,425,428],{"class":273,"line":274},[271,405,407],{"class":406},"s7zQu","import",[271,409,411],{"class":410},"sMK4o"," {",[271,413,415],{"class":414},"sTEyZ"," defineConfig",[271,417,418],{"class":410}," }",[271,420,421],{"class":406}," from",[271,423,424],{"class":410}," '",[271,426,427],{"class":369},"nitro",[271,429,430],{"class":410},"'\n",[271,432,433,435,438,441,443,445],{"class":273,"line":280},[271,434,407],{"class":406},[271,436,437],{"class":414}," evlog ",[271,439,440],{"class":406},"from",[271,442,424],{"class":410},[271,444,255],{"class":369},[271,446,430],{"class":410},[271,448,449],{"class":273,"line":287},[271,450,284],{"emptyLinePlaceholder":283},[271,452,453,456,459,462,465],{"class":273,"line":293},[271,454,455],{"class":406},"export",[271,457,458],{"class":406}," default",[271,460,415],{"class":461},"s2Zo4",[271,463,464],{"class":414},"(",[271,466,467],{"class":410},"{\n",[271,469,470,474,476],{"class":273,"line":299},[271,471,473],{"class":472},"swJcz","  experimental",[271,475,348],{"class":410},[271,477,478],{"class":410}," {\n",[271,480,481,484,486,490],{"class":273,"line":305},[271,482,483],{"class":472},"    asyncContext",[271,485,348],{"class":410},[271,487,489],{"class":488},"sfNiH"," true",[271,491,492],{"class":410},",\n",[271,494,495],{"class":273,"line":311},[271,496,497],{"class":410},"  },\n",[271,499,500,503,505],{"class":273,"line":317},[271,501,502],{"class":472},"  modules",[271,504,348],{"class":410},[271,506,507],{"class":414}," [\n",[271,509,510,513,515],{"class":273,"line":323},[271,511,512],{"class":461},"    evlog",[271,514,464],{"class":414},[271,516,467],{"class":410},[271,518,519,522,524,526,529,531,533,536,539],{"class":273,"line":328},[271,520,521],{"class":472},"      env",[271,523,348],{"class":410},[271,525,411],{"class":410},[271,527,528],{"class":472}," service",[271,530,348],{"class":410},[271,532,424],{"class":410},[271,534,535],{"class":369},"my-app",[271,537,538],{"class":410},"'",[271,540,541],{"class":410}," },\n",[271,543,544,547,550],{"class":273,"line":334},[271,545,546],{"class":410},"    }",[271,548,549],{"class":414},")",[271,551,492],{"class":410},[271,553,555,558],{"class":273,"line":554},12,[271,556,557],{"class":414},"  ]",[271,559,492],{"class":410},[271,561,563,566],{"class":273,"line":562},13,[271,564,565],{"class":410},"}",[271,567,568],{"class":414},")\n",[249,570,571,572,575,576,579],{},"Enabling ",[253,573,574],{},"asyncContext"," lets you access the request-scoped logger from anywhere in the call stack via ",[253,577,578],{},"useRequest()",".",[350,581,583],{"id":582},"_3-error-handling-middleware","3. Error handling middleware",[249,585,586,587,590,591,594,595,598,599,602,603,606],{},"TanStack Start has its own error handling layer that runs before Nitro's. To ensure ",[253,588,589],{},"throw createError()"," returns a proper JSON response with ",[253,592,593],{},"why",", ",[253,596,597],{},"fix",", and ",[253,600,601],{},"link",", add the ",[253,604,605],{},"evlogErrorHandler"," middleware to your root route:",[261,608,611],{"className":397,"code":609,"filename":610,"language":399,"meta":267,"style":267},"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",[253,612,613,633,653,672,676,696,705,731,735,741],{"__ignoreMap":267},[271,614,615,617,619,622,624,626,628,631],{"class":273,"line":274},[271,616,407],{"class":406},[271,618,411],{"class":410},[271,620,621],{"class":414}," createRootRoute",[271,623,418],{"class":410},[271,625,421],{"class":406},[271,627,424],{"class":410},[271,629,630],{"class":369},"@tanstack\u002Freact-router",[271,632,430],{"class":410},[271,634,635,637,639,642,644,646,648,651],{"class":273,"line":280},[271,636,407],{"class":406},[271,638,411],{"class":410},[271,640,641],{"class":414}," createMiddleware",[271,643,418],{"class":410},[271,645,421],{"class":406},[271,647,424],{"class":410},[271,649,650],{"class":369},"@tanstack\u002Freact-start",[271,652,430],{"class":410},[271,654,655,657,659,662,664,666,668,670],{"class":273,"line":287},[271,656,407],{"class":406},[271,658,411],{"class":410},[271,660,661],{"class":414}," evlogErrorHandler",[271,663,418],{"class":410},[271,665,421],{"class":406},[271,667,424],{"class":410},[271,669,255],{"class":369},[271,671,430],{"class":410},[271,673,674],{"class":273,"line":293},[271,675,284],{"emptyLinePlaceholder":283},[271,677,678,680,684,687,690,692,694],{"class":273,"line":299},[271,679,455],{"class":406},[271,681,683],{"class":682},"spNyl"," const",[271,685,686],{"class":414}," Route ",[271,688,689],{"class":410},"=",[271,691,621],{"class":461},[271,693,464],{"class":414},[271,695,467],{"class":410},[271,697,698,701,703],{"class":273,"line":305},[271,699,700],{"class":472},"  server",[271,702,348],{"class":410},[271,704,478],{"class":410},[271,706,707,710,712,715,718,721,723,726,729],{"class":273,"line":311},[271,708,709],{"class":472},"    middleware",[271,711,348],{"class":410},[271,713,714],{"class":414}," [",[271,716,717],{"class":461},"createMiddleware",[271,719,720],{"class":414},"()",[271,722,579],{"class":410},[271,724,725],{"class":461},"server",[271,727,728],{"class":414},"(evlogErrorHandler)]",[271,730,492],{"class":410},[271,732,733],{"class":273,"line":317},[271,734,497],{"class":410},[271,736,737],{"class":273,"line":323},[271,738,740],{"class":739},"sHwdD","  \u002F\u002F ... head, shellComponent, etc.\n",[271,742,743,745],{"class":273,"line":328},[271,744,565],{"class":410},[271,746,568],{"class":414},[249,748,749],{},"That's it. evlog automatically captures every request as a wide event with method, path, status, and duration.",[339,751,121],{"id":752},"wide-events",[249,754,755,756,759,760,762,763,766],{},"With ",[253,757,758],{},"experimental.asyncContext: true",", use ",[253,761,578],{}," from ",[253,764,765],{},"nitro\u002Fcontext"," to access the request-scoped logger and build up context progressively:",[261,768,771],{"className":397,"code":769,"filename":770,"language":399,"meta":267,"style":267},"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",[253,772,773,792,811,834,838,864,872,881,899,915,942,946,1001,1029,1073,1078,1107,1113,1119,1124],{"__ignoreMap":267},[271,774,775,777,779,782,784,786,788,790],{"class":273,"line":274},[271,776,407],{"class":406},[271,778,411],{"class":410},[271,780,781],{"class":414}," createFileRoute",[271,783,418],{"class":410},[271,785,421],{"class":406},[271,787,424],{"class":410},[271,789,630],{"class":369},[271,791,430],{"class":410},[271,793,794,796,798,801,803,805,807,809],{"class":273,"line":280},[271,795,407],{"class":406},[271,797,411],{"class":410},[271,799,800],{"class":414}," useRequest",[271,802,418],{"class":410},[271,804,421],{"class":406},[271,806,424],{"class":410},[271,808,765],{"class":369},[271,810,430],{"class":410},[271,812,813,815,818,820,823,825,827,829,832],{"class":273,"line":287},[271,814,407],{"class":406},[271,816,817],{"class":406}," type",[271,819,411],{"class":410},[271,821,822],{"class":414}," RequestLogger",[271,824,418],{"class":410},[271,826,421],{"class":406},[271,828,424],{"class":410},[271,830,831],{"class":369},"evlog",[271,833,430],{"class":410},[271,835,836],{"class":273,"line":293},[271,837,284],{"emptyLinePlaceholder":283},[271,839,840,842,844,846,848,850,852,854,857,859,862],{"class":273,"line":299},[271,841,455],{"class":406},[271,843,683],{"class":682},[271,845,686],{"class":414},[271,847,689],{"class":410},[271,849,781],{"class":461},[271,851,464],{"class":414},[271,853,538],{"class":410},[271,855,856],{"class":369},"\u002Fapi\u002Fhello",[271,858,538],{"class":410},[271,860,861],{"class":414},")(",[271,863,467],{"class":410},[271,865,866,868,870],{"class":273,"line":305},[271,867,700],{"class":472},[271,869,348],{"class":410},[271,871,478],{"class":410},[271,873,874,877,879],{"class":273,"line":311},[271,875,876],{"class":472},"    handlers",[271,878,348],{"class":410},[271,880,478],{"class":410},[271,882,883,886,888,891,894,897],{"class":273,"line":317},[271,884,885],{"class":461},"      GET",[271,887,348],{"class":410},[271,889,890],{"class":682}," async",[271,892,893],{"class":410}," ()",[271,895,896],{"class":682}," =>",[271,898,478],{"class":410},[271,900,901,904,907,910,912],{"class":273,"line":323},[271,902,903],{"class":682},"        const",[271,905,906],{"class":414}," req",[271,908,909],{"class":410}," =",[271,911,800],{"class":461},[271,913,914],{"class":472},"()\n",[271,916,917,919,922,924,926,928,931,933,936,939],{"class":273,"line":328},[271,918,903],{"class":682},[271,920,921],{"class":414}," log",[271,923,909],{"class":410},[271,925,906],{"class":414},[271,927,579],{"class":410},[271,929,930],{"class":414},"context",[271,932,579],{"class":410},[271,934,935],{"class":414},"log",[271,937,938],{"class":406}," as",[271,940,941],{"class":365}," RequestLogger\n",[271,943,944],{"class":273,"line":334},[271,945,284],{"emptyLinePlaceholder":283},[271,947,948,951,953,956,958,961,964,966,968,971,973,975,978,980,983,986,988,990,993,995,997,999],{"class":273,"line":554},[271,949,950],{"class":414},"        log",[271,952,579],{"class":410},[271,954,955],{"class":461},"set",[271,957,464],{"class":472},[271,959,960],{"class":410},"{",[271,962,963],{"class":472}," user",[271,965,348],{"class":410},[271,967,411],{"class":410},[271,969,970],{"class":472}," id",[271,972,348],{"class":410},[271,974,424],{"class":410},[271,976,977],{"class":369},"user_123",[271,979,538],{"class":410},[271,981,982],{"class":410},",",[271,984,985],{"class":472}," plan",[271,987,348],{"class":410},[271,989,424],{"class":410},[271,991,992],{"class":369},"pro",[271,994,538],{"class":410},[271,996,418],{"class":410},[271,998,418],{"class":410},[271,1000,568],{"class":472},[271,1002,1003,1005,1007,1009,1011,1013,1016,1018,1020,1023,1025,1027],{"class":273,"line":562},[271,1004,950],{"class":414},[271,1006,579],{"class":410},[271,1008,955],{"class":461},[271,1010,464],{"class":472},[271,1012,960],{"class":410},[271,1014,1015],{"class":472}," action",[271,1017,348],{"class":410},[271,1019,424],{"class":410},[271,1021,1022],{"class":369},"fetch_profile",[271,1024,538],{"class":410},[271,1026,418],{"class":410},[271,1028,568],{"class":472},[271,1030,1032,1034,1036,1038,1040,1042,1045,1047,1049,1052,1054,1056,1058,1061,1063,1067,1069,1071],{"class":273,"line":1031},14,[271,1033,950],{"class":414},[271,1035,579],{"class":410},[271,1037,955],{"class":461},[271,1039,464],{"class":472},[271,1041,960],{"class":410},[271,1043,1044],{"class":472}," cache",[271,1046,348],{"class":410},[271,1048,411],{"class":410},[271,1050,1051],{"class":472}," hit",[271,1053,348],{"class":410},[271,1055,489],{"class":488},[271,1057,982],{"class":410},[271,1059,1060],{"class":472}," ttl",[271,1062,348],{"class":410},[271,1064,1066],{"class":1065},"sbssI"," 3600",[271,1068,418],{"class":410},[271,1070,418],{"class":410},[271,1072,568],{"class":472},[271,1074,1076],{"class":273,"line":1075},15,[271,1077,284],{"emptyLinePlaceholder":283},[271,1079,1081,1084,1087,1089,1092,1094,1096,1099,1101,1103,1105],{"class":273,"line":1080},16,[271,1082,1083],{"class":406},"        return",[271,1085,1086],{"class":414}," Response",[271,1088,579],{"class":410},[271,1090,1091],{"class":461},"json",[271,1093,464],{"class":472},[271,1095,960],{"class":410},[271,1097,1098],{"class":472}," ok",[271,1100,348],{"class":410},[271,1102,489],{"class":488},[271,1104,418],{"class":410},[271,1106,568],{"class":472},[271,1108,1110],{"class":273,"line":1109},17,[271,1111,1112],{"class":410},"      },\n",[271,1114,1116],{"class":273,"line":1115},18,[271,1117,1118],{"class":410},"    },\n",[271,1120,1122],{"class":273,"line":1121},19,[271,1123,497],{"class":410},[271,1125,1127,1129],{"class":273,"line":1126},20,[271,1128,565],{"class":410},[271,1130,568],{"class":414},[249,1132,1133],{},"All fields are merged into a single wide event emitted when the request completes:",[261,1135,1138],{"className":356,"code":1136,"filename":1137,"language":358,"meta":267,"style":267},"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",[253,1139,1140,1151,1171,1181,1194],{"__ignoreMap":267},[271,1141,1142,1145,1148],{"class":273,"line":274},[271,1143,1144],{"class":365},"14:58:15",[271,1146,1147],{"class":369}," INFO",[271,1149,1150],{"class":414}," [my-app] GET \u002Fapi\u002Fhello 200 in 52ms\n",[271,1152,1153,1156,1159,1162,1165,1168],{"class":273,"line":280},[271,1154,1155],{"class":365},"  ├─",[271,1157,1158],{"class":369}," cache:",[271,1160,1161],{"class":369}," hit=",[271,1163,1164],{"class":410},"true",[271,1166,1167],{"class":369}," ttl=",[271,1169,1170],{"class":1065},"3600\n",[271,1172,1173,1175,1178],{"class":273,"line":287},[271,1174,1155],{"class":365},[271,1176,1177],{"class":369}," action:",[271,1179,1180],{"class":369}," fetch_profile\n",[271,1182,1183,1185,1188,1191],{"class":273,"line":293},[271,1184,1155],{"class":365},[271,1186,1187],{"class":369}," user:",[271,1189,1190],{"class":369}," id=user_123",[271,1192,1193],{"class":369}," plan=pro\n",[271,1195,1196,1199,1202],{"class":273,"line":299},[271,1197,1198],{"class":365},"  └─",[271,1200,1201],{"class":369}," requestId:",[271,1203,1204],{"class":369}," 4a8ff3a8-...\n",[1206,1207,1209,1211,1212,1215],"callout",{"color":1208,"icon":13},"info",[253,1210,578],{}," is an experimental Nitro v3 feature powered by ",[253,1213,1214],{},"AsyncLocalStorage",". It works on Node.js and Bun runtimes.",[339,1217,1219],{"id":1218},"error-handling","Error Handling",[249,1221,1222,1223,1226,1227,594,1229,598,1231,1233],{},"Use ",[253,1224,1225],{},"createError"," for structured errors with ",[253,1228,593],{},[253,1230,597],{},[253,1232,601],{}," fields:",[261,1235,1238],{"className":397,"code":1236,"filename":1237,"language":399,"meta":267,"style":267},"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",[253,1239,1240,1258,1276,1295,1315,1319,1344,1352,1360,1383,1395,1417,1437,1441,1489,1540,1544,1565,1569,1593,1604,1621,1634,1651,1668,1685,1693,1699,1704,1744,1749,1754,1759],{"__ignoreMap":267},[271,1241,1242,1244,1246,1248,1250,1252,1254,1256],{"class":273,"line":274},[271,1243,407],{"class":406},[271,1245,411],{"class":410},[271,1247,781],{"class":414},[271,1249,418],{"class":410},[271,1251,421],{"class":406},[271,1253,424],{"class":410},[271,1255,630],{"class":369},[271,1257,430],{"class":410},[271,1259,1260,1262,1264,1266,1268,1270,1272,1274],{"class":273,"line":280},[271,1261,407],{"class":406},[271,1263,411],{"class":410},[271,1265,800],{"class":414},[271,1267,418],{"class":410},[271,1269,421],{"class":406},[271,1271,424],{"class":410},[271,1273,765],{"class":369},[271,1275,430],{"class":410},[271,1277,1278,1280,1282,1285,1287,1289,1291,1293],{"class":273,"line":287},[271,1279,407],{"class":406},[271,1281,411],{"class":410},[271,1283,1284],{"class":414}," createError",[271,1286,418],{"class":410},[271,1288,421],{"class":406},[271,1290,424],{"class":410},[271,1292,831],{"class":369},[271,1294,430],{"class":410},[271,1296,1297,1299,1301,1303,1305,1307,1309,1311,1313],{"class":273,"line":293},[271,1298,407],{"class":406},[271,1300,817],{"class":406},[271,1302,411],{"class":410},[271,1304,822],{"class":414},[271,1306,418],{"class":410},[271,1308,421],{"class":406},[271,1310,424],{"class":410},[271,1312,831],{"class":369},[271,1314,430],{"class":410},[271,1316,1317],{"class":273,"line":299},[271,1318,284],{"emptyLinePlaceholder":283},[271,1320,1321,1323,1325,1327,1329,1331,1333,1335,1338,1340,1342],{"class":273,"line":305},[271,1322,455],{"class":406},[271,1324,683],{"class":682},[271,1326,686],{"class":414},[271,1328,689],{"class":410},[271,1330,781],{"class":461},[271,1332,464],{"class":414},[271,1334,538],{"class":410},[271,1336,1337],{"class":369},"\u002Fapi\u002Fcheckout",[271,1339,538],{"class":410},[271,1341,861],{"class":414},[271,1343,467],{"class":410},[271,1345,1346,1348,1350],{"class":273,"line":311},[271,1347,700],{"class":472},[271,1349,348],{"class":410},[271,1351,478],{"class":410},[271,1353,1354,1356,1358],{"class":273,"line":317},[271,1355,876],{"class":472},[271,1357,348],{"class":410},[271,1359,478],{"class":410},[271,1361,1362,1365,1367,1369,1372,1376,1379,1381],{"class":273,"line":323},[271,1363,1364],{"class":461},"      POST",[271,1366,348],{"class":410},[271,1368,890],{"class":682},[271,1370,1371],{"class":410}," ({",[271,1373,1375],{"class":1374},"sHdIc"," request",[271,1377,1378],{"class":410}," })",[271,1380,896],{"class":682},[271,1382,478],{"class":410},[271,1384,1385,1387,1389,1391,1393],{"class":273,"line":328},[271,1386,903],{"class":682},[271,1388,906],{"class":414},[271,1390,909],{"class":410},[271,1392,800],{"class":461},[271,1394,914],{"class":472},[271,1396,1397,1399,1401,1403,1405,1407,1409,1411,1413,1415],{"class":273,"line":334},[271,1398,903],{"class":682},[271,1400,921],{"class":414},[271,1402,909],{"class":410},[271,1404,906],{"class":414},[271,1406,579],{"class":410},[271,1408,930],{"class":414},[271,1410,579],{"class":410},[271,1412,935],{"class":414},[271,1414,938],{"class":406},[271,1416,941],{"class":365},[271,1418,1419,1421,1424,1426,1429,1431,1433,1435],{"class":273,"line":554},[271,1420,903],{"class":682},[271,1422,1423],{"class":414}," body",[271,1425,909],{"class":410},[271,1427,1428],{"class":406}," await",[271,1430,1375],{"class":414},[271,1432,579],{"class":410},[271,1434,1091],{"class":461},[271,1436,914],{"class":472},[271,1438,1439],{"class":273,"line":562},[271,1440,284],{"emptyLinePlaceholder":283},[271,1442,1443,1445,1447,1449,1451,1453,1455,1457,1459,1461,1463,1465,1467,1470,1472,1474,1476,1478,1480,1483,1485,1487],{"class":273,"line":1031},[271,1444,950],{"class":414},[271,1446,579],{"class":410},[271,1448,955],{"class":461},[271,1450,464],{"class":472},[271,1452,960],{"class":410},[271,1454,963],{"class":472},[271,1456,348],{"class":410},[271,1458,411],{"class":410},[271,1460,970],{"class":472},[271,1462,348],{"class":410},[271,1464,1423],{"class":414},[271,1466,579],{"class":410},[271,1468,1469],{"class":414},"userId",[271,1471,982],{"class":410},[271,1473,985],{"class":472},[271,1475,348],{"class":410},[271,1477,1423],{"class":414},[271,1479,579],{"class":410},[271,1481,1482],{"class":414},"plan",[271,1484,418],{"class":410},[271,1486,418],{"class":410},[271,1488,568],{"class":472},[271,1490,1491,1493,1495,1497,1499,1501,1504,1506,1508,1511,1513,1515,1517,1520,1522,1525,1527,1529,1531,1534,1536,1538],{"class":273,"line":1075},[271,1492,950],{"class":414},[271,1494,579],{"class":410},[271,1496,955],{"class":461},[271,1498,464],{"class":472},[271,1500,960],{"class":410},[271,1502,1503],{"class":472}," cart",[271,1505,348],{"class":410},[271,1507,411],{"class":410},[271,1509,1510],{"class":472}," items",[271,1512,348],{"class":410},[271,1514,1423],{"class":414},[271,1516,579],{"class":410},[271,1518,1519],{"class":414},"items",[271,1521,982],{"class":410},[271,1523,1524],{"class":472}," total",[271,1526,348],{"class":410},[271,1528,1423],{"class":414},[271,1530,579],{"class":410},[271,1532,1533],{"class":414},"total",[271,1535,418],{"class":410},[271,1537,418],{"class":410},[271,1539,568],{"class":472},[271,1541,1542],{"class":273,"line":1080},[271,1543,284],{"emptyLinePlaceholder":283},[271,1545,1546,1548,1551,1553,1555,1558,1560,1563],{"class":273,"line":1109},[271,1547,903],{"class":682},[271,1549,1550],{"class":414}," result",[271,1552,909],{"class":410},[271,1554,1428],{"class":406},[271,1556,1557],{"class":461}," chargeCard",[271,1559,464],{"class":472},[271,1561,1562],{"class":414},"body",[271,1564,568],{"class":472},[271,1566,1567],{"class":273,"line":1115},[271,1568,284],{"emptyLinePlaceholder":283},[271,1570,1571,1574,1577,1580,1583,1585,1588,1591],{"class":273,"line":1121},[271,1572,1573],{"class":406},"        if",[271,1575,1576],{"class":472}," (",[271,1578,1579],{"class":410},"!",[271,1581,1582],{"class":414},"result",[271,1584,579],{"class":410},[271,1586,1587],{"class":414},"success",[271,1589,1590],{"class":472},") ",[271,1592,467],{"class":410},[271,1594,1595,1598,1600,1602],{"class":273,"line":1126},[271,1596,1597],{"class":406},"          throw",[271,1599,1284],{"class":461},[271,1601,464],{"class":472},[271,1603,467],{"class":410},[271,1605,1607,1610,1612,1614,1617,1619],{"class":273,"line":1606},21,[271,1608,1609],{"class":472},"            message",[271,1611,348],{"class":410},[271,1613,424],{"class":410},[271,1615,1616],{"class":369},"Payment failed",[271,1618,538],{"class":410},[271,1620,492],{"class":410},[271,1622,1624,1627,1629,1632],{"class":273,"line":1623},22,[271,1625,1626],{"class":472},"            status",[271,1628,348],{"class":410},[271,1630,1631],{"class":1065}," 402",[271,1633,492],{"class":410},[271,1635,1637,1640,1642,1644,1647,1649],{"class":273,"line":1636},23,[271,1638,1639],{"class":472},"            why",[271,1641,348],{"class":410},[271,1643,424],{"class":410},[271,1645,1646],{"class":369},"Card declined by issuer",[271,1648,538],{"class":410},[271,1650,492],{"class":410},[271,1652,1654,1657,1659,1661,1664,1666],{"class":273,"line":1653},24,[271,1655,1656],{"class":472},"            fix",[271,1658,348],{"class":410},[271,1660,424],{"class":410},[271,1662,1663],{"class":369},"Try a different payment method",[271,1665,538],{"class":410},[271,1667,492],{"class":410},[271,1669,1671,1674,1676,1678,1681,1683],{"class":273,"line":1670},25,[271,1672,1673],{"class":472},"            link",[271,1675,348],{"class":410},[271,1677,424],{"class":410},[271,1679,1680],{"class":369},"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined",[271,1682,538],{"class":410},[271,1684,492],{"class":410},[271,1686,1688,1691],{"class":273,"line":1687},26,[271,1689,1690],{"class":410},"          }",[271,1692,568],{"class":472},[271,1694,1696],{"class":273,"line":1695},27,[271,1697,1698],{"class":410},"        }\n",[271,1700,1702],{"class":273,"line":1701},28,[271,1703,284],{"emptyLinePlaceholder":283},[271,1705,1707,1709,1711,1713,1715,1717,1719,1722,1724,1726,1728,1731,1733,1735,1737,1740,1742],{"class":273,"line":1706},29,[271,1708,1083],{"class":406},[271,1710,1086],{"class":414},[271,1712,579],{"class":410},[271,1714,1091],{"class":461},[271,1716,464],{"class":472},[271,1718,960],{"class":410},[271,1720,1721],{"class":472}," success",[271,1723,348],{"class":410},[271,1725,489],{"class":488},[271,1727,982],{"class":410},[271,1729,1730],{"class":472}," orderId",[271,1732,348],{"class":410},[271,1734,1550],{"class":414},[271,1736,579],{"class":410},[271,1738,1739],{"class":414},"orderId",[271,1741,418],{"class":410},[271,1743,568],{"class":472},[271,1745,1747],{"class":273,"line":1746},30,[271,1748,1112],{"class":410},[271,1750,1752],{"class":273,"line":1751},31,[271,1753,1118],{"class":410},[271,1755,1757],{"class":273,"line":1756},32,[271,1758,497],{"class":410},[271,1760,1762,1764],{"class":273,"line":1761},33,[271,1763,565],{"class":410},[271,1765,568],{"class":414},[249,1767,1768],{},"The error is captured and logged with both the custom context and structured error fields:",[261,1770,1772],{"className":356,"code":1771,"filename":1137,"language":358,"meta":267,"style":267},"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",[253,1773,1774,1785,1807,1826,1836],{"__ignoreMap":267},[271,1775,1776,1779,1782],{"class":273,"line":274},[271,1777,1778],{"class":365},"14:58:20",[271,1780,1781],{"class":369}," ERROR",[271,1783,1784],{"class":414}," [my-app] POST \u002Fapi\u002Fcheckout 402 in 104ms\n",[271,1786,1787,1789,1792,1795,1798,1801,1804],{"class":273,"line":280},[271,1788,1155],{"class":365},[271,1790,1791],{"class":369}," error:",[271,1793,1794],{"class":369}," name=EvlogError",[271,1796,1797],{"class":369}," message=Payment",[271,1799,1800],{"class":369}," failed",[271,1802,1803],{"class":369}," status=",[271,1805,1806],{"class":1065},"402\n",[271,1808,1809,1811,1814,1817,1820,1823],{"class":273,"line":287},[271,1810,1155],{"class":365},[271,1812,1813],{"class":369}," cart:",[271,1815,1816],{"class":369}," items=",[271,1818,1819],{"class":1065},"3",[271,1821,1822],{"class":369}," total=",[271,1824,1825],{"class":1065},"9999\n",[271,1827,1828,1830,1832,1834],{"class":273,"line":293},[271,1829,1155],{"class":365},[271,1831,1187],{"class":369},[271,1833,1190],{"class":369},[271,1835,1193],{"class":369},[271,1837,1838,1840,1842],{"class":273,"line":299},[271,1839,1198],{"class":365},[271,1841,1201],{"class":369},[271,1843,1844],{"class":369}," 880a50ac-...\n",[350,1846,1848],{"id":1847},"parsing-errors-on-the-client","Parsing Errors on the Client",[249,1850,1222,1851,1854],{},[253,1852,1853],{},"parseError"," to extract the structured fields from any error response:",[261,1856,1860],{"className":1857,"code":1858,"language":1859,"meta":267,"style":267},"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","tsx",[253,1861,1862,1881,1885,1892,1919,1935,1971,1978,2034,2046,2087],{"__ignoreMap":267},[271,1863,1864,1866,1868,1871,1873,1875,1877,1879],{"class":273,"line":274},[271,1865,407],{"class":406},[271,1867,411],{"class":410},[271,1869,1870],{"class":414}," parseError",[271,1872,418],{"class":410},[271,1874,421],{"class":406},[271,1876,424],{"class":410},[271,1878,831],{"class":369},[271,1880,430],{"class":410},[271,1882,1883],{"class":273,"line":280},[271,1884,284],{"emptyLinePlaceholder":283},[271,1886,1887,1890],{"class":273,"line":287},[271,1888,1889],{"class":406},"try",[271,1891,478],{"class":410},[271,1893,1894,1897,1900,1902,1904,1907,1909,1911,1913,1915,1917],{"class":273,"line":293},[271,1895,1896],{"class":682},"  const",[271,1898,1899],{"class":414}," res",[271,1901,909],{"class":410},[271,1903,1428],{"class":406},[271,1905,1906],{"class":461}," fetch",[271,1908,464],{"class":472},[271,1910,538],{"class":410},[271,1912,1337],{"class":369},[271,1914,538],{"class":410},[271,1916,982],{"class":410},[271,1918,478],{"class":410},[271,1920,1921,1924,1926,1928,1931,1933],{"class":273,"line":299},[271,1922,1923],{"class":472},"    method",[271,1925,348],{"class":410},[271,1927,424],{"class":410},[271,1929,1930],{"class":369},"POST",[271,1932,538],{"class":410},[271,1934,492],{"class":410},[271,1936,1937,1940,1942,1945,1947,1950,1952,1954,1957,1959,1961,1963,1965,1967,1969],{"class":273,"line":305},[271,1938,1939],{"class":472},"    body",[271,1941,348],{"class":410},[271,1943,1944],{"class":414}," JSON",[271,1946,579],{"class":410},[271,1948,1949],{"class":461},"stringify",[271,1951,464],{"class":472},[271,1953,960],{"class":410},[271,1955,1956],{"class":472}," userId",[271,1958,348],{"class":410},[271,1960,424],{"class":410},[271,1962,977],{"class":369},[271,1964,538],{"class":410},[271,1966,418],{"class":410},[271,1968,549],{"class":472},[271,1970,492],{"class":410},[271,1972,1973,1976],{"class":273,"line":311},[271,1974,1975],{"class":410},"  }",[271,1977,568],{"class":472},[271,1979,1980,1983,1985,1987,1990,1992,1995,1997,2000,2002,2005,2007,2009,2011,2013,2015,2017,2019,2022,2024,2026,2028,2031],{"class":273,"line":317},[271,1981,1982],{"class":406},"  if",[271,1984,1576],{"class":472},[271,1986,1579],{"class":410},[271,1988,1989],{"class":414},"res",[271,1991,579],{"class":410},[271,1993,1994],{"class":414},"ok",[271,1996,1590],{"class":472},[271,1998,1999],{"class":406},"throw",[271,2001,411],{"class":410},[271,2003,2004],{"class":472}," data",[271,2006,348],{"class":410},[271,2008,1428],{"class":406},[271,2010,1899],{"class":414},[271,2012,579],{"class":410},[271,2014,1091],{"class":461},[271,2016,720],{"class":472},[271,2018,982],{"class":410},[271,2020,2021],{"class":472}," status",[271,2023,348],{"class":410},[271,2025,1899],{"class":414},[271,2027,579],{"class":410},[271,2029,2030],{"class":414},"status",[271,2032,2033],{"class":410}," }\n",[271,2035,2036,2038,2041,2044],{"class":273,"line":323},[271,2037,565],{"class":410},[271,2039,2040],{"class":406}," catch",[271,2042,2043],{"class":414}," (error) ",[271,2045,467],{"class":410},[271,2047,2048,2050,2052,2055,2057,2059,2061,2064,2066,2069,2071,2074,2076,2078,2080,2082,2085],{"class":273,"line":328},[271,2049,1896],{"class":682},[271,2051,411],{"class":410},[271,2053,2054],{"class":414}," message",[271,2056,982],{"class":410},[271,2058,2021],{"class":414},[271,2060,982],{"class":410},[271,2062,2063],{"class":414}," why",[271,2065,982],{"class":410},[271,2067,2068],{"class":414}," fix",[271,2070,982],{"class":410},[271,2072,2073],{"class":414}," link",[271,2075,418],{"class":410},[271,2077,909],{"class":410},[271,2079,1870],{"class":461},[271,2081,464],{"class":472},[271,2083,2084],{"class":414},"error",[271,2086,568],{"class":472},[271,2088,2089],{"class":273,"line":334},[271,2090,2091],{"class":410},"}\n",[339,2093,150],{"id":2094},"configuration",[249,2096,2097,2098,2102,2103,2106],{},"See the ",[2099,2100,2101],"a",{"href":151},"Configuration reference"," for all available options (",[253,2104,2105],{},"initLogger",", middleware options, sampling, silent mode, etc.).",[339,2108,2110],{"id":2109},"drain-enrichers","Drain & Enrichers",[249,2112,2113,2114,2117],{},"Since TanStack Start uses Nitro v3, configure drains and enrichers via Nitro plugins. Create a ",[253,2115,2116],{},"server\u002Fplugins\u002F"," directory and register hooks:",[261,2119,2122],{"className":397,"code":2120,"filename":2121,"language":399,"meta":267,"style":267},"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",[253,2123,2124,2143,2163,2167,2188,2201,2205,2235],{"__ignoreMap":267},[271,2125,2126,2128,2130,2133,2135,2137,2139,2141],{"class":273,"line":274},[271,2127,407],{"class":406},[271,2129,411],{"class":410},[271,2131,2132],{"class":414}," definePlugin",[271,2134,418],{"class":410},[271,2136,421],{"class":406},[271,2138,424],{"class":410},[271,2140,427],{"class":369},[271,2142,430],{"class":410},[271,2144,2145,2147,2149,2152,2154,2156,2158,2161],{"class":273,"line":280},[271,2146,407],{"class":406},[271,2148,411],{"class":410},[271,2150,2151],{"class":414}," createAxiomDrain",[271,2153,418],{"class":410},[271,2155,421],{"class":406},[271,2157,424],{"class":410},[271,2159,2160],{"class":369},"evlog\u002Faxiom",[271,2162,430],{"class":410},[271,2164,2165],{"class":273,"line":287},[271,2166,284],{"emptyLinePlaceholder":283},[271,2168,2169,2171,2173,2175,2177,2179,2182,2184,2186],{"class":273,"line":293},[271,2170,455],{"class":406},[271,2172,458],{"class":406},[271,2174,2132],{"class":461},[271,2176,464],{"class":414},[271,2178,464],{"class":410},[271,2180,2181],{"class":1374},"nitroApp",[271,2183,549],{"class":410},[271,2185,896],{"class":682},[271,2187,478],{"class":410},[271,2189,2190,2192,2195,2197,2199],{"class":273,"line":299},[271,2191,1896],{"class":682},[271,2193,2194],{"class":414}," axiom",[271,2196,909],{"class":410},[271,2198,2151],{"class":461},[271,2200,914],{"class":472},[271,2202,2203],{"class":273,"line":305},[271,2204,284],{"emptyLinePlaceholder":283},[271,2206,2207,2210,2212,2215,2217,2220,2222,2224,2227,2229,2231,2233],{"class":273,"line":311},[271,2208,2209],{"class":414},"  nitroApp",[271,2211,579],{"class":410},[271,2213,2214],{"class":414},"hooks",[271,2216,579],{"class":410},[271,2218,2219],{"class":461},"hook",[271,2221,464],{"class":472},[271,2223,538],{"class":410},[271,2225,2226],{"class":369},"evlog:drain",[271,2228,538],{"class":410},[271,2230,982],{"class":410},[271,2232,2194],{"class":414},[271,2234,568],{"class":472},[271,2236,2237,2239],{"class":273,"line":317},[271,2238,565],{"class":410},[271,2240,568],{"class":414},[261,2242,2245],{"className":397,"code":2243,"filename":2244,"language":399,"meta":267,"style":267},"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",[253,2246,2247,2265,2290,2294,2314,2337,2341,2375,2404,2410],{"__ignoreMap":267},[271,2248,2249,2251,2253,2255,2257,2259,2261,2263],{"class":273,"line":274},[271,2250,407],{"class":406},[271,2252,411],{"class":410},[271,2254,2132],{"class":414},[271,2256,418],{"class":410},[271,2258,421],{"class":406},[271,2260,424],{"class":410},[271,2262,427],{"class":369},[271,2264,430],{"class":410},[271,2266,2267,2269,2271,2274,2276,2279,2281,2283,2285,2288],{"class":273,"line":280},[271,2268,407],{"class":406},[271,2270,411],{"class":410},[271,2272,2273],{"class":414}," createUserAgentEnricher",[271,2275,982],{"class":410},[271,2277,2278],{"class":414}," createRequestSizeEnricher",[271,2280,418],{"class":410},[271,2282,421],{"class":406},[271,2284,424],{"class":410},[271,2286,2287],{"class":369},"evlog\u002Fenrichers",[271,2289,430],{"class":410},[271,2291,2292],{"class":273,"line":287},[271,2293,284],{"emptyLinePlaceholder":283},[271,2295,2296,2298,2300,2302,2304,2306,2308,2310,2312],{"class":273,"line":293},[271,2297,455],{"class":406},[271,2299,458],{"class":406},[271,2301,2132],{"class":461},[271,2303,464],{"class":414},[271,2305,464],{"class":410},[271,2307,2181],{"class":1374},[271,2309,549],{"class":410},[271,2311,896],{"class":682},[271,2313,478],{"class":410},[271,2315,2316,2318,2321,2323,2325,2328,2330,2332,2334],{"class":273,"line":299},[271,2317,1896],{"class":682},[271,2319,2320],{"class":414}," enrichers",[271,2322,909],{"class":410},[271,2324,714],{"class":472},[271,2326,2327],{"class":461},"createUserAgentEnricher",[271,2329,720],{"class":472},[271,2331,982],{"class":410},[271,2333,2278],{"class":461},[271,2335,2336],{"class":472},"()]\n",[271,2338,2339],{"class":273,"line":305},[271,2340,284],{"emptyLinePlaceholder":283},[271,2342,2343,2345,2347,2349,2351,2353,2355,2357,2360,2362,2364,2366,2369,2371,2373],{"class":273,"line":311},[271,2344,2209],{"class":414},[271,2346,579],{"class":410},[271,2348,2214],{"class":414},[271,2350,579],{"class":410},[271,2352,2219],{"class":461},[271,2354,464],{"class":472},[271,2356,538],{"class":410},[271,2358,2359],{"class":369},"evlog:enrich",[271,2361,538],{"class":410},[271,2363,982],{"class":410},[271,2365,1576],{"class":410},[271,2367,2368],{"class":1374},"ctx",[271,2370,549],{"class":410},[271,2372,896],{"class":682},[271,2374,478],{"class":410},[271,2376,2377,2380,2382,2385,2388,2391,2393,2395,2398,2400,2402],{"class":273,"line":317},[271,2378,2379],{"class":406},"    for",[271,2381,1576],{"class":472},[271,2383,2384],{"class":682},"const",[271,2386,2387],{"class":414}," enricher",[271,2389,2390],{"class":410}," of",[271,2392,2320],{"class":414},[271,2394,1590],{"class":472},[271,2396,2397],{"class":461},"enricher",[271,2399,464],{"class":472},[271,2401,2368],{"class":414},[271,2403,568],{"class":472},[271,2405,2406,2408],{"class":273,"line":323},[271,2407,1975],{"class":410},[271,2409,568],{"class":472},[271,2411,2412,2414],{"class":273,"line":328},[271,2413,565],{"class":410},[271,2415,568],{"class":414},[1206,2417,2097,2418,2420,2421,2423],{"color":1208,"icon":13},[2099,2419,160],{"href":165}," and ",[2099,2422,214],{"href":219}," docs for all available drain adapters and enrichers.",[339,2425,2427],{"id":2426},"run-locally","Run Locally",[261,2429,2431],{"className":356,"code":2430,"language":358,"meta":267,"style":267},"git clone https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog.git\ncd evlog\u002Fexamples\u002Ftanstack-start\nbun install\nbun run dev\n",[253,2432,2433,2444,2452,2459],{"__ignoreMap":267},[271,2434,2435,2438,2441],{"class":273,"line":274},[271,2436,2437],{"class":365},"git",[271,2439,2440],{"class":369}," clone",[271,2442,2443],{"class":369}," https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog.git\n",[271,2445,2446,2449],{"class":273,"line":280},[271,2447,2448],{"class":461},"cd",[271,2450,2451],{"class":369}," evlog\u002Fexamples\u002Ftanstack-start\n",[271,2453,2454,2456],{"class":273,"line":287},[271,2455,366],{"class":365},[271,2457,2458],{"class":369}," install\n",[271,2460,2461,2463,2466],{"class":273,"line":293},[271,2462,366],{"class":365},[271,2464,2465],{"class":369}," run",[271,2467,2468],{"class":369}," dev\n",[249,2470,2471,2472,2477],{},"Open ",[2099,2473,2474],{"href":2474,"rel":2475},"http:\u002F\u002Flocalhost:3000",[2476],"nofollow"," and navigate to the evlog Demo page to test the API endpoints.",[2479,2480,2481],"card-group",{},[2482,2483,2487],"card",{"icon":2484,"title":2485,"to":2486},"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.",[2489,2490,2491],"style",{},"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 .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 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":267,"searchDepth":280,"depth":280,"links":2493},[2494,2500,2501,2504,2505,2506],{"id":341,"depth":280,"text":20,"children":2495},[2496,2497,2499],{"id":352,"depth":287,"text":353},{"id":376,"depth":287,"text":2498},"2. Add nitro.config.ts",{"id":582,"depth":287,"text":583},{"id":752,"depth":280,"text":121},{"id":1218,"depth":280,"text":1219,"children":2502},[2503],{"id":1847,"depth":287,"text":1848},{"id":2094,"depth":280,"text":150},{"id":2109,"depth":280,"text":2110},{"id":2426,"depth":280,"text":2427},"Automatic wide events, structured errors, and logging in TanStack Start API routes and server functions.","md",[2510],{"label":2485,"icon":2484,"to":2486,"color":2511,"variant":2512},"neutral","subtle",{},{"title":61,"icon":64},{"title":61,"description":2507},"U8mzKylegDsvpj7Ikf_pDQdEwIFR18Hh7bete4lYnTU",[2518,2520],{"title":56,"path":57,"stem":58,"description":2519,"icon":59,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in Nitro v2 and v3 applications.",{"title":66,"path":67,"stem":68,"description":2521,"icon":69,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in NestJS applications.",1773505333473]