[{"data":1,"prerenderedAt":3576},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-nestjs":301,"-frameworks-nestjs-surround":3571},[4,30,75,119,207,271,287],{"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,65,70],{"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,"icon":69},"Better Auth Integration","\u002Flogging\u002Fbetter-auth","2.logging\u002F6.better-auth","i-simple-icons-betterauth",{"title":71,"path":72,"stem":73,"icon":74},"Audit Logs","\u002Flogging\u002Faudit","2.logging\u002F7.audit","i-lucide-shield-check",{"title":76,"path":77,"stem":78,"children":79,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[80,85,90,95,100,104,109,114],{"title":81,"path":82,"stem":83,"icon":84},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":86,"path":87,"stem":88,"icon":89},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":91,"path":92,"stem":93,"icon":94},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":96,"path":97,"stem":98,"icon":99},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":101,"path":102,"stem":103,"icon":74},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":105,"path":106,"stem":107,"icon":108},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance","i-lucide-gauge",{"title":110,"path":111,"stem":112,"icon":113},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":115,"path":116,"stem":117,"icon":118},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":120,"path":121,"stem":122,"children":123,"page":29},"Frameworks","\u002Fframeworks","4.frameworks",[124,128,133,138,143,148,153,158,163,168,173,178,183,188,192,197,202],{"title":36,"path":125,"stem":126,"icon":127},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":129,"path":130,"stem":131,"icon":132},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":134,"path":135,"stem":136,"icon":137},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":139,"path":140,"stem":141,"icon":142},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":144,"path":145,"stem":146,"icon":147},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":149,"path":150,"stem":151,"icon":152},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":154,"path":155,"stem":156,"icon":157},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":159,"path":160,"stem":161,"icon":162},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":164,"path":165,"stem":166,"icon":167},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":169,"path":170,"stem":171,"icon":172},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":174,"path":175,"stem":176,"icon":177},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":179,"path":180,"stem":181,"icon":182},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":184,"path":185,"stem":186,"icon":187},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":189,"path":190,"stem":191,"icon":99},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":193,"path":194,"stem":195,"icon":196},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":198,"path":199,"stem":200,"icon":201},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F15.custom-integration","i-lucide-puzzle",{"title":203,"path":204,"stem":205,"icon":206},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":208,"path":209,"stem":210,"children":211,"page":29},"Adapters","\u002Fadapters","5.adapters",[212,216,221,226,231,236,241,246,251,256,261,266],{"title":36,"path":213,"stem":214,"icon":215},"\u002Fadapters\u002Foverview","5.adapters\u002F1.overview","i-custom-plug",{"title":217,"path":218,"stem":219,"icon":220},"Custom Adapters","\u002Fadapters\u002Fcustom","5.adapters\u002F10.custom","i-lucide-code",{"title":222,"path":223,"stem":224,"icon":225},"Pipeline","\u002Fadapters\u002Fpipeline","5.adapters\u002F11.pipeline","i-lucide-workflow",{"title":227,"path":228,"stem":229,"icon":230},"HTTP","\u002Fadapters\u002Fhttp","5.adapters\u002F12.http","i-lucide-globe",{"title":232,"path":233,"stem":234,"icon":235},"Axiom","\u002Fadapters\u002Faxiom","5.adapters\u002F2.axiom","i-custom-axiom",{"title":237,"path":238,"stem":239,"icon":240},"OTLP","\u002Fadapters\u002Fotlp","5.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":242,"path":243,"stem":244,"icon":245},"PostHog","\u002Fadapters\u002Fposthog","5.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":247,"path":248,"stem":249,"icon":250},"Sentry","\u002Fadapters\u002Fsentry","5.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":252,"path":253,"stem":254,"icon":255},"Better Stack","\u002Fadapters\u002Fbetter-stack","5.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":257,"path":258,"stem":259,"icon":260},"File System","\u002Fadapters\u002Ffs","5.adapters\u002F7.fs","i-lucide-hard-drive",{"title":262,"path":263,"stem":264,"icon":265},"Datadog","\u002Fadapters\u002Fdatadog","5.adapters\u002F8.datadog","i-simple-icons-datadog",{"title":267,"path":268,"stem":269,"icon":270},"HyperDX","\u002Fadapters\u002Fhyperdx","5.adapters\u002F9.hyperdx","i-custom-hyperdx",{"title":272,"path":273,"stem":274,"children":275,"page":29},"Enrichers","\u002Fenrichers","6.enrichers",[276,279,283],{"title":36,"path":277,"stem":278,"icon":28},"\u002Fenrichers\u002Foverview","6.enrichers\u002F1.overview",{"title":280,"path":281,"stem":282,"icon":201},"Built-in","\u002Fenrichers\u002Fbuilt-in","6.enrichers\u002F2.built-in",{"title":284,"path":285,"stem":286,"icon":220},"Custom","\u002Fenrichers\u002Fcustom","6.enrichers\u002F3.custom",{"title":288,"path":289,"stem":290,"children":291,"page":29},"NuxtHub","\u002Fnuxthub","7.nuxthub",[292,296],{"title":36,"path":293,"stem":294,"icon":295},"\u002Fnuxthub\u002Foverview","7.nuxthub\u002F1.overview","i-lucide-database",{"title":297,"path":298,"stem":299,"icon":300},"Retention","\u002Fnuxthub\u002Fretention","7.nuxthub\u002F2.retention","i-lucide-clock",{"id":302,"title":154,"body":303,"description":3561,"extension":3562,"links":3563,"meta":3567,"navigation":3568,"path":155,"seo":3569,"stem":156,"__hash__":3570},"docs\u002F4.frameworks\u002F06.nestjs.md",{"type":304,"value":305,"toc":3540},"minimark",[306,327,408,412,417,447,451,585,589,758,763,766,769,1165,1168,1232,1235,1241,1428,1532,1548,1555,1569,1729,1733,1751,2127,2130,2364,2367,2414,2417,2427,2431,2436,2676,2680,2690,2952,2956,2963,3151,3164,3168,3174,3276,3280,3290,3430,3434,3475,3484,3494,3498,3505,3536],[307,308,309,310,314,315,318,319,322,323,326],"p",{},"The ",[311,312,313],"code",{},"evlog\u002Fnestjs"," module provides ",[311,316,317],{},"EvlogModule.forRoot()"," which registers a global middleware, creating a request-scoped logger accessible via ",[311,320,321],{},"useLogger()"," or ",[311,324,325],{},"req.log",", emitting a wide event when the response completes.",[328,329,330],"code-collapse",{},[331,332,338],"pre",{"className":333,"code":334,"filename":335,"language":336,"meta":337,"style":337},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Set up evlog in my NestJS app.\n\n- Install evlog: pnpm add evlog\n- Import EvlogModule from 'evlog\u002Fnestjs' and add EvlogModule.forRoot() to AppModule imports\n- The global middleware auto-creates a request-scoped logger for every request\n- Use useLogger() in any controller or service to access the logger\n- Use log.set() to accumulate context, throw createError() for structured errors\n- Optionally pass drain, enrich, and keep callbacks to forRoot()\n\nDocs: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Fnestjs\nAdapters: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\n","Prompt","txt","",[311,339,340,348,355,361,367,373,379,385,391,396,402],{"__ignoreMap":337},[341,342,345],"span",{"class":343,"line":344},"line",1,[341,346,347],{},"Set up evlog in my NestJS app.\n",[341,349,351],{"class":343,"line":350},2,[341,352,354],{"emptyLinePlaceholder":353},true,"\n",[341,356,358],{"class":343,"line":357},3,[341,359,360],{},"- Install evlog: pnpm add evlog\n",[341,362,364],{"class":343,"line":363},4,[341,365,366],{},"- Import EvlogModule from 'evlog\u002Fnestjs' and add EvlogModule.forRoot() to AppModule imports\n",[341,368,370],{"class":343,"line":369},5,[341,371,372],{},"- The global middleware auto-creates a request-scoped logger for every request\n",[341,374,376],{"class":343,"line":375},6,[341,377,378],{},"- Use useLogger() in any controller or service to access the logger\n",[341,380,382],{"class":343,"line":381},7,[341,383,384],{},"- Use log.set() to accumulate context, throw createError() for structured errors\n",[341,386,388],{"class":343,"line":387},8,[341,389,390],{},"- Optionally pass drain, enrich, and keep callbacks to forRoot()\n",[341,392,394],{"class":343,"line":393},9,[341,395,354],{"emptyLinePlaceholder":353},[341,397,399],{"class":343,"line":398},10,[341,400,401],{},"Docs: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Fnestjs\n",[341,403,405],{"class":343,"line":404},11,[341,406,407],{},"Adapters: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\n",[409,410,20],"h2",{"id":411},"quick-start",[413,414,416],"h3",{"id":415},"_1-install","1. Install",[331,418,423],{"className":419,"code":420,"filename":421,"language":422,"meta":337,"style":337},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","bun add evlog @nestjs\u002Fcommon @nestjs\u002Fcore @nestjs\u002Fplatform-express\n","Terminal","bash",[311,424,425],{"__ignoreMap":337},[341,426,427,431,435,438,441,444],{"class":343,"line":344},[341,428,430],{"class":429},"sBMFI","bun",[341,432,434],{"class":433},"sfazB"," add",[341,436,437],{"class":433}," evlog",[341,439,440],{"class":433}," @nestjs\u002Fcommon",[341,442,443],{"class":433}," @nestjs\u002Fcore",[341,445,446],{"class":433}," @nestjs\u002Fplatform-express\n",[413,448,450],{"id":449},"_2-register-the-module","2. Register the module",[331,452,457],{"className":453,"code":454,"filename":455,"language":456,"meta":337,"style":337},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Module } from '@nestjs\u002Fcommon'\nimport { EvlogModule } from 'evlog\u002Fnestjs'\n\n@Module({\n  imports: [\n    EvlogModule.forRoot(),\n  ],\n})\nexport class AppModule {}\n","src\u002Fapp.module.ts","typescript",[311,458,459,488,507,511,526,538,555,562,570],{"__ignoreMap":337},[341,460,461,465,469,473,476,479,482,485],{"class":343,"line":344},[341,462,464],{"class":463},"s7zQu","import",[341,466,468],{"class":467},"sMK4o"," {",[341,470,472],{"class":471},"sTEyZ"," Module",[341,474,475],{"class":467}," }",[341,477,478],{"class":463}," from",[341,480,481],{"class":467}," '",[341,483,484],{"class":433},"@nestjs\u002Fcommon",[341,486,487],{"class":467},"'\n",[341,489,490,492,494,497,499,501,503,505],{"class":343,"line":350},[341,491,464],{"class":463},[341,493,468],{"class":467},[341,495,496],{"class":471}," EvlogModule",[341,498,475],{"class":467},[341,500,478],{"class":463},[341,502,481],{"class":467},[341,504,313],{"class":433},[341,506,487],{"class":467},[341,508,509],{"class":343,"line":357},[341,510,354],{"emptyLinePlaceholder":353},[341,512,513,516,520,523],{"class":343,"line":363},[341,514,515],{"class":467},"@",[341,517,519],{"class":518},"s2Zo4","Module",[341,521,522],{"class":471},"(",[341,524,525],{"class":467},"{\n",[341,527,528,532,535],{"class":343,"line":369},[341,529,531],{"class":530},"swJcz","  imports",[341,533,534],{"class":467},":",[341,536,537],{"class":471}," [\n",[341,539,540,543,546,549,552],{"class":343,"line":375},[341,541,542],{"class":471},"    EvlogModule",[341,544,545],{"class":467},".",[341,547,548],{"class":518},"forRoot",[341,550,551],{"class":471},"()",[341,553,554],{"class":467},",\n",[341,556,557,560],{"class":343,"line":381},[341,558,559],{"class":471},"  ]",[341,561,554],{"class":467},[341,563,564,567],{"class":343,"line":387},[341,565,566],{"class":467},"}",[341,568,569],{"class":471},")\n",[341,571,572,575,579,582],{"class":343,"line":393},[341,573,574],{"class":463},"export",[341,576,578],{"class":577},"spNyl"," class",[341,580,581],{"class":429}," AppModule",[341,583,584],{"class":467}," {}\n",[413,586,588],{"id":587},"_3-bootstrap-with-evlog","3. Bootstrap with evlog",[331,590,593],{"className":453,"code":591,"filename":592,"language":456,"meta":337,"style":337},"import 'reflect-metadata'\nimport { NestFactory } from '@nestjs\u002Fcore'\nimport { initLogger } from 'evlog'\nimport { AppModule } from '.\u002Fapp.module'\n\ninitLogger({\n  env: { service: 'my-api' },\n})\n\nconst app = await NestFactory.create(AppModule)\nawait app.listen(3000)\n","src\u002Fmain.ts",[311,594,595,606,626,646,665,669,678,703,709,713,737],{"__ignoreMap":337},[341,596,597,599,601,604],{"class":343,"line":344},[341,598,464],{"class":463},[341,600,481],{"class":467},[341,602,603],{"class":433},"reflect-metadata",[341,605,487],{"class":467},[341,607,608,610,612,615,617,619,621,624],{"class":343,"line":350},[341,609,464],{"class":463},[341,611,468],{"class":467},[341,613,614],{"class":471}," NestFactory",[341,616,475],{"class":467},[341,618,478],{"class":463},[341,620,481],{"class":467},[341,622,623],{"class":433},"@nestjs\u002Fcore",[341,625,487],{"class":467},[341,627,628,630,632,635,637,639,641,644],{"class":343,"line":357},[341,629,464],{"class":463},[341,631,468],{"class":467},[341,633,634],{"class":471}," initLogger",[341,636,475],{"class":467},[341,638,478],{"class":463},[341,640,481],{"class":467},[341,642,643],{"class":433},"evlog",[341,645,487],{"class":467},[341,647,648,650,652,654,656,658,660,663],{"class":343,"line":363},[341,649,464],{"class":463},[341,651,468],{"class":467},[341,653,581],{"class":471},[341,655,475],{"class":467},[341,657,478],{"class":463},[341,659,481],{"class":467},[341,661,662],{"class":433},".\u002Fapp.module",[341,664,487],{"class":467},[341,666,667],{"class":343,"line":369},[341,668,354],{"emptyLinePlaceholder":353},[341,670,671,674,676],{"class":343,"line":375},[341,672,673],{"class":518},"initLogger",[341,675,522],{"class":471},[341,677,525],{"class":467},[341,679,680,683,685,687,690,692,694,697,700],{"class":343,"line":381},[341,681,682],{"class":530},"  env",[341,684,534],{"class":467},[341,686,468],{"class":467},[341,688,689],{"class":530}," service",[341,691,534],{"class":467},[341,693,481],{"class":467},[341,695,696],{"class":433},"my-api",[341,698,699],{"class":467},"'",[341,701,702],{"class":467}," },\n",[341,704,705,707],{"class":343,"line":387},[341,706,566],{"class":467},[341,708,569],{"class":471},[341,710,711],{"class":343,"line":393},[341,712,354],{"emptyLinePlaceholder":353},[341,714,715,718,721,724,727,729,731,734],{"class":343,"line":398},[341,716,717],{"class":577},"const",[341,719,720],{"class":471}," app ",[341,722,723],{"class":467},"=",[341,725,726],{"class":463}," await",[341,728,614],{"class":471},[341,730,545],{"class":467},[341,732,733],{"class":518},"create",[341,735,736],{"class":471},"(AppModule)\n",[341,738,739,742,745,747,750,752,756],{"class":343,"line":404},[341,740,741],{"class":463},"await",[341,743,744],{"class":471}," app",[341,746,545],{"class":467},[341,748,749],{"class":518},"listen",[341,751,522],{"class":471},[341,753,755],{"class":754},"sbssI","3000",[341,757,569],{"class":471},[307,759,760,762],{},[311,761,317],{}," registers as a global module, so the middleware is automatically applied to all routes.",[409,764,46],{"id":765},"wide-events",[307,767,768],{},"Build up context progressively through your controllers and services. One request = one wide event:",[331,770,773],{"className":453,"code":771,"filename":772,"language":456,"meta":337,"style":337},"import { Controller, Get, Param } from '@nestjs\u002Fcommon'\nimport { useLogger } from 'evlog\u002Fnestjs'\n\n@Controller('users')\nexport class UsersController {\n  @Get(':id')\n  async findOne(@Param('id') id: string) {\n    const log = useLogger()\n\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    const orders = await db.findOrders(id)\n    log.set({ orders: { count: orders.length, totalRevenue: sum(orders) } })\n\n    return { user, orders }\n  }\n}\n","src\u002Fusers.controller.ts",[311,774,775,805,824,828,846,858,877,916,932,936,967,971,996,1047,1052,1077,1131,1136,1153,1159],{"__ignoreMap":337},[341,776,777,779,781,784,787,790,792,795,797,799,801,803],{"class":343,"line":344},[341,778,464],{"class":463},[341,780,468],{"class":467},[341,782,783],{"class":471}," Controller",[341,785,786],{"class":467},",",[341,788,789],{"class":471}," Get",[341,791,786],{"class":467},[341,793,794],{"class":471}," Param",[341,796,475],{"class":467},[341,798,478],{"class":463},[341,800,481],{"class":467},[341,802,484],{"class":433},[341,804,487],{"class":467},[341,806,807,809,811,814,816,818,820,822],{"class":343,"line":350},[341,808,464],{"class":463},[341,810,468],{"class":467},[341,812,813],{"class":471}," useLogger",[341,815,475],{"class":467},[341,817,478],{"class":463},[341,819,481],{"class":467},[341,821,313],{"class":433},[341,823,487],{"class":467},[341,825,826],{"class":343,"line":357},[341,827,354],{"emptyLinePlaceholder":353},[341,829,830,832,835,837,839,842,844],{"class":343,"line":363},[341,831,515],{"class":467},[341,833,834],{"class":518},"Controller",[341,836,522],{"class":471},[341,838,699],{"class":467},[341,840,841],{"class":433},"users",[341,843,699],{"class":467},[341,845,569],{"class":471},[341,847,848,850,852,855],{"class":343,"line":369},[341,849,574],{"class":463},[341,851,578],{"class":577},[341,853,854],{"class":429}," UsersController",[341,856,857],{"class":467}," {\n",[341,859,860,863,866,868,870,873,875],{"class":343,"line":375},[341,861,862],{"class":467},"  @",[341,864,865],{"class":518},"Get",[341,867,522],{"class":471},[341,869,699],{"class":467},[341,871,872],{"class":433},":id",[341,874,699],{"class":467},[341,876,569],{"class":471},[341,878,879,882,885,888,891,893,895,898,900,903,906,908,911,914],{"class":343,"line":381},[341,880,881],{"class":577},"  async",[341,883,884],{"class":530}," findOne",[341,886,887],{"class":467},"(@",[341,889,890],{"class":518},"Param",[341,892,522],{"class":471},[341,894,699],{"class":467},[341,896,897],{"class":433},"id",[341,899,699],{"class":467},[341,901,902],{"class":471},") ",[341,904,897],{"class":905},"sHdIc",[341,907,534],{"class":467},[341,909,910],{"class":429}," string",[341,912,913],{"class":467},")",[341,915,857],{"class":467},[341,917,918,921,924,927,929],{"class":343,"line":387},[341,919,920],{"class":577},"    const",[341,922,923],{"class":471}," log",[341,925,926],{"class":467}," =",[341,928,813],{"class":518},[341,930,931],{"class":530},"()\n",[341,933,934],{"class":343,"line":393},[341,935,354],{"emptyLinePlaceholder":353},[341,937,938,941,943,946,948,951,954,956,958,961,963,965],{"class":343,"line":398},[341,939,940],{"class":471},"    log",[341,942,545],{"class":467},[341,944,945],{"class":518},"set",[341,947,522],{"class":530},[341,949,950],{"class":467},"{",[341,952,953],{"class":530}," user",[341,955,534],{"class":467},[341,957,468],{"class":467},[341,959,960],{"class":471}," id",[341,962,475],{"class":467},[341,964,475],{"class":467},[341,966,569],{"class":530},[341,968,969],{"class":343,"line":404},[341,970,354],{"emptyLinePlaceholder":353},[341,972,974,976,978,980,982,985,987,990,992,994],{"class":343,"line":973},12,[341,975,920],{"class":577},[341,977,953],{"class":471},[341,979,926],{"class":467},[341,981,726],{"class":463},[341,983,984],{"class":471}," db",[341,986,545],{"class":467},[341,988,989],{"class":518},"findUser",[341,991,522],{"class":530},[341,993,897],{"class":471},[341,995,569],{"class":530},[341,997,999,1001,1003,1005,1007,1009,1011,1013,1015,1018,1020,1022,1024,1027,1029,1032,1034,1036,1038,1041,1043,1045],{"class":343,"line":998},13,[341,1000,940],{"class":471},[341,1002,545],{"class":467},[341,1004,945],{"class":518},[341,1006,522],{"class":530},[341,1008,950],{"class":467},[341,1010,953],{"class":530},[341,1012,534],{"class":467},[341,1014,468],{"class":467},[341,1016,1017],{"class":530}," name",[341,1019,534],{"class":467},[341,1021,953],{"class":471},[341,1023,545],{"class":467},[341,1025,1026],{"class":471},"name",[341,1028,786],{"class":467},[341,1030,1031],{"class":530}," plan",[341,1033,534],{"class":467},[341,1035,953],{"class":471},[341,1037,545],{"class":467},[341,1039,1040],{"class":471},"plan",[341,1042,475],{"class":467},[341,1044,475],{"class":467},[341,1046,569],{"class":530},[341,1048,1050],{"class":343,"line":1049},14,[341,1051,354],{"emptyLinePlaceholder":353},[341,1053,1055,1057,1060,1062,1064,1066,1068,1071,1073,1075],{"class":343,"line":1054},15,[341,1056,920],{"class":577},[341,1058,1059],{"class":471}," orders",[341,1061,926],{"class":467},[341,1063,726],{"class":463},[341,1065,984],{"class":471},[341,1067,545],{"class":467},[341,1069,1070],{"class":518},"findOrders",[341,1072,522],{"class":530},[341,1074,897],{"class":471},[341,1076,569],{"class":530},[341,1078,1080,1082,1084,1086,1088,1090,1092,1094,1096,1099,1101,1103,1105,1108,1110,1113,1115,1118,1120,1123,1125,1127,1129],{"class":343,"line":1079},16,[341,1081,940],{"class":471},[341,1083,545],{"class":467},[341,1085,945],{"class":518},[341,1087,522],{"class":530},[341,1089,950],{"class":467},[341,1091,1059],{"class":530},[341,1093,534],{"class":467},[341,1095,468],{"class":467},[341,1097,1098],{"class":530}," count",[341,1100,534],{"class":467},[341,1102,1059],{"class":471},[341,1104,545],{"class":467},[341,1106,1107],{"class":471},"length",[341,1109,786],{"class":467},[341,1111,1112],{"class":530}," totalRevenue",[341,1114,534],{"class":467},[341,1116,1117],{"class":518}," sum",[341,1119,522],{"class":530},[341,1121,1122],{"class":471},"orders",[341,1124,902],{"class":530},[341,1126,566],{"class":467},[341,1128,475],{"class":467},[341,1130,569],{"class":530},[341,1132,1134],{"class":343,"line":1133},17,[341,1135,354],{"emptyLinePlaceholder":353},[341,1137,1139,1142,1144,1146,1148,1150],{"class":343,"line":1138},18,[341,1140,1141],{"class":463},"    return",[341,1143,468],{"class":467},[341,1145,953],{"class":471},[341,1147,786],{"class":467},[341,1149,1059],{"class":471},[341,1151,1152],{"class":467}," }\n",[341,1154,1156],{"class":343,"line":1155},19,[341,1157,1158],{"class":467},"  }\n",[341,1160,1162],{"class":343,"line":1161},20,[341,1163,1164],{"class":467},"}\n",[307,1166,1167],{},"All fields are merged into a single wide event emitted when the request completes:",[331,1169,1172],{"className":419,"code":1170,"filename":1171,"language":422,"meta":337,"style":337},"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",[311,1173,1174,1185,1205,1221],{"__ignoreMap":337},[341,1175,1176,1179,1182],{"class":343,"line":344},[341,1177,1178],{"class":429},"14:58:15",[341,1180,1181],{"class":433}," INFO",[341,1183,1184],{"class":471}," [my-api] GET \u002Fusers\u002Fusr_123 200 in 12ms\n",[341,1186,1187,1190,1193,1196,1199,1202],{"class":343,"line":350},[341,1188,1189],{"class":429},"  ├─",[341,1191,1192],{"class":433}," orders:",[341,1194,1195],{"class":433}," count=",[341,1197,1198],{"class":754},"2",[341,1200,1201],{"class":433}," totalRevenue=",[341,1203,1204],{"class":754},"6298\n",[341,1206,1207,1209,1212,1215,1218],{"class":343,"line":357},[341,1208,1189],{"class":429},[341,1210,1211],{"class":433}," user:",[341,1213,1214],{"class":433}," id=usr_123",[341,1216,1217],{"class":433}," name=Alice",[341,1219,1220],{"class":433}," plan=pro\n",[341,1222,1223,1226,1229],{"class":343,"line":363},[341,1224,1225],{"class":429},"  └─",[341,1227,1228],{"class":433}," requestId:",[341,1230,1231],{"class":433}," 4a8ff3a8-...\n",[409,1233,321],{"id":1234},"uselogger",[307,1236,1237,1238,1240],{},"Use ",[311,1239,321],{}," to access the request-scoped logger from anywhere in the call stack without injecting the request object through your service layer:",[331,1242,1245],{"className":453,"code":1243,"filename":1244,"language":456,"meta":337,"style":337},"import { useLogger } from 'evlog\u002Fnestjs'\n\nexport class UsersService {\n  async 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}\n","src\u002Fusers.service.ts",[311,1246,1247,1265,1269,1280,1299,1311,1337,1341,1363,1409,1413,1420,1424],{"__ignoreMap":337},[341,1248,1249,1251,1253,1255,1257,1259,1261,1263],{"class":343,"line":344},[341,1250,464],{"class":463},[341,1252,468],{"class":467},[341,1254,813],{"class":471},[341,1256,475],{"class":467},[341,1258,478],{"class":463},[341,1260,481],{"class":467},[341,1262,313],{"class":433},[341,1264,487],{"class":467},[341,1266,1267],{"class":343,"line":350},[341,1268,354],{"emptyLinePlaceholder":353},[341,1270,1271,1273,1275,1278],{"class":343,"line":357},[341,1272,574],{"class":463},[341,1274,578],{"class":577},[341,1276,1277],{"class":429}," UsersService",[341,1279,857],{"class":467},[341,1281,1282,1284,1287,1289,1291,1293,1295,1297],{"class":343,"line":363},[341,1283,881],{"class":577},[341,1285,1286],{"class":530}," findUser",[341,1288,522],{"class":467},[341,1290,897],{"class":905},[341,1292,534],{"class":467},[341,1294,910],{"class":429},[341,1296,913],{"class":467},[341,1298,857],{"class":467},[341,1300,1301,1303,1305,1307,1309],{"class":343,"line":369},[341,1302,920],{"class":577},[341,1304,923],{"class":471},[341,1306,926],{"class":467},[341,1308,813],{"class":518},[341,1310,931],{"class":530},[341,1312,1313,1315,1317,1319,1321,1323,1325,1327,1329,1331,1333,1335],{"class":343,"line":375},[341,1314,940],{"class":471},[341,1316,545],{"class":467},[341,1318,945],{"class":518},[341,1320,522],{"class":530},[341,1322,950],{"class":467},[341,1324,953],{"class":530},[341,1326,534],{"class":467},[341,1328,468],{"class":467},[341,1330,960],{"class":471},[341,1332,475],{"class":467},[341,1334,475],{"class":467},[341,1336,569],{"class":530},[341,1338,1339],{"class":343,"line":381},[341,1340,354],{"emptyLinePlaceholder":353},[341,1342,1343,1345,1347,1349,1351,1353,1355,1357,1359,1361],{"class":343,"line":387},[341,1344,920],{"class":577},[341,1346,953],{"class":471},[341,1348,926],{"class":467},[341,1350,726],{"class":463},[341,1352,984],{"class":471},[341,1354,545],{"class":467},[341,1356,989],{"class":518},[341,1358,522],{"class":530},[341,1360,897],{"class":471},[341,1362,569],{"class":530},[341,1364,1365,1367,1369,1371,1373,1375,1377,1379,1381,1383,1385,1387,1389,1391,1393,1395,1397,1399,1401,1403,1405,1407],{"class":343,"line":393},[341,1366,940],{"class":471},[341,1368,545],{"class":467},[341,1370,945],{"class":518},[341,1372,522],{"class":530},[341,1374,950],{"class":467},[341,1376,953],{"class":530},[341,1378,534],{"class":467},[341,1380,468],{"class":467},[341,1382,1017],{"class":530},[341,1384,534],{"class":467},[341,1386,953],{"class":471},[341,1388,545],{"class":467},[341,1390,1026],{"class":471},[341,1392,786],{"class":467},[341,1394,1031],{"class":530},[341,1396,534],{"class":467},[341,1398,953],{"class":471},[341,1400,545],{"class":467},[341,1402,1040],{"class":471},[341,1404,475],{"class":467},[341,1406,475],{"class":467},[341,1408,569],{"class":530},[341,1410,1411],{"class":343,"line":398},[341,1412,354],{"emptyLinePlaceholder":353},[341,1414,1415,1417],{"class":343,"line":404},[341,1416,1141],{"class":463},[341,1418,1419],{"class":471}," user\n",[341,1421,1422],{"class":343,"line":973},[341,1423,1158],{"class":467},[341,1425,1426],{"class":343,"line":998},[341,1427,1164],{"class":467},[331,1429,1431],{"className":453,"code":1430,"filename":772,"language":456,"meta":337,"style":337},"@Controller('users')\nexport class UsersController {\n  @Get(':id')\n  findOne(@Param('id') id: string) {\n    return this.usersService.findUser(id)\n  }\n}\n",[311,1432,1433,1449,1459,1475,1504,1524,1528],{"__ignoreMap":337},[341,1434,1435,1437,1439,1441,1443,1445,1447],{"class":343,"line":344},[341,1436,515],{"class":467},[341,1438,834],{"class":518},[341,1440,522],{"class":471},[341,1442,699],{"class":467},[341,1444,841],{"class":433},[341,1446,699],{"class":467},[341,1448,569],{"class":471},[341,1450,1451,1453,1455,1457],{"class":343,"line":350},[341,1452,574],{"class":463},[341,1454,578],{"class":577},[341,1456,854],{"class":429},[341,1458,857],{"class":467},[341,1460,1461,1463,1465,1467,1469,1471,1473],{"class":343,"line":357},[341,1462,862],{"class":467},[341,1464,865],{"class":518},[341,1466,522],{"class":471},[341,1468,699],{"class":467},[341,1470,872],{"class":433},[341,1472,699],{"class":467},[341,1474,569],{"class":471},[341,1476,1477,1480,1482,1484,1486,1488,1490,1492,1494,1496,1498,1500,1502],{"class":343,"line":363},[341,1478,1479],{"class":530},"  findOne",[341,1481,887],{"class":467},[341,1483,890],{"class":518},[341,1485,522],{"class":471},[341,1487,699],{"class":467},[341,1489,897],{"class":433},[341,1491,699],{"class":467},[341,1493,902],{"class":471},[341,1495,897],{"class":905},[341,1497,534],{"class":467},[341,1499,910],{"class":429},[341,1501,913],{"class":467},[341,1503,857],{"class":467},[341,1505,1506,1508,1511,1514,1516,1518,1520,1522],{"class":343,"line":369},[341,1507,1141],{"class":463},[341,1509,1510],{"class":467}," this.",[341,1512,1513],{"class":471},"usersService",[341,1515,545],{"class":467},[341,1517,989],{"class":518},[341,1519,522],{"class":530},[341,1521,897],{"class":471},[341,1523,569],{"class":530},[341,1525,1526],{"class":343,"line":375},[341,1527,1158],{"class":467},[341,1529,1530],{"class":343,"line":381},[341,1531,1164],{"class":467},[307,1533,1534,1535,1537,1538,1540,1541,1543,1544,1547],{},"Both ",[311,1536,325],{}," and ",[311,1539,321],{}," return the same logger instance. ",[311,1542,321],{}," uses ",[311,1545,1546],{},"AsyncLocalStorage"," to propagate the logger across async boundaries.",[409,1549,1551,1552,913],{"id":1550},"background-work-logfork","Background work (",[311,1553,1554],{},"log.fork",[307,1556,1237,1557,1560,1561,1563,1564,545],{},[311,1558,1559],{},"req.log.fork(label, fn)"," (or the logger from ",[311,1562,321],{}," in the same request) for child wide events. See ",[1565,1566,1568],"a",{"href":1567},"\u002Flogging\u002Fwide-events#after-emit-sealing-and-background-work","Wide events — After emit",[331,1570,1573],{"className":453,"code":1571,"filename":1572,"language":456,"meta":337,"style":337},"import { useLogger } from 'evlog\u002Fnestjs'\n\n@Post()\ncreate(@Req() req: Express.Request) {\n  req.log.fork!('enqueue', async () => {\n    const log = useLogger()\n    log.set({ queued: true })\n  })\n  return { ok: true }\n}\n","src\u002Forders.controller.ts",[311,1574,1575,1593,1597,1606,1625,1665,1677,1702,1709,1725],{"__ignoreMap":337},[341,1576,1577,1579,1581,1583,1585,1587,1589,1591],{"class":343,"line":344},[341,1578,464],{"class":463},[341,1580,468],{"class":467},[341,1582,813],{"class":471},[341,1584,475],{"class":467},[341,1586,478],{"class":463},[341,1588,481],{"class":467},[341,1590,313],{"class":433},[341,1592,487],{"class":467},[341,1594,1595],{"class":343,"line":350},[341,1596,354],{"emptyLinePlaceholder":353},[341,1598,1599,1601,1604],{"class":343,"line":357},[341,1600,515],{"class":467},[341,1602,1603],{"class":518},"Post",[341,1605,931],{"class":471},[341,1607,1608,1610,1612,1615,1618,1620,1623],{"class":343,"line":363},[341,1609,733],{"class":518},[341,1611,887],{"class":471},[341,1613,1614],{"class":518},"Req",[341,1616,1617],{"class":471},"() req: Express",[341,1619,545],{"class":467},[341,1621,1622],{"class":471},"Request) ",[341,1624,525],{"class":467},[341,1626,1627,1630,1632,1635,1637,1640,1643,1645,1647,1650,1652,1654,1657,1660,1663],{"class":343,"line":369},[341,1628,1629],{"class":471},"  req",[341,1631,545],{"class":467},[341,1633,1634],{"class":471},"log",[341,1636,545],{"class":467},[341,1638,1639],{"class":518},"fork",[341,1641,1642],{"class":467},"!",[341,1644,522],{"class":530},[341,1646,699],{"class":467},[341,1648,1649],{"class":433},"enqueue",[341,1651,699],{"class":467},[341,1653,786],{"class":467},[341,1655,1656],{"class":577}," async",[341,1658,1659],{"class":467}," ()",[341,1661,1662],{"class":577}," =>",[341,1664,857],{"class":467},[341,1666,1667,1669,1671,1673,1675],{"class":343,"line":375},[341,1668,920],{"class":577},[341,1670,923],{"class":471},[341,1672,926],{"class":467},[341,1674,813],{"class":518},[341,1676,931],{"class":530},[341,1678,1679,1681,1683,1685,1687,1689,1692,1694,1698,1700],{"class":343,"line":381},[341,1680,940],{"class":471},[341,1682,545],{"class":467},[341,1684,945],{"class":518},[341,1686,522],{"class":530},[341,1688,950],{"class":467},[341,1690,1691],{"class":530}," queued",[341,1693,534],{"class":467},[341,1695,1697],{"class":1696},"sfNiH"," true",[341,1699,475],{"class":467},[341,1701,569],{"class":530},[341,1703,1704,1707],{"class":343,"line":387},[341,1705,1706],{"class":467},"  }",[341,1708,569],{"class":530},[341,1710,1711,1714,1716,1719,1721,1723],{"class":343,"line":393},[341,1712,1713],{"class":463},"  return",[341,1715,468],{"class":467},[341,1717,1718],{"class":530}," ok",[341,1720,534],{"class":467},[341,1722,1697],{"class":1696},[341,1724,1152],{"class":467},[341,1726,1727],{"class":343,"line":398},[341,1728,1164],{"class":467},[409,1730,1732],{"id":1731},"error-handling","Error Handling",[307,1734,1237,1735,1738,1739,1742,1743,1746,1747,1750],{},[311,1736,1737],{},"createError"," for structured errors with ",[311,1740,1741],{},"why",", ",[311,1744,1745],{},"fix",", and ",[311,1748,1749],{},"link"," fields. Create a NestJS exception filter to log and format errors:",[331,1752,1755],{"className":453,"code":1753,"filename":1754,"language":456,"meta":337,"style":337},"import { Catch } from '@nestjs\u002Fcommon'\nimport type { ExceptionFilter, ArgumentsHost } from '@nestjs\u002Fcommon'\nimport { parseError } from 'evlog'\nimport { useLogger } from 'evlog\u002Fnestjs'\n\n@Catch()\nexport class EvlogExceptionFilter implements ExceptionFilter {\n  catch(exception: unknown, host: ArgumentsHost) {\n    const response = host.switchToHttp().getResponse()\n    const error = exception instanceof Error ? exception : new Error(String(exception))\n\n    try { useLogger().error(error) } catch {}\n\n    const parsed = parseError(error)\n    response.status(parsed.status).json({\n      message: parsed.message,\n      why: parsed.why,\n      fix: parsed.fix,\n      link: parsed.link,\n    })\n  }\n}\n","src\u002Fevlog-exception.filter.ts",[311,1756,1757,1776,1803,1822,1840,1844,1853,1869,1897,1922,1965,1969,1998,2002,2019,2049,2065,2080,2095,2110,2117,2122],{"__ignoreMap":337},[341,1758,1759,1761,1763,1766,1768,1770,1772,1774],{"class":343,"line":344},[341,1760,464],{"class":463},[341,1762,468],{"class":467},[341,1764,1765],{"class":471}," Catch",[341,1767,475],{"class":467},[341,1769,478],{"class":463},[341,1771,481],{"class":467},[341,1773,484],{"class":433},[341,1775,487],{"class":467},[341,1777,1778,1780,1783,1785,1788,1790,1793,1795,1797,1799,1801],{"class":343,"line":350},[341,1779,464],{"class":463},[341,1781,1782],{"class":463}," type",[341,1784,468],{"class":467},[341,1786,1787],{"class":471}," ExceptionFilter",[341,1789,786],{"class":467},[341,1791,1792],{"class":471}," ArgumentsHost",[341,1794,475],{"class":467},[341,1796,478],{"class":463},[341,1798,481],{"class":467},[341,1800,484],{"class":433},[341,1802,487],{"class":467},[341,1804,1805,1807,1809,1812,1814,1816,1818,1820],{"class":343,"line":357},[341,1806,464],{"class":463},[341,1808,468],{"class":467},[341,1810,1811],{"class":471}," parseError",[341,1813,475],{"class":467},[341,1815,478],{"class":463},[341,1817,481],{"class":467},[341,1819,643],{"class":433},[341,1821,487],{"class":467},[341,1823,1824,1826,1828,1830,1832,1834,1836,1838],{"class":343,"line":363},[341,1825,464],{"class":463},[341,1827,468],{"class":467},[341,1829,813],{"class":471},[341,1831,475],{"class":467},[341,1833,478],{"class":463},[341,1835,481],{"class":467},[341,1837,313],{"class":433},[341,1839,487],{"class":467},[341,1841,1842],{"class":343,"line":369},[341,1843,354],{"emptyLinePlaceholder":353},[341,1845,1846,1848,1851],{"class":343,"line":375},[341,1847,515],{"class":467},[341,1849,1850],{"class":518},"Catch",[341,1852,931],{"class":471},[341,1854,1855,1857,1859,1862,1865,1867],{"class":343,"line":381},[341,1856,574],{"class":463},[341,1858,578],{"class":577},[341,1860,1861],{"class":429}," EvlogExceptionFilter",[341,1863,1864],{"class":577}," implements",[341,1866,1787],{"class":429},[341,1868,857],{"class":467},[341,1870,1871,1874,1876,1879,1881,1884,1886,1889,1891,1893,1895],{"class":343,"line":387},[341,1872,1873],{"class":530},"  catch",[341,1875,522],{"class":467},[341,1877,1878],{"class":905},"exception",[341,1880,534],{"class":467},[341,1882,1883],{"class":429}," unknown",[341,1885,786],{"class":467},[341,1887,1888],{"class":905}," host",[341,1890,534],{"class":467},[341,1892,1792],{"class":429},[341,1894,913],{"class":467},[341,1896,857],{"class":467},[341,1898,1899,1901,1904,1906,1908,1910,1913,1915,1917,1920],{"class":343,"line":393},[341,1900,920],{"class":577},[341,1902,1903],{"class":471}," response",[341,1905,926],{"class":467},[341,1907,1888],{"class":471},[341,1909,545],{"class":467},[341,1911,1912],{"class":518},"switchToHttp",[341,1914,551],{"class":530},[341,1916,545],{"class":467},[341,1918,1919],{"class":518},"getResponse",[341,1921,931],{"class":530},[341,1923,1924,1926,1929,1931,1934,1937,1940,1943,1945,1948,1951,1953,1955,1958,1960,1962],{"class":343,"line":398},[341,1925,920],{"class":577},[341,1927,1928],{"class":471}," error",[341,1930,926],{"class":467},[341,1932,1933],{"class":471}," exception",[341,1935,1936],{"class":467}," instanceof",[341,1938,1939],{"class":429}," Error",[341,1941,1942],{"class":467}," ?",[341,1944,1933],{"class":471},[341,1946,1947],{"class":467}," :",[341,1949,1950],{"class":467}," new",[341,1952,1939],{"class":518},[341,1954,522],{"class":530},[341,1956,1957],{"class":518},"String",[341,1959,522],{"class":530},[341,1961,1878],{"class":471},[341,1963,1964],{"class":530},"))\n",[341,1966,1967],{"class":343,"line":404},[341,1968,354],{"emptyLinePlaceholder":353},[341,1970,1971,1974,1976,1978,1980,1982,1985,1987,1989,1991,1993,1996],{"class":343,"line":973},[341,1972,1973],{"class":463},"    try",[341,1975,468],{"class":467},[341,1977,813],{"class":518},[341,1979,551],{"class":530},[341,1981,545],{"class":467},[341,1983,1984],{"class":518},"error",[341,1986,522],{"class":530},[341,1988,1984],{"class":471},[341,1990,902],{"class":530},[341,1992,566],{"class":467},[341,1994,1995],{"class":463}," catch",[341,1997,584],{"class":467},[341,1999,2000],{"class":343,"line":998},[341,2001,354],{"emptyLinePlaceholder":353},[341,2003,2004,2006,2009,2011,2013,2015,2017],{"class":343,"line":1049},[341,2005,920],{"class":577},[341,2007,2008],{"class":471}," parsed",[341,2010,926],{"class":467},[341,2012,1811],{"class":518},[341,2014,522],{"class":530},[341,2016,1984],{"class":471},[341,2018,569],{"class":530},[341,2020,2021,2024,2026,2029,2031,2034,2036,2038,2040,2042,2045,2047],{"class":343,"line":1054},[341,2022,2023],{"class":471},"    response",[341,2025,545],{"class":467},[341,2027,2028],{"class":518},"status",[341,2030,522],{"class":530},[341,2032,2033],{"class":471},"parsed",[341,2035,545],{"class":467},[341,2037,2028],{"class":471},[341,2039,913],{"class":530},[341,2041,545],{"class":467},[341,2043,2044],{"class":518},"json",[341,2046,522],{"class":530},[341,2048,525],{"class":467},[341,2050,2051,2054,2056,2058,2060,2063],{"class":343,"line":1079},[341,2052,2053],{"class":530},"      message",[341,2055,534],{"class":467},[341,2057,2008],{"class":471},[341,2059,545],{"class":467},[341,2061,2062],{"class":471},"message",[341,2064,554],{"class":467},[341,2066,2067,2070,2072,2074,2076,2078],{"class":343,"line":1133},[341,2068,2069],{"class":530},"      why",[341,2071,534],{"class":467},[341,2073,2008],{"class":471},[341,2075,545],{"class":467},[341,2077,1741],{"class":471},[341,2079,554],{"class":467},[341,2081,2082,2085,2087,2089,2091,2093],{"class":343,"line":1138},[341,2083,2084],{"class":530},"      fix",[341,2086,534],{"class":467},[341,2088,2008],{"class":471},[341,2090,545],{"class":467},[341,2092,1745],{"class":471},[341,2094,554],{"class":467},[341,2096,2097,2100,2102,2104,2106,2108],{"class":343,"line":1155},[341,2098,2099],{"class":530},"      link",[341,2101,534],{"class":467},[341,2103,2008],{"class":471},[341,2105,545],{"class":467},[341,2107,1749],{"class":471},[341,2109,554],{"class":467},[341,2111,2112,2115],{"class":343,"line":1161},[341,2113,2114],{"class":467},"    }",[341,2116,569],{"class":530},[341,2118,2120],{"class":343,"line":2119},21,[341,2121,1158],{"class":467},[341,2123,2125],{"class":343,"line":2124},22,[341,2126,1164],{"class":467},[307,2128,2129],{},"Apply it to your controllers:",[331,2131,2134],{"className":453,"code":2132,"filename":2133,"language":456,"meta":337,"style":337},"import { Controller, Get, UseFilters } from '@nestjs\u002Fcommon'\nimport { createError } from 'evlog'\nimport { EvlogExceptionFilter } from '.\u002Fevlog-exception.filter'\n\n@Controller()\n@UseFilters(new EvlogExceptionFilter())\nexport class CheckoutController {\n  @Get('checkout')\n  checkout() {\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","src\u002Fcheckout.controller.ts",[311,2135,2136,2163,2182,2201,2205,2213,2230,2241,2258,2267,2278,2293,2305,2320,2335,2350,2356,2360],{"__ignoreMap":337},[341,2137,2138,2140,2142,2144,2146,2148,2150,2153,2155,2157,2159,2161],{"class":343,"line":344},[341,2139,464],{"class":463},[341,2141,468],{"class":467},[341,2143,783],{"class":471},[341,2145,786],{"class":467},[341,2147,789],{"class":471},[341,2149,786],{"class":467},[341,2151,2152],{"class":471}," UseFilters",[341,2154,475],{"class":467},[341,2156,478],{"class":463},[341,2158,481],{"class":467},[341,2160,484],{"class":433},[341,2162,487],{"class":467},[341,2164,2165,2167,2169,2172,2174,2176,2178,2180],{"class":343,"line":350},[341,2166,464],{"class":463},[341,2168,468],{"class":467},[341,2170,2171],{"class":471}," createError",[341,2173,475],{"class":467},[341,2175,478],{"class":463},[341,2177,481],{"class":467},[341,2179,643],{"class":433},[341,2181,487],{"class":467},[341,2183,2184,2186,2188,2190,2192,2194,2196,2199],{"class":343,"line":357},[341,2185,464],{"class":463},[341,2187,468],{"class":467},[341,2189,1861],{"class":471},[341,2191,475],{"class":467},[341,2193,478],{"class":463},[341,2195,481],{"class":467},[341,2197,2198],{"class":433},".\u002Fevlog-exception.filter",[341,2200,487],{"class":467},[341,2202,2203],{"class":343,"line":363},[341,2204,354],{"emptyLinePlaceholder":353},[341,2206,2207,2209,2211],{"class":343,"line":369},[341,2208,515],{"class":467},[341,2210,834],{"class":518},[341,2212,931],{"class":471},[341,2214,2215,2217,2220,2222,2225,2227],{"class":343,"line":375},[341,2216,515],{"class":467},[341,2218,2219],{"class":518},"UseFilters",[341,2221,522],{"class":471},[341,2223,2224],{"class":467},"new",[341,2226,1861],{"class":518},[341,2228,2229],{"class":471},"())\n",[341,2231,2232,2234,2236,2239],{"class":343,"line":381},[341,2233,574],{"class":463},[341,2235,578],{"class":577},[341,2237,2238],{"class":429}," CheckoutController",[341,2240,857],{"class":467},[341,2242,2243,2245,2247,2249,2251,2254,2256],{"class":343,"line":387},[341,2244,862],{"class":467},[341,2246,865],{"class":518},[341,2248,522],{"class":471},[341,2250,699],{"class":467},[341,2252,2253],{"class":433},"checkout",[341,2255,699],{"class":467},[341,2257,569],{"class":471},[341,2259,2260,2263,2265],{"class":343,"line":393},[341,2261,2262],{"class":530},"  checkout",[341,2264,551],{"class":467},[341,2266,857],{"class":467},[341,2268,2269,2272,2274,2276],{"class":343,"line":398},[341,2270,2271],{"class":463},"    throw",[341,2273,2171],{"class":518},[341,2275,522],{"class":530},[341,2277,525],{"class":467},[341,2279,2280,2282,2284,2286,2289,2291],{"class":343,"line":404},[341,2281,2053],{"class":530},[341,2283,534],{"class":467},[341,2285,481],{"class":467},[341,2287,2288],{"class":433},"Payment failed",[341,2290,699],{"class":467},[341,2292,554],{"class":467},[341,2294,2295,2298,2300,2303],{"class":343,"line":973},[341,2296,2297],{"class":530},"      status",[341,2299,534],{"class":467},[341,2301,2302],{"class":754}," 402",[341,2304,554],{"class":467},[341,2306,2307,2309,2311,2313,2316,2318],{"class":343,"line":998},[341,2308,2069],{"class":530},[341,2310,534],{"class":467},[341,2312,481],{"class":467},[341,2314,2315],{"class":433},"Card declined by issuer",[341,2317,699],{"class":467},[341,2319,554],{"class":467},[341,2321,2322,2324,2326,2328,2331,2333],{"class":343,"line":1049},[341,2323,2084],{"class":530},[341,2325,534],{"class":467},[341,2327,481],{"class":467},[341,2329,2330],{"class":433},"Try a different payment method",[341,2332,699],{"class":467},[341,2334,554],{"class":467},[341,2336,2337,2339,2341,2343,2346,2348],{"class":343,"line":1054},[341,2338,2099],{"class":530},[341,2340,534],{"class":467},[341,2342,481],{"class":467},[341,2344,2345],{"class":433},"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined",[341,2347,699],{"class":467},[341,2349,554],{"class":467},[341,2351,2352,2354],{"class":343,"line":1079},[341,2353,2114],{"class":467},[341,2355,569],{"class":530},[341,2357,2358],{"class":343,"line":1133},[341,2359,1158],{"class":467},[341,2361,2362],{"class":343,"line":1138},[341,2363,1164],{"class":467},[307,2365,2366],{},"The error is captured and logged with both the custom context and structured error fields:",[331,2368,2370],{"className":419,"code":2369,"filename":1171,"language":422,"meta":337,"style":337},"14:58:20 ERROR [my-api] GET \u002Fcheckout 402 in 3ms\n  ├─ error: name=EvlogError message=Payment failed status=402\n  └─ requestId: 880a50ac-...\n",[311,2371,2372,2383,2405],{"__ignoreMap":337},[341,2373,2374,2377,2380],{"class":343,"line":344},[341,2375,2376],{"class":429},"14:58:20",[341,2378,2379],{"class":433}," ERROR",[341,2381,2382],{"class":471}," [my-api] GET \u002Fcheckout 402 in 3ms\n",[341,2384,2385,2387,2390,2393,2396,2399,2402],{"class":343,"line":350},[341,2386,1189],{"class":429},[341,2388,2389],{"class":433}," error:",[341,2391,2392],{"class":433}," name=EvlogError",[341,2394,2395],{"class":433}," message=Payment",[341,2397,2398],{"class":433}," failed",[341,2400,2401],{"class":433}," status=",[341,2403,2404],{"class":754},"402\n",[341,2406,2407,2409,2411],{"class":343,"line":357},[341,2408,1225],{"class":429},[341,2410,1228],{"class":433},[341,2412,2413],{"class":433}," 880a50ac-...\n",[409,2415,86],{"id":2416},"configuration",[307,2418,2419,2420,2423,2424,2426],{},"See the ",[1565,2421,2422],{"href":87},"Configuration reference"," for all available options (",[311,2425,673],{},", middleware options, sampling, silent mode, etc.).",[409,2428,2430],{"id":2429},"drain-enrichers","Drain & Enrichers",[307,2432,2433,2434,534],{},"Configure drain adapters and enrichers in ",[311,2435,317],{},[331,2437,2439],{"className":453,"code":2438,"filename":455,"language":456,"meta":337,"style":337},"import { Module } from '@nestjs\u002Fcommon'\nimport { EvlogModule } from 'evlog\u002Fnestjs'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createUserAgentEnricher } from 'evlog\u002Fenrichers'\n\nconst userAgent = createUserAgentEnricher()\n\n@Module({\n  imports: [\n    EvlogModule.forRoot({\n      drain: createAxiomDrain(),\n      enrich: (ctx) => {\n        userAgent(ctx)\n        ctx.event.region = process.env.FLY_REGION\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n",[311,2440,2441,2459,2477,2497,2517,2521,2534,2538,2548,2556,2568,2581,2600,2611,2641,2646,2654,2660,2666],{"__ignoreMap":337},[341,2442,2443,2445,2447,2449,2451,2453,2455,2457],{"class":343,"line":344},[341,2444,464],{"class":463},[341,2446,468],{"class":467},[341,2448,472],{"class":471},[341,2450,475],{"class":467},[341,2452,478],{"class":463},[341,2454,481],{"class":467},[341,2456,484],{"class":433},[341,2458,487],{"class":467},[341,2460,2461,2463,2465,2467,2469,2471,2473,2475],{"class":343,"line":350},[341,2462,464],{"class":463},[341,2464,468],{"class":467},[341,2466,496],{"class":471},[341,2468,475],{"class":467},[341,2470,478],{"class":463},[341,2472,481],{"class":467},[341,2474,313],{"class":433},[341,2476,487],{"class":467},[341,2478,2479,2481,2483,2486,2488,2490,2492,2495],{"class":343,"line":357},[341,2480,464],{"class":463},[341,2482,468],{"class":467},[341,2484,2485],{"class":471}," createAxiomDrain",[341,2487,475],{"class":467},[341,2489,478],{"class":463},[341,2491,481],{"class":467},[341,2493,2494],{"class":433},"evlog\u002Faxiom",[341,2496,487],{"class":467},[341,2498,2499,2501,2503,2506,2508,2510,2512,2515],{"class":343,"line":363},[341,2500,464],{"class":463},[341,2502,468],{"class":467},[341,2504,2505],{"class":471}," createUserAgentEnricher",[341,2507,475],{"class":467},[341,2509,478],{"class":463},[341,2511,481],{"class":467},[341,2513,2514],{"class":433},"evlog\u002Fenrichers",[341,2516,487],{"class":467},[341,2518,2519],{"class":343,"line":369},[341,2520,354],{"emptyLinePlaceholder":353},[341,2522,2523,2525,2528,2530,2532],{"class":343,"line":375},[341,2524,717],{"class":577},[341,2526,2527],{"class":471}," userAgent ",[341,2529,723],{"class":467},[341,2531,2505],{"class":518},[341,2533,931],{"class":471},[341,2535,2536],{"class":343,"line":381},[341,2537,354],{"emptyLinePlaceholder":353},[341,2539,2540,2542,2544,2546],{"class":343,"line":387},[341,2541,515],{"class":467},[341,2543,519],{"class":518},[341,2545,522],{"class":471},[341,2547,525],{"class":467},[341,2549,2550,2552,2554],{"class":343,"line":393},[341,2551,531],{"class":530},[341,2553,534],{"class":467},[341,2555,537],{"class":471},[341,2557,2558,2560,2562,2564,2566],{"class":343,"line":398},[341,2559,542],{"class":471},[341,2561,545],{"class":467},[341,2563,548],{"class":518},[341,2565,522],{"class":471},[341,2567,525],{"class":467},[341,2569,2570,2573,2575,2577,2579],{"class":343,"line":404},[341,2571,2572],{"class":530},"      drain",[341,2574,534],{"class":467},[341,2576,2485],{"class":518},[341,2578,551],{"class":471},[341,2580,554],{"class":467},[341,2582,2583,2586,2588,2591,2594,2596,2598],{"class":343,"line":973},[341,2584,2585],{"class":518},"      enrich",[341,2587,534],{"class":467},[341,2589,2590],{"class":467}," (",[341,2592,2593],{"class":905},"ctx",[341,2595,913],{"class":467},[341,2597,1662],{"class":577},[341,2599,857],{"class":467},[341,2601,2602,2605,2607,2609],{"class":343,"line":998},[341,2603,2604],{"class":518},"        userAgent",[341,2606,522],{"class":530},[341,2608,2593],{"class":471},[341,2610,569],{"class":530},[341,2612,2613,2616,2618,2621,2623,2626,2628,2631,2633,2636,2638],{"class":343,"line":1049},[341,2614,2615],{"class":471},"        ctx",[341,2617,545],{"class":467},[341,2619,2620],{"class":471},"event",[341,2622,545],{"class":467},[341,2624,2625],{"class":471},"region",[341,2627,926],{"class":467},[341,2629,2630],{"class":471}," process",[341,2632,545],{"class":467},[341,2634,2635],{"class":471},"env",[341,2637,545],{"class":467},[341,2639,2640],{"class":471},"FLY_REGION\n",[341,2642,2643],{"class":343,"line":1054},[341,2644,2645],{"class":467},"      },\n",[341,2647,2648,2650,2652],{"class":343,"line":1079},[341,2649,2114],{"class":467},[341,2651,913],{"class":471},[341,2653,554],{"class":467},[341,2655,2656,2658],{"class":343,"line":1133},[341,2657,559],{"class":471},[341,2659,554],{"class":467},[341,2661,2662,2664],{"class":343,"line":1138},[341,2663,566],{"class":467},[341,2665,569],{"class":471},[341,2667,2668,2670,2672,2674],{"class":343,"line":1155},[341,2669,574],{"class":463},[341,2671,578],{"class":577},[341,2673,581],{"class":429},[341,2675,584],{"class":467},[413,2677,2679],{"id":2678},"async-configuration","Async Configuration",[307,2681,1237,2682,2685,2686,2689],{},[311,2683,2684],{},"forRootAsync()"," when options depend on other providers (e.g. ",[311,2687,2688],{},"ConfigService","):",[331,2691,2693],{"className":453,"code":2692,"filename":455,"language":456,"meta":337,"style":337},"import { Module } from '@nestjs\u002Fcommon'\nimport { ConfigModule, ConfigService } from '@nestjs\u002Fconfig'\nimport { EvlogModule } from 'evlog\u002Fnestjs'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\n@Module({\n  imports: [\n    ConfigModule.forRoot(),\n    EvlogModule.forRootAsync({\n      imports: [ConfigModule],\n      inject: [ConfigService],\n      useFactory: (config: ConfigService) => ({\n        drain: createAxiomDrain({ token: config.get('AXIOM_TOKEN') }),\n      }),\n    }),\n  ],\n})\nexport class AppModule {}\n",[311,2694,2695,2713,2738,2756,2774,2778,2788,2796,2809,2822,2834,2846,2870,2913,2922,2930,2936,2942],{"__ignoreMap":337},[341,2696,2697,2699,2701,2703,2705,2707,2709,2711],{"class":343,"line":344},[341,2698,464],{"class":463},[341,2700,468],{"class":467},[341,2702,472],{"class":471},[341,2704,475],{"class":467},[341,2706,478],{"class":463},[341,2708,481],{"class":467},[341,2710,484],{"class":433},[341,2712,487],{"class":467},[341,2714,2715,2717,2719,2722,2724,2727,2729,2731,2733,2736],{"class":343,"line":350},[341,2716,464],{"class":463},[341,2718,468],{"class":467},[341,2720,2721],{"class":471}," ConfigModule",[341,2723,786],{"class":467},[341,2725,2726],{"class":471}," ConfigService",[341,2728,475],{"class":467},[341,2730,478],{"class":463},[341,2732,481],{"class":467},[341,2734,2735],{"class":433},"@nestjs\u002Fconfig",[341,2737,487],{"class":467},[341,2739,2740,2742,2744,2746,2748,2750,2752,2754],{"class":343,"line":357},[341,2741,464],{"class":463},[341,2743,468],{"class":467},[341,2745,496],{"class":471},[341,2747,475],{"class":467},[341,2749,478],{"class":463},[341,2751,481],{"class":467},[341,2753,313],{"class":433},[341,2755,487],{"class":467},[341,2757,2758,2760,2762,2764,2766,2768,2770,2772],{"class":343,"line":363},[341,2759,464],{"class":463},[341,2761,468],{"class":467},[341,2763,2485],{"class":471},[341,2765,475],{"class":467},[341,2767,478],{"class":463},[341,2769,481],{"class":467},[341,2771,2494],{"class":433},[341,2773,487],{"class":467},[341,2775,2776],{"class":343,"line":369},[341,2777,354],{"emptyLinePlaceholder":353},[341,2779,2780,2782,2784,2786],{"class":343,"line":375},[341,2781,515],{"class":467},[341,2783,519],{"class":518},[341,2785,522],{"class":471},[341,2787,525],{"class":467},[341,2789,2790,2792,2794],{"class":343,"line":381},[341,2791,531],{"class":530},[341,2793,534],{"class":467},[341,2795,537],{"class":471},[341,2797,2798,2801,2803,2805,2807],{"class":343,"line":387},[341,2799,2800],{"class":471},"    ConfigModule",[341,2802,545],{"class":467},[341,2804,548],{"class":518},[341,2806,551],{"class":471},[341,2808,554],{"class":467},[341,2810,2811,2813,2815,2818,2820],{"class":343,"line":393},[341,2812,542],{"class":471},[341,2814,545],{"class":467},[341,2816,2817],{"class":518},"forRootAsync",[341,2819,522],{"class":471},[341,2821,525],{"class":467},[341,2823,2824,2827,2829,2832],{"class":343,"line":398},[341,2825,2826],{"class":530},"      imports",[341,2828,534],{"class":467},[341,2830,2831],{"class":471}," [ConfigModule]",[341,2833,554],{"class":467},[341,2835,2836,2839,2841,2844],{"class":343,"line":404},[341,2837,2838],{"class":530},"      inject",[341,2840,534],{"class":467},[341,2842,2843],{"class":471}," [ConfigService]",[341,2845,554],{"class":467},[341,2847,2848,2851,2853,2855,2858,2860,2862,2864,2866,2868],{"class":343,"line":973},[341,2849,2850],{"class":518},"      useFactory",[341,2852,534],{"class":467},[341,2854,2590],{"class":467},[341,2856,2857],{"class":905},"config",[341,2859,534],{"class":467},[341,2861,2726],{"class":429},[341,2863,913],{"class":467},[341,2865,1662],{"class":577},[341,2867,2590],{"class":471},[341,2869,525],{"class":467},[341,2871,2872,2875,2877,2879,2881,2883,2886,2888,2891,2893,2896,2898,2900,2903,2905,2907,2909,2911],{"class":343,"line":998},[341,2873,2874],{"class":530},"        drain",[341,2876,534],{"class":467},[341,2878,2485],{"class":518},[341,2880,522],{"class":471},[341,2882,950],{"class":467},[341,2884,2885],{"class":530}," token",[341,2887,534],{"class":467},[341,2889,2890],{"class":471}," config",[341,2892,545],{"class":467},[341,2894,2895],{"class":518},"get",[341,2897,522],{"class":471},[341,2899,699],{"class":467},[341,2901,2902],{"class":433},"AXIOM_TOKEN",[341,2904,699],{"class":467},[341,2906,902],{"class":471},[341,2908,566],{"class":467},[341,2910,913],{"class":471},[341,2912,554],{"class":467},[341,2914,2915,2918,2920],{"class":343,"line":1049},[341,2916,2917],{"class":467},"      }",[341,2919,913],{"class":471},[341,2921,554],{"class":467},[341,2923,2924,2926,2928],{"class":343,"line":1054},[341,2925,2114],{"class":467},[341,2927,913],{"class":471},[341,2929,554],{"class":467},[341,2931,2932,2934],{"class":343,"line":1079},[341,2933,559],{"class":471},[341,2935,554],{"class":467},[341,2937,2938,2940],{"class":343,"line":1133},[341,2939,566],{"class":467},[341,2941,569],{"class":471},[341,2943,2944,2946,2948,2950],{"class":343,"line":1138},[341,2945,574],{"class":463},[341,2947,578],{"class":577},[341,2949,581],{"class":429},[341,2951,584],{"class":467},[413,2953,2955],{"id":2954},"pipeline-batching-retry","Pipeline (Batching & Retry)",[307,2957,2958,2959,2962],{},"For production, wrap your adapter with ",[311,2960,2961],{},"createDrainPipeline"," to batch events and retry on failure:",[331,2964,2966],{"className":453,"code":2965,"filename":455,"language":456,"meta":337,"style":337},"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\nEvlogModule.forRoot({ drain })\n",[311,2967,2968,2989,3007,3027,3031,3055,3084,3103,3109,3128,3132],{"__ignoreMap":337},[341,2969,2970,2972,2974,2976,2979,2981,2983,2985,2987],{"class":343,"line":344},[341,2971,464],{"class":463},[341,2973,1782],{"class":463},[341,2975,468],{"class":467},[341,2977,2978],{"class":471}," DrainContext",[341,2980,475],{"class":467},[341,2982,478],{"class":463},[341,2984,481],{"class":467},[341,2986,643],{"class":433},[341,2988,487],{"class":467},[341,2990,2991,2993,2995,2997,2999,3001,3003,3005],{"class":343,"line":350},[341,2992,464],{"class":463},[341,2994,468],{"class":467},[341,2996,2485],{"class":471},[341,2998,475],{"class":467},[341,3000,478],{"class":463},[341,3002,481],{"class":467},[341,3004,2494],{"class":433},[341,3006,487],{"class":467},[341,3008,3009,3011,3013,3016,3018,3020,3022,3025],{"class":343,"line":357},[341,3010,464],{"class":463},[341,3012,468],{"class":467},[341,3014,3015],{"class":471}," createDrainPipeline",[341,3017,475],{"class":467},[341,3019,478],{"class":463},[341,3021,481],{"class":467},[341,3023,3024],{"class":433},"evlog\u002Fpipeline",[341,3026,487],{"class":467},[341,3028,3029],{"class":343,"line":363},[341,3030,354],{"emptyLinePlaceholder":353},[341,3032,3033,3035,3038,3040,3042,3045,3048,3051,3053],{"class":343,"line":369},[341,3034,717],{"class":577},[341,3036,3037],{"class":471}," pipeline ",[341,3039,723],{"class":467},[341,3041,3015],{"class":518},[341,3043,3044],{"class":467},"\u003C",[341,3046,3047],{"class":429},"DrainContext",[341,3049,3050],{"class":467},">",[341,3052,522],{"class":471},[341,3054,525],{"class":467},[341,3056,3057,3060,3062,3064,3067,3069,3072,3074,3077,3079,3082],{"class":343,"line":375},[341,3058,3059],{"class":530},"  batch",[341,3061,534],{"class":467},[341,3063,468],{"class":467},[341,3065,3066],{"class":530}," size",[341,3068,534],{"class":467},[341,3070,3071],{"class":754}," 50",[341,3073,786],{"class":467},[341,3075,3076],{"class":530}," intervalMs",[341,3078,534],{"class":467},[341,3080,3081],{"class":754}," 5000",[341,3083,702],{"class":467},[341,3085,3086,3089,3091,3093,3096,3098,3101],{"class":343,"line":381},[341,3087,3088],{"class":530},"  retry",[341,3090,534],{"class":467},[341,3092,468],{"class":467},[341,3094,3095],{"class":530}," maxAttempts",[341,3097,534],{"class":467},[341,3099,3100],{"class":754}," 3",[341,3102,702],{"class":467},[341,3104,3105,3107],{"class":343,"line":387},[341,3106,566],{"class":467},[341,3108,569],{"class":471},[341,3110,3111,3113,3116,3118,3121,3123,3126],{"class":343,"line":393},[341,3112,717],{"class":577},[341,3114,3115],{"class":471}," drain ",[341,3117,723],{"class":467},[341,3119,3120],{"class":518}," pipeline",[341,3122,522],{"class":471},[341,3124,3125],{"class":518},"createAxiomDrain",[341,3127,2229],{"class":471},[341,3129,3130],{"class":343,"line":398},[341,3131,354],{"emptyLinePlaceholder":353},[341,3133,3134,3137,3139,3141,3143,3145,3147,3149],{"class":343,"line":404},[341,3135,3136],{"class":471},"EvlogModule",[341,3138,545],{"class":467},[341,3140,548],{"class":518},[341,3142,522],{"class":471},[341,3144,950],{"class":467},[341,3146,3115],{"class":471},[341,3148,566],{"class":467},[341,3150,569],{"class":471},[3152,3153,3155,3156,3159,3160,3163],"callout",{"color":3154,"icon":13},"info","Call ",[311,3157,3158],{},"drain.flush()"," on server shutdown to ensure all buffered events are sent. See the ",[1565,3161,3162],{"href":223},"Pipeline docs"," for all options.",[409,3165,3167],{"id":3166},"tail-sampling","Tail Sampling",[307,3169,1237,3170,3173],{},[311,3171,3172],{},"keep"," to force-retain specific events regardless of head sampling:",[331,3175,3177],{"className":453,"code":3176,"filename":455,"language":456,"meta":337,"style":337},"EvlogModule.forRoot({\n  drain: createAxiomDrain(),\n  keep: (ctx) => {\n    if (ctx.duration && ctx.duration > 2000) ctx.shouldKeep = true\n  },\n})\n",[311,3178,3179,3191,3204,3221,3265,3270],{"__ignoreMap":337},[341,3180,3181,3183,3185,3187,3189],{"class":343,"line":344},[341,3182,3136],{"class":471},[341,3184,545],{"class":467},[341,3186,548],{"class":518},[341,3188,522],{"class":471},[341,3190,525],{"class":467},[341,3192,3193,3196,3198,3200,3202],{"class":343,"line":350},[341,3194,3195],{"class":530},"  drain",[341,3197,534],{"class":467},[341,3199,2485],{"class":518},[341,3201,551],{"class":471},[341,3203,554],{"class":467},[341,3205,3206,3209,3211,3213,3215,3217,3219],{"class":343,"line":357},[341,3207,3208],{"class":518},"  keep",[341,3210,534],{"class":467},[341,3212,2590],{"class":467},[341,3214,2593],{"class":905},[341,3216,913],{"class":467},[341,3218,1662],{"class":577},[341,3220,857],{"class":467},[341,3222,3223,3226,3228,3230,3232,3235,3238,3241,3243,3245,3248,3251,3253,3255,3257,3260,3262],{"class":343,"line":363},[341,3224,3225],{"class":463},"    if",[341,3227,2590],{"class":530},[341,3229,2593],{"class":471},[341,3231,545],{"class":467},[341,3233,3234],{"class":471},"duration",[341,3236,3237],{"class":467}," &&",[341,3239,3240],{"class":471}," ctx",[341,3242,545],{"class":467},[341,3244,3234],{"class":471},[341,3246,3247],{"class":467}," >",[341,3249,3250],{"class":754}," 2000",[341,3252,902],{"class":530},[341,3254,2593],{"class":471},[341,3256,545],{"class":467},[341,3258,3259],{"class":471},"shouldKeep",[341,3261,926],{"class":467},[341,3263,3264],{"class":1696}," true\n",[341,3266,3267],{"class":343,"line":369},[341,3268,3269],{"class":467},"  },\n",[341,3271,3272,3274],{"class":343,"line":375},[341,3273,566],{"class":467},[341,3275,569],{"class":471},[409,3277,3279],{"id":3278},"route-filtering","Route Filtering",[307,3281,3282,3283,1537,3286,3289],{},"Control which routes are logged with ",[311,3284,3285],{},"include",[311,3287,3288],{},"exclude"," patterns:",[331,3291,3293],{"className":453,"code":3292,"filename":455,"language":456,"meta":337,"style":337},"EvlogModule.forRoot({\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",[311,3294,3295,3307,3329,3358,3367,3394,3420,3424],{"__ignoreMap":337},[341,3296,3297,3299,3301,3303,3305],{"class":343,"line":344},[341,3298,3136],{"class":471},[341,3300,545],{"class":467},[341,3302,548],{"class":518},[341,3304,522],{"class":471},[341,3306,525],{"class":467},[341,3308,3309,3312,3314,3317,3319,3322,3324,3327],{"class":343,"line":350},[341,3310,3311],{"class":530},"  include",[341,3313,534],{"class":467},[341,3315,3316],{"class":471}," [",[341,3318,699],{"class":467},[341,3320,3321],{"class":433},"\u002Fapi\u002F**",[341,3323,699],{"class":467},[341,3325,3326],{"class":471},"]",[341,3328,554],{"class":467},[341,3330,3331,3334,3336,3338,3340,3343,3345,3347,3349,3352,3354,3356],{"class":343,"line":357},[341,3332,3333],{"class":530},"  exclude",[341,3335,534],{"class":467},[341,3337,3316],{"class":471},[341,3339,699],{"class":467},[341,3341,3342],{"class":433},"\u002F_internal\u002F**",[341,3344,699],{"class":467},[341,3346,786],{"class":467},[341,3348,481],{"class":467},[341,3350,3351],{"class":433},"\u002Fhealth",[341,3353,699],{"class":467},[341,3355,3326],{"class":471},[341,3357,554],{"class":467},[341,3359,3360,3363,3365],{"class":343,"line":363},[341,3361,3362],{"class":530},"  routes",[341,3364,534],{"class":467},[341,3366,857],{"class":467},[341,3368,3369,3372,3375,3377,3379,3381,3383,3385,3387,3390,3392],{"class":343,"line":369},[341,3370,3371],{"class":467},"    '",[341,3373,3374],{"class":530},"\u002Fapi\u002Fauth\u002F**",[341,3376,699],{"class":467},[341,3378,534],{"class":467},[341,3380,468],{"class":467},[341,3382,689],{"class":530},[341,3384,534],{"class":467},[341,3386,481],{"class":467},[341,3388,3389],{"class":433},"auth-service",[341,3391,699],{"class":467},[341,3393,702],{"class":467},[341,3395,3396,3398,3401,3403,3405,3407,3409,3411,3413,3416,3418],{"class":343,"line":375},[341,3397,3371],{"class":467},[341,3399,3400],{"class":530},"\u002Fapi\u002Fpayment\u002F**",[341,3402,699],{"class":467},[341,3404,534],{"class":467},[341,3406,468],{"class":467},[341,3408,689],{"class":530},[341,3410,534],{"class":467},[341,3412,481],{"class":467},[341,3414,3415],{"class":433},"payment-service",[341,3417,699],{"class":467},[341,3419,702],{"class":467},[341,3421,3422],{"class":343,"line":381},[341,3423,3269],{"class":467},[341,3425,3426,3428],{"class":343,"line":387},[341,3427,566],{"class":467},[341,3429,569],{"class":471},[409,3431,3433],{"id":3432},"run-locally","Run Locally",[331,3435,3437],{"className":419,"code":3436,"filename":421,"language":422,"meta":337,"style":337},"git clone https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog.git\ncd evlog\nbun install\nbun run example:nestjs\n",[311,3438,3439,3450,3458,3465],{"__ignoreMap":337},[341,3440,3441,3444,3447],{"class":343,"line":344},[341,3442,3443],{"class":429},"git",[341,3445,3446],{"class":433}," clone",[341,3448,3449],{"class":433}," https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog.git\n",[341,3451,3452,3455],{"class":343,"line":350},[341,3453,3454],{"class":518},"cd",[341,3456,3457],{"class":433}," evlog\n",[341,3459,3460,3462],{"class":343,"line":357},[341,3461,430],{"class":429},[341,3463,3464],{"class":433}," install\n",[341,3466,3467,3469,3472],{"class":343,"line":363},[341,3468,430],{"class":429},[341,3470,3471],{"class":433}," run",[341,3473,3474],{"class":433}," example:nestjs\n",[307,3476,3477,3478,3483],{},"Open ",[1565,3479,3480],{"href":3480,"rel":3481},"http:\u002F\u002Flocalhost:3000",[3482],"nofollow"," to explore the interactive test UI.",[3485,3486,3487],"card-group",{},[3488,3489,3493],"card",{"icon":3490,"title":3491,"to":3492},"i-simple-icons-github","Source Code","https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Fnestjs","Browse the complete NestJS example source on GitHub.",[409,3495,3497],{"id":3496},"next-steps","Next Steps",[307,3499,3500,3501,3504],{},"Deepen your ",[3502,3503,154],"strong",{}," integration:",[3506,3507,3508,3514,3519,3524],"ul",{},[3509,3510,3511,3513],"li",{},[1565,3512,46],{"href":47},": Design comprehensive events with context layering",[3509,3515,3516,3518],{},[1565,3517,208],{"href":213},": Send logs to Axiom, Sentry, PostHog, and more",[3509,3520,3521,3523],{},[1565,3522,91],{"href":92},": Control log volume with head and tail sampling",[3509,3525,3526,3528,3529,1742,3531,1746,3533,3535],{},[1565,3527,51],{"href":52},": Throw errors with ",[311,3530,1741],{},[311,3532,1745],{},[311,3534,1749],{}," fields",[3537,3538,3539],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":337,"searchDepth":350,"depth":350,"links":3541},[3542,3547,3548,3549,3551,3552,3553,3557,3558,3559,3560],{"id":411,"depth":350,"text":20,"children":3543},[3544,3545,3546],{"id":415,"depth":357,"text":416},{"id":449,"depth":357,"text":450},{"id":587,"depth":357,"text":588},{"id":765,"depth":350,"text":46},{"id":1234,"depth":350,"text":321},{"id":1550,"depth":350,"text":3550},"Background work (log.fork)",{"id":1731,"depth":350,"text":1732},{"id":2416,"depth":350,"text":86},{"id":2429,"depth":350,"text":2430,"children":3554},[3555,3556],{"id":2678,"depth":357,"text":2679},{"id":2954,"depth":357,"text":2955},{"id":3166,"depth":350,"text":3167},{"id":3278,"depth":350,"text":3279},{"id":3432,"depth":350,"text":3433},{"id":3496,"depth":350,"text":3497},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in NestJS applications.","md",[3564],{"label":3491,"icon":3490,"to":3492,"color":3565,"variant":3566},"neutral","subtle",{},{"title":154,"icon":157},{"title":154,"description":3561},"vfN3vUlEAepaXD-lO0I5CYcfN53j8fz6KDafFVh6QL4",[3572,3574],{"title":149,"path":150,"stem":151,"description":3573,"icon":152,"children":-1},"Automatic wide events, structured errors, and logging in TanStack Start API routes and server functions.",{"title":159,"path":160,"stem":161,"description":3575,"icon":162,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in Express applications.",1777047258063]