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