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