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