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