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