[{"data":1,"prerenderedAt":2996},["ShallowReactive",2],{"navigation_docs":3,"-core-concepts-lifecycle":402,"-core-concepts-lifecycle-surround":2991},[4,35,159,201,289,299,386],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"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",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Build On Top","\u002Fbuild-on-top","5.build-on-top",[294],{"title":295,"path":296,"stem":297,"icon":298},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F4.fs-reader","i-lucide-folder-search",{"title":300,"path":301,"stem":302,"children":303,"page":34},"Adapters","\u002Fadapters","6.adapters",[304,307,347,362],{"title":41,"path":305,"stem":306,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":308,"path":309,"stem":310,"children":311,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[312,317,322,327,332,337,342],{"title":313,"path":314,"stem":315,"icon":316},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":318,"path":319,"stem":320,"icon":321},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":323,"path":324,"stem":325,"icon":326},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":328,"path":329,"stem":330,"icon":331},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":333,"path":334,"stem":335,"icon":336},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":338,"path":339,"stem":340,"icon":341},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":343,"path":344,"stem":345,"icon":346},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":348,"path":349,"stem":350,"children":351,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[352,357],{"title":353,"path":354,"stem":355,"icon":356},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":358,"path":359,"stem":360,"icon":361},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":363,"path":364,"stem":365,"children":366,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[367,372,377,381],{"title":368,"path":369,"stem":370,"icon":371},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":373,"path":374,"stem":375,"icon":376},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":378,"path":379,"stem":380,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":382,"path":383,"stem":384,"icon":385},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":387,"path":388,"stem":389,"children":390,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[391,394,398],{"title":41,"path":392,"stem":393,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":395,"path":396,"stem":397,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":399,"path":400,"stem":401,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":403,"title":165,"body":404,"description":2980,"extension":2981,"links":2982,"meta":2987,"navigation":2988,"path":166,"seo":2989,"stem":167,"__hash__":2990},"docs\u002F3.core-concepts\u002F0.lifecycle.md",{"type":405,"value":406,"toc":2957},"minimark",[407,411,414,419,564,602,606,612,923,927,932,942,948,1046,1050,1057,1126,1132,1136,1142,1353,1359,1363,1366,1406,1409,1416,1428,1536,1542,1674,1684,1688,1691,1698,1767,1790,1793,1797,1803,2051,2054,2061,2064,2144,2300,2307,2314,2324,2407,2414,2418,2483,2487,2494,2605,2609,2615,2648,2658,2662,2669,2717,2927,2931,2953],[408,409,410],"p",{},"evlog events follow a pipeline from creation to delivery. The pipeline differs slightly depending on which logging mode you use, but the core stages (emit, sample, enrich, drain) are shared.",[412,413],"lifecycle-flow",{},[415,416,418],"h2",{"id":417},"overview-by-mode","Overview by Mode",[420,421,422,451],"table",{},[423,424,425],"thead",{},[426,427,428,432,439,448],"tr",{},[429,430,431],"th",{},"Stage",[429,433,434,438],{},[435,436,437],"code",{},"log"," (simple)",[429,440,441,444,445],{},[435,442,443],{},"createLogger"," \u002F ",[435,446,447],{},"createRequestLogger",[429,449,450],{},"Framework middleware",[452,453,454,478,502,521,536,551],"tbody",{},[426,455,456,463,466,475],{},[457,458,459],"td",{},[460,461,462],"strong",{},"Create",[457,464,465],{},"Implicit per call",[457,467,468,471,472],{},[435,469,470],{},"createLogger({...})"," or ",[435,473,474],{},"createRequestLogger({...})",[457,476,477],{},"Auto on request start",[426,479,480,485,488,494],{},[457,481,482],{},[460,483,484],{},"Accumulate",[457,486,487],{},"N\u002FA (single call)",[457,489,490,493],{},[435,491,492],{},"log.set()"," multiple times",[457,495,496,498,499],{},[435,497,492],{}," via ",[435,500,501],{},"useLogger(event)",[426,503,504,509,512,518],{},[457,505,506],{},[460,507,508],{},"Emit",[457,510,511],{},"Immediate",[457,513,514,515],{},"Manual ",[435,516,517],{},"log.emit()",[457,519,520],{},"Auto on response end",[426,522,523,528,531,534],{},[457,524,525],{},[460,526,527],{},"Sample",[457,529,530],{},"Head sampling only",[457,532,533],{},"Head + tail sampling",[457,535,533],{},[426,537,538,543,546,548],{},[457,539,540],{},[460,541,542],{},"Enrich",[457,544,545],{},"Via global drain",[457,547,545],{},[457,549,550],{},"Via hooks or callbacks",[426,552,553,558,560,562],{},[457,554,555],{},[460,556,557],{},"Drain",[457,559,545],{},[457,561,545],{},[457,563,550],{},[408,565,566,567,572,573,576,577,444,580,444,583,444,586,589,590,595,596,601],{},"After ",[460,568,569],{},[435,570,571],{},"emit"," (including when sampling returns no output), the request logger is ",[460,574,575],{},"sealed",": later ",[435,578,579],{},"set",[435,581,582],{},"error",[435,584,585],{},"info",[435,587,588],{},"warn"," calls are ignored with a console warning. For background work that needs its own event, use ",[460,591,592],{},[435,593,594],{},"log.fork()"," where your integration supports it. See ",[597,598,600],"a",{"href":599},"\u002Flogging\u002Fwide-events#after-emit-sealing-and-background-work","Wide events — After emit",".",[415,603,605],{"id":604},"request-logging-pipeline","Request Logging Pipeline",[408,607,608,609,611],{},"For framework-managed request logging, every request follows this pipeline. The middleware creates the logger and ",[435,610,501],{}," retrieves it:",[613,614,619],"pre",{"className":615,"code":616,"language":617,"meta":618,"style":618},"language-mdc shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","   Request In\n       │\n       ▼\n  ┌──────────┐     Route excluded?\n  │  Filter  │────── yes ──▶ skip (no logging)\n  └──────────┘\n       │ no\n       ▼\n  ┌──────────────────┐\n  │  Create Logger   │  requestId, method, path, startTime\n  └──────────────────┘\n       │\n       ▼\n  ┌──────────────────┐\n  │  Handler runs    │  log.set() accumulates context\n  │                  │  log.error() records errors\n  └──────────────────┘\n       │\n       ▼\n  ┌──────────────────┐\n  │  Request ends    │  status + duration computed\n  └──────────────────┘\n       │\n       ▼\n  ┌──────────────────┐\n  │  Tail Sampling   │  evlog:emit:keep hook\n  │  (keep?)         │  force-keep based on outcome\n  └──────────────────┘\n       │\n       ▼\n  ┌──────────────────┐\n  │  Head Sampling   │  random % per level\n  │  (sample?)       │  skipped if tail said \"keep\"\n  └──────────────────┘\n       │ sampled out? ──▶ discard (no output)\n       │\n       ▼\n  ┌──────────────────┐\n  │  Emit            │  WideEvent built + console output\n  └──────────────────┘\n       │\n       ▼\n  ┌──────────────────┐\n  │  Enrich          │  evlog:enrich hook\n  │                  │  user-agent, geo, trace, custom\n  └──────────────────┘\n       │\n       ▼\n  ┌──────────────────┐\n  │  Drain           │  evlog:drain hook\n  │                  │  Axiom, OTLP, Sentry, custom\n  └──────────────────┘\n       │\n       ▼\n   Done\n","mdc","",[435,620,621,630,636,642,648,654,660,666,671,677,683,689,694,699,704,710,716,721,726,731,736,742,747,752,757,762,768,774,779,784,789,794,800,806,811,817,822,827,832,838,843,848,853,858,864,870,875,880,885,890,896,902,907,912,917],{"__ignoreMap":618},[622,623,626],"span",{"class":624,"line":625},"line",1,[622,627,629],{"class":628},"sTEyZ","   Request In\n",[622,631,633],{"class":624,"line":632},2,[622,634,635],{"class":628},"       │\n",[622,637,639],{"class":624,"line":638},3,[622,640,641],{"class":628},"       ▼\n",[622,643,645],{"class":624,"line":644},4,[622,646,647],{"class":628},"  ┌──────────┐     Route excluded?\n",[622,649,651],{"class":624,"line":650},5,[622,652,653],{"class":628},"  │  Filter  │────── yes ──▶ skip (no logging)\n",[622,655,657],{"class":624,"line":656},6,[622,658,659],{"class":628},"  └──────────┘\n",[622,661,663],{"class":624,"line":662},7,[622,664,665],{"class":628},"       │ no\n",[622,667,669],{"class":624,"line":668},8,[622,670,641],{"class":628},[622,672,674],{"class":624,"line":673},9,[622,675,676],{"class":628},"  ┌──────────────────┐\n",[622,678,680],{"class":624,"line":679},10,[622,681,682],{"class":628},"  │  Create Logger   │  requestId, method, path, startTime\n",[622,684,686],{"class":624,"line":685},11,[622,687,688],{"class":628},"  └──────────────────┘\n",[622,690,692],{"class":624,"line":691},12,[622,693,635],{"class":628},[622,695,697],{"class":624,"line":696},13,[622,698,641],{"class":628},[622,700,702],{"class":624,"line":701},14,[622,703,676],{"class":628},[622,705,707],{"class":624,"line":706},15,[622,708,709],{"class":628},"  │  Handler runs    │  log.set() accumulates context\n",[622,711,713],{"class":624,"line":712},16,[622,714,715],{"class":628},"  │                  │  log.error() records errors\n",[622,717,719],{"class":624,"line":718},17,[622,720,688],{"class":628},[622,722,724],{"class":624,"line":723},18,[622,725,635],{"class":628},[622,727,729],{"class":624,"line":728},19,[622,730,641],{"class":628},[622,732,734],{"class":624,"line":733},20,[622,735,676],{"class":628},[622,737,739],{"class":624,"line":738},21,[622,740,741],{"class":628},"  │  Request ends    │  status + duration computed\n",[622,743,745],{"class":624,"line":744},22,[622,746,688],{"class":628},[622,748,750],{"class":624,"line":749},23,[622,751,635],{"class":628},[622,753,755],{"class":624,"line":754},24,[622,756,641],{"class":628},[622,758,760],{"class":624,"line":759},25,[622,761,676],{"class":628},[622,763,765],{"class":624,"line":764},26,[622,766,767],{"class":628},"  │  Tail Sampling   │  evlog:emit:keep hook\n",[622,769,771],{"class":624,"line":770},27,[622,772,773],{"class":628},"  │  (keep?)         │  force-keep based on outcome\n",[622,775,777],{"class":624,"line":776},28,[622,778,688],{"class":628},[622,780,782],{"class":624,"line":781},29,[622,783,635],{"class":628},[622,785,787],{"class":624,"line":786},30,[622,788,641],{"class":628},[622,790,792],{"class":624,"line":791},31,[622,793,676],{"class":628},[622,795,797],{"class":624,"line":796},32,[622,798,799],{"class":628},"  │  Head Sampling   │  random % per level\n",[622,801,803],{"class":624,"line":802},33,[622,804,805],{"class":628},"  │  (sample?)       │  skipped if tail said \"keep\"\n",[622,807,809],{"class":624,"line":808},34,[622,810,688],{"class":628},[622,812,814],{"class":624,"line":813},35,[622,815,816],{"class":628},"       │ sampled out? ──▶ discard (no output)\n",[622,818,820],{"class":624,"line":819},36,[622,821,635],{"class":628},[622,823,825],{"class":624,"line":824},37,[622,826,641],{"class":628},[622,828,830],{"class":624,"line":829},38,[622,831,676],{"class":628},[622,833,835],{"class":624,"line":834},39,[622,836,837],{"class":628},"  │  Emit            │  WideEvent built + console output\n",[622,839,841],{"class":624,"line":840},40,[622,842,688],{"class":628},[622,844,846],{"class":624,"line":845},41,[622,847,635],{"class":628},[622,849,851],{"class":624,"line":850},42,[622,852,641],{"class":628},[622,854,856],{"class":624,"line":855},43,[622,857,676],{"class":628},[622,859,861],{"class":624,"line":860},44,[622,862,863],{"class":628},"  │  Enrich          │  evlog:enrich hook\n",[622,865,867],{"class":624,"line":866},45,[622,868,869],{"class":628},"  │                  │  user-agent, geo, trace, custom\n",[622,871,873],{"class":624,"line":872},46,[622,874,688],{"class":628},[622,876,878],{"class":624,"line":877},47,[622,879,635],{"class":628},[622,881,883],{"class":624,"line":882},48,[622,884,641],{"class":628},[622,886,888],{"class":624,"line":887},49,[622,889,676],{"class":628},[622,891,893],{"class":624,"line":892},50,[622,894,895],{"class":628},"  │  Drain           │  evlog:drain hook\n",[622,897,899],{"class":624,"line":898},51,[622,900,901],{"class":628},"  │                  │  Axiom, OTLP, Sentry, custom\n",[622,903,905],{"class":624,"line":904},52,[622,906,688],{"class":628},[622,908,910],{"class":624,"line":909},53,[622,911,635],{"class":628},[622,913,915],{"class":624,"line":914},54,[622,916,641],{"class":628},[622,918,920],{"class":624,"line":919},55,[622,921,922],{"class":628},"   Done\n",[415,924,926],{"id":925},"step-by-step","Step by Step",[928,929,931],"h3",{"id":930},"_1-route-filtering","1. Route Filtering",[408,933,934,935,444,938,941],{},"When a request arrives, evlog checks whether the path matches the configured ",[435,936,937],{},"include",[435,939,940],{},"exclude"," patterns. If the route is excluded, no logger is created and the request proceeds without any logging overhead.",[408,943,944,945,947],{},"By default, all routes are logged. Use ",[435,946,937],{}," to restrict logging to specific patterns:",[613,949,954],{"className":950,"code":951,"filename":952,"language":953,"meta":618,"style":618},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: ['evlog\u002Fnuxt'],\n  evlog: {\n    include: ['\u002Fapi\u002F**'],\n  },\n})\n","nuxt.config.ts","typescript",[435,955,956,976,1003,1013,1033,1038],{"__ignoreMap":618},[622,957,958,962,965,969,972],{"class":624,"line":625},[622,959,961],{"class":960},"s7zQu","export",[622,963,964],{"class":960}," default",[622,966,968],{"class":967},"s2Zo4"," defineNuxtConfig",[622,970,971],{"class":628},"(",[622,973,975],{"class":974},"sMK4o","{\n",[622,977,978,982,985,988,991,995,997,1000],{"class":624,"line":632},[622,979,981],{"class":980},"swJcz","  modules",[622,983,984],{"class":974},":",[622,986,987],{"class":628}," [",[622,989,990],{"class":974},"'",[622,992,994],{"class":993},"sfazB","evlog\u002Fnuxt",[622,996,990],{"class":974},[622,998,999],{"class":628},"]",[622,1001,1002],{"class":974},",\n",[622,1004,1005,1008,1010],{"class":624,"line":638},[622,1006,1007],{"class":980},"  evlog",[622,1009,984],{"class":974},[622,1011,1012],{"class":974}," {\n",[622,1014,1015,1018,1020,1022,1024,1027,1029,1031],{"class":624,"line":644},[622,1016,1017],{"class":980},"    include",[622,1019,984],{"class":974},[622,1021,987],{"class":628},[622,1023,990],{"class":974},[622,1025,1026],{"class":993},"\u002Fapi\u002F**",[622,1028,990],{"class":974},[622,1030,999],{"class":628},[622,1032,1002],{"class":974},[622,1034,1035],{"class":624,"line":650},[622,1036,1037],{"class":974},"  },\n",[622,1039,1040,1043],{"class":624,"line":656},[622,1041,1042],{"class":974},"}",[622,1044,1045],{"class":628},")\n",[928,1047,1049],{"id":1048},"_2-logger-creation","2. Logger Creation",[408,1051,1052,1053,1056],{},"For matched routes, evlog creates a ",[435,1054,1055],{},"RequestLogger"," and attaches it to the request context. The logger is pre-populated with:",[420,1058,1059,1069],{},[423,1060,1061],{},[426,1062,1063,1066],{},[429,1064,1065],{},"Field",[429,1067,1068],{},"Source",[452,1070,1071,1089,1099,1113],{},[426,1072,1073,1078],{},[457,1074,1075],{},[435,1076,1077],{},"method",[457,1079,1080,1081,1084,1085,1088],{},"HTTP method (",[435,1082,1083],{},"GET",", ",[435,1086,1087],{},"POST",", ...)",[426,1090,1091,1096],{},[457,1092,1093],{},[435,1094,1095],{},"path",[457,1097,1098],{},"Request path",[426,1100,1101,1106],{},[457,1102,1103],{},[435,1104,1105],{},"requestId",[457,1107,1108,1109,1112],{},"Auto-generated UUID (or ",[435,1110,1111],{},"cf-ray"," on Cloudflare)",[426,1114,1115,1120],{},[457,1116,1117],{},[435,1118,1119],{},"startTime",[457,1121,1122,1125],{},[435,1123,1124],{},"Date.now()"," for duration calculation",[408,1127,1128,1129,1131],{},"The logger is stored on the event context. ",[435,1130,501],{}," is a shortcut to retrieve it, it doesn't create a new logger.",[928,1133,1135],{"id":1134},"_3-context-accumulation","3. Context Accumulation",[408,1137,1138,1139,1141],{},"During the handler, you call ",[435,1140,492],{}," to attach context. Each call deep-merges into the existing context, so you can call it as many times as needed:",[613,1143,1146],{"className":950,"code":1144,"filename":1145,"language":953,"meta":618,"style":618},"import { useLogger } from 'evlog'\n\nconst log = useLogger(event)\n\nconst user = await getUser(event)\nlog.set({ user: { id: user.id, plan: user.plan } })\n\nconst cart = await getCart(user.id)\nlog.set({ cart: { items: cart.items.length, total: cart.total } })\n","server\u002Fapi\u002Fcheckout.post.ts",[435,1147,1148,1174,1180,1197,1201,1218,1271,1275,1297],{"__ignoreMap":618},[622,1149,1150,1153,1156,1159,1162,1165,1168,1171],{"class":624,"line":625},[622,1151,1152],{"class":960},"import",[622,1154,1155],{"class":974}," {",[622,1157,1158],{"class":628}," useLogger",[622,1160,1161],{"class":974}," }",[622,1163,1164],{"class":960}," from",[622,1166,1167],{"class":974}," '",[622,1169,1170],{"class":993},"evlog",[622,1172,1173],{"class":974},"'\n",[622,1175,1176],{"class":624,"line":632},[622,1177,1179],{"emptyLinePlaceholder":1178},true,"\n",[622,1181,1182,1186,1189,1192,1194],{"class":624,"line":638},[622,1183,1185],{"class":1184},"spNyl","const",[622,1187,1188],{"class":628}," log ",[622,1190,1191],{"class":974},"=",[622,1193,1158],{"class":967},[622,1195,1196],{"class":628},"(event)\n",[622,1198,1199],{"class":624,"line":644},[622,1200,1179],{"emptyLinePlaceholder":1178},[622,1202,1203,1205,1208,1210,1213,1216],{"class":624,"line":650},[622,1204,1185],{"class":1184},[622,1206,1207],{"class":628}," user ",[622,1209,1191],{"class":974},[622,1211,1212],{"class":960}," await",[622,1214,1215],{"class":967}," getUser",[622,1217,1196],{"class":628},[622,1219,1220,1222,1224,1226,1228,1231,1234,1236,1238,1241,1243,1245,1247,1250,1253,1256,1258,1260,1262,1265,1267,1269],{"class":624,"line":656},[622,1221,437],{"class":628},[622,1223,601],{"class":974},[622,1225,579],{"class":967},[622,1227,971],{"class":628},[622,1229,1230],{"class":974},"{",[622,1232,1233],{"class":980}," user",[622,1235,984],{"class":974},[622,1237,1155],{"class":974},[622,1239,1240],{"class":980}," id",[622,1242,984],{"class":974},[622,1244,1233],{"class":628},[622,1246,601],{"class":974},[622,1248,1249],{"class":628},"id",[622,1251,1252],{"class":974},",",[622,1254,1255],{"class":980}," plan",[622,1257,984],{"class":974},[622,1259,1233],{"class":628},[622,1261,601],{"class":974},[622,1263,1264],{"class":628},"plan ",[622,1266,1042],{"class":974},[622,1268,1161],{"class":974},[622,1270,1045],{"class":628},[622,1272,1273],{"class":624,"line":662},[622,1274,1179],{"emptyLinePlaceholder":1178},[622,1276,1277,1279,1282,1284,1286,1289,1292,1294],{"class":624,"line":668},[622,1278,1185],{"class":1184},[622,1280,1281],{"class":628}," cart ",[622,1283,1191],{"class":974},[622,1285,1212],{"class":960},[622,1287,1288],{"class":967}," getCart",[622,1290,1291],{"class":628},"(user",[622,1293,601],{"class":974},[622,1295,1296],{"class":628},"id)\n",[622,1298,1299,1301,1303,1305,1307,1309,1312,1314,1316,1319,1321,1323,1325,1328,1330,1333,1335,1338,1340,1342,1344,1347,1349,1351],{"class":624,"line":673},[622,1300,437],{"class":628},[622,1302,601],{"class":974},[622,1304,579],{"class":967},[622,1306,971],{"class":628},[622,1308,1230],{"class":974},[622,1310,1311],{"class":980}," cart",[622,1313,984],{"class":974},[622,1315,1155],{"class":974},[622,1317,1318],{"class":980}," items",[622,1320,984],{"class":974},[622,1322,1311],{"class":628},[622,1324,601],{"class":974},[622,1326,1327],{"class":628},"items",[622,1329,601],{"class":974},[622,1331,1332],{"class":628},"length",[622,1334,1252],{"class":974},[622,1336,1337],{"class":980}," total",[622,1339,984],{"class":974},[622,1341,1311],{"class":628},[622,1343,601],{"class":974},[622,1345,1346],{"class":628},"total ",[622,1348,1042],{"class":974},[622,1350,1161],{"class":974},[622,1352,1045],{"class":628},[408,1354,1355,1356,1358],{},"If an error is thrown, evlog's ",[435,1357,582],{}," hook captures it automatically and records it on the logger with the status code.",[928,1360,1362],{"id":1361},"_4-request-end","4. Request End",[408,1364,1365],{},"When the response is sent (or an error is thrown), evlog computes:",[1367,1368,1369,1383,1392],"ul",{},[1370,1371,1372,1375,1376,444,1379,1382],"li",{},[460,1373,1374],{},"Status code"," from the response (or from the error's ",[435,1377,1378],{},"status",[435,1380,1381],{},"statusCode",")",[1370,1384,1385,1388,1389],{},[460,1386,1387],{},"Duration"," from ",[435,1390,1391],{},"Date.now() - startTime",[1370,1393,1394,1397,1398,1400,1401,1403,1404],{},[460,1395,1396],{},"Level"," - ",[435,1399,582],{}," if an error was recorded, ",[435,1402,588],{}," if status >= 400, otherwise ",[435,1405,585],{},[408,1407,1408],{},"If an error triggered the emit, the request is marked as already emitted to prevent double-emission in the response hook.",[928,1410,1412,1413,1382],{"id":1411},"_5-tail-sampling-evlogemitkeep","5. Tail Sampling (",[435,1414,1415],{},"evlog:emit:keep",[408,1417,1418,1419,1422,1423,1427],{},"Before the event is sampled, evlog evaluates ",[460,1420,1421],{},"tail sampling"," rules. These run ",[1424,1425,1426],"em",{},"after"," the request completes, so they can inspect the outcome:",[613,1429,1431],{"className":950,"code":1430,"filename":952,"language":953,"meta":618,"style":618},"evlog: {\n  sampling: {\n    keep: [\n      { duration: 1000 },          \u002F\u002F slow requests\n      { status: 400 },             \u002F\u002F client\u002Fserver errors\n      { path: '\u002Fapi\u002Fcritical\u002F**' }, \u002F\u002F critical paths\n    ],\n  },\n}\n",[435,1432,1433,1442,1451,1461,1482,1499,1520,1527,1531],{"__ignoreMap":618},[622,1434,1435,1438,1440],{"class":624,"line":625},[622,1436,1170],{"class":1437},"sBMFI",[622,1439,984],{"class":974},[622,1441,1012],{"class":974},[622,1443,1444,1447,1449],{"class":624,"line":632},[622,1445,1446],{"class":1437},"  sampling",[622,1448,984],{"class":974},[622,1450,1012],{"class":974},[622,1452,1453,1456,1458],{"class":624,"line":638},[622,1454,1455],{"class":1437},"    keep",[622,1457,984],{"class":974},[622,1459,1460],{"class":980}," [\n",[622,1462,1463,1466,1469,1471,1475,1478],{"class":624,"line":644},[622,1464,1465],{"class":974},"      {",[622,1467,1468],{"class":980}," duration",[622,1470,984],{"class":974},[622,1472,1474],{"class":1473},"sbssI"," 1000",[622,1476,1477],{"class":974}," },",[622,1479,1481],{"class":1480},"sHwdD","          \u002F\u002F slow requests\n",[622,1483,1484,1486,1489,1491,1494,1496],{"class":624,"line":650},[622,1485,1465],{"class":974},[622,1487,1488],{"class":980}," status",[622,1490,984],{"class":974},[622,1492,1493],{"class":1473}," 400",[622,1495,1477],{"class":974},[622,1497,1498],{"class":1480},"             \u002F\u002F client\u002Fserver errors\n",[622,1500,1501,1503,1506,1508,1510,1513,1515,1517],{"class":624,"line":656},[622,1502,1465],{"class":974},[622,1504,1505],{"class":980}," path",[622,1507,984],{"class":974},[622,1509,1167],{"class":974},[622,1511,1512],{"class":993},"\u002Fapi\u002Fcritical\u002F**",[622,1514,990],{"class":974},[622,1516,1477],{"class":974},[622,1518,1519],{"class":1480}," \u002F\u002F critical paths\n",[622,1521,1522,1525],{"class":624,"line":662},[622,1523,1524],{"class":980},"    ]",[622,1526,1002],{"class":974},[622,1528,1529],{"class":624,"line":668},[622,1530,1037],{"class":974},[622,1532,1533],{"class":624,"line":673},[622,1534,1535],{"class":974},"}\n",[408,1537,1538,1539,1541],{},"The ",[435,1540,1415],{}," hook also fires, letting you force-keep based on custom business logic:",[613,1543,1546],{"className":950,"code":1544,"filename":1545,"language":953,"meta":618,"style":618},"export default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:emit:keep', (ctx) => {\n    if (ctx.context.user?.premium) {\n      ctx.shouldKeep = true\n    }\n  })\n})\n","server\u002Fplugins\u002Fevlog-custom.ts",[435,1547,1548,1572,1609,1639,1656,1661,1668],{"__ignoreMap":618},[622,1549,1550,1552,1554,1557,1559,1561,1565,1567,1570],{"class":624,"line":625},[622,1551,961],{"class":960},[622,1553,964],{"class":960},[622,1555,1556],{"class":967}," defineNitroPlugin",[622,1558,971],{"class":628},[622,1560,971],{"class":974},[622,1562,1564],{"class":1563},"sHdIc","nitroApp",[622,1566,1382],{"class":974},[622,1568,1569],{"class":1184}," =>",[622,1571,1012],{"class":974},[622,1573,1574,1577,1579,1582,1584,1587,1589,1591,1593,1595,1597,1600,1603,1605,1607],{"class":624,"line":632},[622,1575,1576],{"class":628},"  nitroApp",[622,1578,601],{"class":974},[622,1580,1581],{"class":628},"hooks",[622,1583,601],{"class":974},[622,1585,1586],{"class":967},"hook",[622,1588,971],{"class":980},[622,1590,990],{"class":974},[622,1592,1415],{"class":993},[622,1594,990],{"class":974},[622,1596,1252],{"class":974},[622,1598,1599],{"class":974}," (",[622,1601,1602],{"class":1563},"ctx",[622,1604,1382],{"class":974},[622,1606,1569],{"class":1184},[622,1608,1012],{"class":974},[622,1610,1611,1614,1616,1618,1620,1623,1625,1628,1631,1634,1637],{"class":624,"line":638},[622,1612,1613],{"class":960},"    if",[622,1615,1599],{"class":980},[622,1617,1602],{"class":628},[622,1619,601],{"class":974},[622,1621,1622],{"class":628},"context",[622,1624,601],{"class":974},[622,1626,1627],{"class":628},"user",[622,1629,1630],{"class":974},"?.",[622,1632,1633],{"class":628},"premium",[622,1635,1636],{"class":980},") ",[622,1638,975],{"class":974},[622,1640,1641,1644,1646,1649,1652],{"class":624,"line":644},[622,1642,1643],{"class":628},"      ctx",[622,1645,601],{"class":974},[622,1647,1648],{"class":628},"shouldKeep",[622,1650,1651],{"class":974}," =",[622,1653,1655],{"class":1654},"sfNiH"," true\n",[622,1657,1658],{"class":624,"line":650},[622,1659,1660],{"class":974},"    }\n",[622,1662,1663,1666],{"class":624,"line":656},[622,1664,1665],{"class":974},"  }",[622,1667,1045],{"class":980},[622,1669,1670,1672],{"class":624,"line":662},[622,1671,1042],{"class":974},[622,1673,1045],{"class":628},[408,1675,1676,1677,1680,1681,601],{},"If any rule or hook sets ",[435,1678,1679],{},"shouldKeep = true",", the event ",[460,1682,1683],{},"bypasses head sampling entirely",[928,1685,1687],{"id":1686},"_6-head-sampling","6. Head Sampling",[408,1689,1690],{},"If the event wasn't force-kept by tail sampling, head sampling applies. This is a random coin flip per log level.",[408,1692,1693,1694,1697],{},"By default, all levels are kept at 100% (no sampling). Configure ",[435,1695,1696],{},"sampling.rates"," to reduce volume in production:",[613,1699,1701],{"className":950,"code":1700,"filename":952,"language":953,"meta":618,"style":618},"evlog: {\n  sampling: {\n    rates: { info: 10, warn: 50, debug: 0 },\n  },\n}\n",[435,1702,1703,1711,1719,1759,1763],{"__ignoreMap":618},[622,1704,1705,1707,1709],{"class":624,"line":625},[622,1706,1170],{"class":1437},[622,1708,984],{"class":974},[622,1710,1012],{"class":974},[622,1712,1713,1715,1717],{"class":624,"line":632},[622,1714,1446],{"class":1437},[622,1716,984],{"class":974},[622,1718,1012],{"class":974},[622,1720,1721,1724,1726,1728,1731,1733,1736,1738,1741,1743,1746,1748,1751,1753,1756],{"class":624,"line":638},[622,1722,1723],{"class":1437},"    rates",[622,1725,984],{"class":974},[622,1727,1155],{"class":974},[622,1729,1730],{"class":1437}," info",[622,1732,984],{"class":974},[622,1734,1735],{"class":1473}," 10",[622,1737,1252],{"class":974},[622,1739,1740],{"class":1437}," warn",[622,1742,984],{"class":974},[622,1744,1745],{"class":1473}," 50",[622,1747,1252],{"class":974},[622,1749,1750],{"class":1437}," debug",[622,1752,984],{"class":974},[622,1754,1755],{"class":1473}," 0",[622,1757,1758],{"class":974}," },\n",[622,1760,1761],{"class":624,"line":644},[622,1762,1037],{"class":974},[622,1764,1765],{"class":624,"line":650},[622,1766,1535],{"class":974},[1367,1768,1769,1775,1781],{},[1370,1770,1771,1774],{},[435,1772,1773],{},"info: 10"," - keep 10% of info-level events",[1370,1776,1777,1780],{},[435,1778,1779],{},"warn: 50"," - keep 50% of warnings",[1370,1782,1783,1785,1786,1789],{},[435,1784,582],{}," defaults to ",[460,1787,1788],{},"100%"," (never sampled out, even if you set a rate)",[408,1791,1792],{},"If the event is sampled out, processing stops entirely: no console output, no enrichment, no drain.",[928,1794,1796],{"id":1795},"_7-emit","7. Emit",[408,1798,1538,1799,1802],{},[435,1800,1801],{},"WideEvent"," object is built from the accumulated context:",[613,1804,1808],{"className":1805,"code":1806,"filename":1801,"language":1807,"meta":618,"style":618},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"timestamp\": \"2026-01-15T10:30:00.000Z\",\n  \"level\": \"info\",\n  \"service\": \"my-app\",\n  \"method\": \"POST\",\n  \"path\": \"\u002Fapi\u002Fcheckout\",\n  \"requestId\": \"abc-123\",\n  \"duration\": 234,\n  \"status\": 200,\n  \"user\": { \"id\": 1, \"plan\": \"pro\" },\n  \"cart\": { \"items\": 3, \"total\": 9999 }\n}\n","json",[435,1809,1810,1814,1837,1856,1876,1894,1913,1932,1948,1963,2006,2047],{"__ignoreMap":618},[622,1811,1812],{"class":624,"line":625},[622,1813,975],{"class":974},[622,1815,1816,1819,1822,1825,1827,1830,1833,1835],{"class":624,"line":632},[622,1817,1818],{"class":974},"  \"",[622,1820,1821],{"class":1184},"timestamp",[622,1823,1824],{"class":974},"\"",[622,1826,984],{"class":974},[622,1828,1829],{"class":974}," \"",[622,1831,1832],{"class":993},"2026-01-15T10:30:00.000Z",[622,1834,1824],{"class":974},[622,1836,1002],{"class":974},[622,1838,1839,1841,1844,1846,1848,1850,1852,1854],{"class":624,"line":638},[622,1840,1818],{"class":974},[622,1842,1843],{"class":1184},"level",[622,1845,1824],{"class":974},[622,1847,984],{"class":974},[622,1849,1829],{"class":974},[622,1851,585],{"class":993},[622,1853,1824],{"class":974},[622,1855,1002],{"class":974},[622,1857,1858,1860,1863,1865,1867,1869,1872,1874],{"class":624,"line":644},[622,1859,1818],{"class":974},[622,1861,1862],{"class":1184},"service",[622,1864,1824],{"class":974},[622,1866,984],{"class":974},[622,1868,1829],{"class":974},[622,1870,1871],{"class":993},"my-app",[622,1873,1824],{"class":974},[622,1875,1002],{"class":974},[622,1877,1878,1880,1882,1884,1886,1888,1890,1892],{"class":624,"line":650},[622,1879,1818],{"class":974},[622,1881,1077],{"class":1184},[622,1883,1824],{"class":974},[622,1885,984],{"class":974},[622,1887,1829],{"class":974},[622,1889,1087],{"class":993},[622,1891,1824],{"class":974},[622,1893,1002],{"class":974},[622,1895,1896,1898,1900,1902,1904,1906,1909,1911],{"class":624,"line":656},[622,1897,1818],{"class":974},[622,1899,1095],{"class":1184},[622,1901,1824],{"class":974},[622,1903,984],{"class":974},[622,1905,1829],{"class":974},[622,1907,1908],{"class":993},"\u002Fapi\u002Fcheckout",[622,1910,1824],{"class":974},[622,1912,1002],{"class":974},[622,1914,1915,1917,1919,1921,1923,1925,1928,1930],{"class":624,"line":662},[622,1916,1818],{"class":974},[622,1918,1105],{"class":1184},[622,1920,1824],{"class":974},[622,1922,984],{"class":974},[622,1924,1829],{"class":974},[622,1926,1927],{"class":993},"abc-123",[622,1929,1824],{"class":974},[622,1931,1002],{"class":974},[622,1933,1934,1936,1939,1941,1943,1946],{"class":624,"line":668},[622,1935,1818],{"class":974},[622,1937,1938],{"class":1184},"duration",[622,1940,1824],{"class":974},[622,1942,984],{"class":974},[622,1944,1945],{"class":1473}," 234",[622,1947,1002],{"class":974},[622,1949,1950,1952,1954,1956,1958,1961],{"class":624,"line":673},[622,1951,1818],{"class":974},[622,1953,1378],{"class":1184},[622,1955,1824],{"class":974},[622,1957,984],{"class":974},[622,1959,1960],{"class":1473}," 200",[622,1962,1002],{"class":974},[622,1964,1965,1967,1969,1971,1973,1975,1977,1979,1981,1983,1986,1988,1990,1993,1995,1997,1999,2002,2004],{"class":624,"line":679},[622,1966,1818],{"class":974},[622,1968,1627],{"class":1184},[622,1970,1824],{"class":974},[622,1972,984],{"class":974},[622,1974,1155],{"class":974},[622,1976,1829],{"class":974},[622,1978,1249],{"class":1437},[622,1980,1824],{"class":974},[622,1982,984],{"class":974},[622,1984,1985],{"class":1473}," 1",[622,1987,1252],{"class":974},[622,1989,1829],{"class":974},[622,1991,1992],{"class":1437},"plan",[622,1994,1824],{"class":974},[622,1996,984],{"class":974},[622,1998,1829],{"class":974},[622,2000,2001],{"class":993},"pro",[622,2003,1824],{"class":974},[622,2005,1758],{"class":974},[622,2007,2008,2010,2013,2015,2017,2019,2021,2023,2025,2027,2030,2032,2034,2037,2039,2041,2044],{"class":624,"line":685},[622,2009,1818],{"class":974},[622,2011,2012],{"class":1184},"cart",[622,2014,1824],{"class":974},[622,2016,984],{"class":974},[622,2018,1155],{"class":974},[622,2020,1829],{"class":974},[622,2022,1327],{"class":1437},[622,2024,1824],{"class":974},[622,2026,984],{"class":974},[622,2028,2029],{"class":1473}," 3",[622,2031,1252],{"class":974},[622,2033,1829],{"class":974},[622,2035,2036],{"class":1437},"total",[622,2038,1824],{"class":974},[622,2040,984],{"class":974},[622,2042,2043],{"class":1473}," 9999",[622,2045,2046],{"class":974}," }\n",[622,2048,2049],{"class":624,"line":691},[622,2050,1535],{"class":974},[408,2052,2053],{},"The event is printed to the console, pretty-formatted in development and as JSON in production. This is the default behavior, no configuration needed.",[928,2055,2057,2058,1382],{"id":2056},"_8-enrich-evlogenrich","8. Enrich (",[435,2059,2060],{},"evlog:enrich",[408,2062,2063],{},"After emission, enrichers add derived context to the event. Built-in enrichers extract data from request headers:",[420,2065,2066,2078],{},[423,2067,2068],{},[426,2069,2070,2073,2076],{},[429,2071,2072],{},"Enricher",[429,2074,2075],{},"Adds",[429,2077,1068],{},[452,2079,2080,2097,2111,2128],{},[426,2081,2082,2085,2091],{},[457,2083,2084],{},"User Agent",[457,2086,2087,2090],{},[435,2088,2089],{},"userAgent"," (browser, OS, device)",[457,2092,2093,2096],{},[435,2094,2095],{},"User-Agent"," header",[426,2098,2099,2102,2108],{},[457,2100,2101],{},"Geo",[457,2103,2104,2107],{},[435,2105,2106],{},"geo"," (country, region, city)",[457,2109,2110],{},"Platform headers (Vercel, Cloudflare)",[426,2112,2113,2116,2122],{},[457,2114,2115],{},"Request Size",[457,2117,2118,2121],{},[435,2119,2120],{},"requestSize"," (request\u002Fresponse bytes)",[457,2123,2124,2127],{},[435,2125,2126],{},"Content-Length"," headers",[426,2129,2130,2133,2139],{},[457,2131,2132],{},"Trace Context",[457,2134,2135,2138],{},[435,2136,2137],{},"traceContext"," (traceId, spanId)",[457,2140,2141,2096],{},[435,2142,2143],{},"traceparent",[613,2145,2148],{"className":950,"code":2146,"filename":2147,"language":953,"meta":618,"style":618},"import { createUserAgentEnricher, createGeoEnricher } from 'evlog\u002Fenrichers'\n\nexport default defineNitroPlugin((nitroApp) => {\n  const enrichers = [createUserAgentEnricher(), createGeoEnricher()]\n\n  nitroApp.hooks.hook('evlog:enrich', (ctx) => {\n    for (const enricher of enrichers) enricher(ctx)\n  })\n})\n","server\u002Fplugins\u002Fevlog-enrich.ts",[435,2149,2150,2175,2179,2199,2224,2228,2260,2288,2294],{"__ignoreMap":618},[622,2151,2152,2154,2156,2159,2161,2164,2166,2168,2170,2173],{"class":624,"line":625},[622,2153,1152],{"class":960},[622,2155,1155],{"class":974},[622,2157,2158],{"class":628}," createUserAgentEnricher",[622,2160,1252],{"class":974},[622,2162,2163],{"class":628}," createGeoEnricher",[622,2165,1161],{"class":974},[622,2167,1164],{"class":960},[622,2169,1167],{"class":974},[622,2171,2172],{"class":993},"evlog\u002Fenrichers",[622,2174,1173],{"class":974},[622,2176,2177],{"class":624,"line":632},[622,2178,1179],{"emptyLinePlaceholder":1178},[622,2180,2181,2183,2185,2187,2189,2191,2193,2195,2197],{"class":624,"line":638},[622,2182,961],{"class":960},[622,2184,964],{"class":960},[622,2186,1556],{"class":967},[622,2188,971],{"class":628},[622,2190,971],{"class":974},[622,2192,1564],{"class":1563},[622,2194,1382],{"class":974},[622,2196,1569],{"class":1184},[622,2198,1012],{"class":974},[622,2200,2201,2204,2207,2209,2211,2214,2217,2219,2221],{"class":624,"line":644},[622,2202,2203],{"class":1184},"  const",[622,2205,2206],{"class":628}," enrichers",[622,2208,1651],{"class":974},[622,2210,987],{"class":980},[622,2212,2213],{"class":967},"createUserAgentEnricher",[622,2215,2216],{"class":980},"()",[622,2218,1252],{"class":974},[622,2220,2163],{"class":967},[622,2222,2223],{"class":980},"()]\n",[622,2225,2226],{"class":624,"line":650},[622,2227,1179],{"emptyLinePlaceholder":1178},[622,2229,2230,2232,2234,2236,2238,2240,2242,2244,2246,2248,2250,2252,2254,2256,2258],{"class":624,"line":656},[622,2231,1576],{"class":628},[622,2233,601],{"class":974},[622,2235,1581],{"class":628},[622,2237,601],{"class":974},[622,2239,1586],{"class":967},[622,2241,971],{"class":980},[622,2243,990],{"class":974},[622,2245,2060],{"class":993},[622,2247,990],{"class":974},[622,2249,1252],{"class":974},[622,2251,1599],{"class":974},[622,2253,1602],{"class":1563},[622,2255,1382],{"class":974},[622,2257,1569],{"class":1184},[622,2259,1012],{"class":974},[622,2261,2262,2265,2267,2269,2272,2275,2277,2279,2282,2284,2286],{"class":624,"line":662},[622,2263,2264],{"class":960},"    for",[622,2266,1599],{"class":980},[622,2268,1185],{"class":1184},[622,2270,2271],{"class":628}," enricher",[622,2273,2274],{"class":974}," of",[622,2276,2206],{"class":628},[622,2278,1636],{"class":980},[622,2280,2281],{"class":967},"enricher",[622,2283,971],{"class":980},[622,2285,1602],{"class":628},[622,2287,1045],{"class":980},[622,2289,2290,2292],{"class":624,"line":668},[622,2291,1665],{"class":974},[622,2293,1045],{"class":980},[622,2295,2296,2298],{"class":624,"line":673},[622,2297,1042],{"class":974},[622,2299,1045],{"class":628},[408,2301,2302,2303,2306],{},"Enrichers receive the full ",[435,2304,2305],{},"EnrichContext"," with the mutable event, request metadata, safe headers, and response info.",[928,2308,2310,2311,1382],{"id":2309},"_9-drain-evlogdrain","9. Drain (",[435,2312,2313],{},"evlog:drain",[408,2315,2316,2317,2319,2320,2323],{},"The final step sends the enriched event to your observability platform. The ",[435,2318,2313],{}," hook receives a ",[435,2321,2322],{},"DrainContext"," with the complete event:",[613,2325,2328],{"className":950,"code":2326,"filename":2327,"language":953,"meta":618,"style":618},"import { createAxiomDrain } from 'evlog\u002Faxiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[435,2329,2330,2350,2354,2374,2401],{"__ignoreMap":618},[622,2331,2332,2334,2336,2339,2341,2343,2345,2348],{"class":624,"line":625},[622,2333,1152],{"class":960},[622,2335,1155],{"class":974},[622,2337,2338],{"class":628}," createAxiomDrain",[622,2340,1161],{"class":974},[622,2342,1164],{"class":960},[622,2344,1167],{"class":974},[622,2346,2347],{"class":993},"evlog\u002Faxiom",[622,2349,1173],{"class":974},[622,2351,2352],{"class":624,"line":632},[622,2353,1179],{"emptyLinePlaceholder":1178},[622,2355,2356,2358,2360,2362,2364,2366,2368,2370,2372],{"class":624,"line":638},[622,2357,961],{"class":960},[622,2359,964],{"class":960},[622,2361,1556],{"class":967},[622,2363,971],{"class":628},[622,2365,971],{"class":974},[622,2367,1564],{"class":1563},[622,2369,1382],{"class":974},[622,2371,1569],{"class":1184},[622,2373,1012],{"class":974},[622,2375,2376,2378,2380,2382,2384,2386,2388,2390,2392,2394,2396,2398],{"class":624,"line":644},[622,2377,1576],{"class":628},[622,2379,601],{"class":974},[622,2381,1581],{"class":628},[622,2383,601],{"class":974},[622,2385,1586],{"class":967},[622,2387,971],{"class":980},[622,2389,990],{"class":974},[622,2391,2313],{"class":993},[622,2393,990],{"class":974},[622,2395,1252],{"class":974},[622,2397,2338],{"class":967},[622,2399,2400],{"class":980},"())\n",[622,2402,2403,2405],{"class":624,"line":650},[622,2404,1042],{"class":974},[622,2406,1045],{"class":628},[408,2408,2409,2410,2413],{},"On platforms with ",[435,2411,2412],{},"waitUntil"," (Cloudflare Workers, Vercel Edge), the drain runs after the response is sent to avoid adding latency. On traditional servers, the drain is awaited to prevent losing events in serverless cold shutdowns.",[415,2415,2417],{"id":2416},"hook-execution-order","Hook Execution Order",[420,2419,2420,2436],{},[423,2421,2422],{},[426,2423,2424,2427,2430,2433],{},[429,2425,2426],{},"Order",[429,2428,2429],{},"Hook",[429,2431,2432],{},"When",[429,2434,2435],{},"Purpose",[452,2437,2438,2453,2468],{},[426,2439,2440,2443,2447,2450],{},[457,2441,2442],{},"1",[457,2444,2445],{},[435,2446,1415],{},[457,2448,2449],{},"After request ends, before sampling",[457,2451,2452],{},"Force-keep events based on outcome",[426,2454,2455,2458,2462,2465],{},[457,2456,2457],{},"2",[457,2459,2460],{},[435,2461,2060],{},[457,2463,2464],{},"After emit, before drain",[457,2466,2467],{},"Add derived context to the event",[426,2469,2470,2473,2477,2480],{},[457,2471,2472],{},"3",[457,2474,2475],{},[435,2476,2313],{},[457,2478,2479],{},"After enrichment",[457,2481,2482],{},"Send event to external services",[415,2484,2486],{"id":2485},"error-vs-success-path","Error vs Success Path",[408,2488,2489,2490,2493],{},"Both paths converge at the same emit\u002Fenrich\u002Fdrain pipeline. The only difference is ",[1424,2491,2492],{},"when"," the emit is triggered:",[420,2495,2496,2508],{},[423,2497,2498],{},[426,2499,2500,2502,2505],{},[429,2501],{},[429,2503,2504],{},"Success",[429,2506,2507],{},"Error",[452,2509,2510,2530,2548,2564,2585],{},[426,2511,2512,2517,2526],{},[457,2513,2514],{},[460,2515,2516],{},"Trigger",[457,2518,2519,444,2522,2525],{},[435,2520,2521],{},"afterResponse",[435,2523,2524],{},"response"," hook",[457,2527,2528,2525],{},[435,2529,582],{},[426,2531,2532,2536,2544],{},[457,2533,2534],{},[460,2535,1396],{},[457,2537,2538,2540,2541,2543],{},[435,2539,585],{}," (or ",[435,2542,588],{}," if status >= 400)",[457,2545,2546],{},[435,2547,582],{},[426,2549,2550,2555,2558],{},[457,2551,2552],{},[460,2553,2554],{},"Status",[457,2556,2557],{},"From response",[457,2559,2560,2561,2563],{},"From error's ",[435,2562,1378],{}," field (default 500)",[426,2565,2566,2571,2574],{},[457,2567,2568],{},[460,2569,2570],{},"Error context",[457,2572,2573],{},"None",[457,2575,2576,2578,2579,1084,2582],{},[435,2577,582],{}," field with message, stack, ",[435,2580,2581],{},"why",[435,2583,2584],{},"fix",[426,2586,2587,2592,2599],{},[457,2588,2589],{},[460,2590,2591],{},"Double-emit guard",[457,2593,2594,2595,2598],{},"Checks ",[435,2596,2597],{},"_evlogEmitted"," flag",[457,2600,2601,2602],{},"Sets ",[435,2603,2604],{},"_evlogEmitted = true",[415,2606,2608],{"id":2607},"simple-logging-pipeline","Simple Logging Pipeline",[408,2610,2611,2612,2614],{},"When using the ",[435,2613,437],{}," singleton, the pipeline is shorter:",[2616,2617,2618,2630,2635],"ol",{},[1370,2619,2620,2623,2624,471,2627],{},[460,2621,2622],{},"Call",": ",[435,2625,2626],{},"log.info({ action: 'deploy' })",[435,2628,2629],{},"log.info('tag', 'message')",[1370,2631,2632,2634],{},[460,2633,508],{},": The event is built and printed immediately",[1370,2636,2637,2639,2640,2643,2644,2647],{},[460,2638,557],{},": If a global ",[435,2641,2642],{},"drain"," was configured via ",[435,2645,2646],{},"initLogger()",", the event is sent to external services",[408,2649,2650,2651,2653,2654,2657],{},"Tagged logs (",[435,2652,2629],{},") are console-only in pretty mode. Object-form logs (",[435,2655,2656],{},"log.info({ ... })",") always flow through the drain pipeline.",[415,2659,2661],{"id":2660},"standalone-wide-event-pipeline","Standalone Wide Event Pipeline",[408,2663,2664,2665,2668],{},"When using ",[435,2666,2667],{},"createLogger()"," outside a framework:",[2616,2670,2671,2678,2694,2702,2710],{},[1370,2672,2673,2623,2675],{},[460,2674,462],{},[435,2676,2677],{},"createLogger({ jobId: 'sync-001' })",[1370,2679,2680,2623,2682,1084,2684,1084,2687,1084,2690,2693],{},[460,2681,484],{},[435,2683,492],{},[435,2685,2686],{},"log.info()",[435,2688,2689],{},"log.warn()",[435,2691,2692],{},"log.error()"," over the operation",[1370,2695,2696,2698,2699,2701],{},[460,2697,508],{},": Manual ",[435,2700,517],{}," call",[1370,2703,2704,2706,2707],{},[460,2705,527],{},": Head sampling applies based on computed level. Tail sampling via ",[435,2708,2709],{},"initLogger({ sampling: { keep: [...] } })",[1370,2711,2712,2639,2714,2716],{},[460,2713,557],{},[435,2715,2642],{}," was configured, the event is sent",[613,2718,2721],{"className":950,"code":2719,"filename":2720,"language":953,"meta":618,"style":618},"import { initLogger, createLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  env: { service: 'worker' },\n  drain: createAxiomDrain(),\n  sampling: { rates: { info: 10 } },\n})\n\nconst log = createLogger({ task: 'migrate' })\nlog.set({ records: 500, status: 'complete' })\nlog.emit()\n","scripts\u002Fmigrate.ts",[435,2722,2723,2747,2765,2769,2778,2801,2814,2839,2845,2849,2879,2916],{"__ignoreMap":618},[622,2724,2725,2727,2729,2732,2734,2737,2739,2741,2743,2745],{"class":624,"line":625},[622,2726,1152],{"class":960},[622,2728,1155],{"class":974},[622,2730,2731],{"class":628}," initLogger",[622,2733,1252],{"class":974},[622,2735,2736],{"class":628}," createLogger",[622,2738,1161],{"class":974},[622,2740,1164],{"class":960},[622,2742,1167],{"class":974},[622,2744,1170],{"class":993},[622,2746,1173],{"class":974},[622,2748,2749,2751,2753,2755,2757,2759,2761,2763],{"class":624,"line":632},[622,2750,1152],{"class":960},[622,2752,1155],{"class":974},[622,2754,2338],{"class":628},[622,2756,1161],{"class":974},[622,2758,1164],{"class":960},[622,2760,1167],{"class":974},[622,2762,2347],{"class":993},[622,2764,1173],{"class":974},[622,2766,2767],{"class":624,"line":638},[622,2768,1179],{"emptyLinePlaceholder":1178},[622,2770,2771,2774,2776],{"class":624,"line":644},[622,2772,2773],{"class":967},"initLogger",[622,2775,971],{"class":628},[622,2777,975],{"class":974},[622,2779,2780,2783,2785,2787,2790,2792,2794,2797,2799],{"class":624,"line":650},[622,2781,2782],{"class":980},"  env",[622,2784,984],{"class":974},[622,2786,1155],{"class":974},[622,2788,2789],{"class":980}," service",[622,2791,984],{"class":974},[622,2793,1167],{"class":974},[622,2795,2796],{"class":993},"worker",[622,2798,990],{"class":974},[622,2800,1758],{"class":974},[622,2802,2803,2806,2808,2810,2812],{"class":624,"line":656},[622,2804,2805],{"class":980},"  drain",[622,2807,984],{"class":974},[622,2809,2338],{"class":967},[622,2811,2216],{"class":628},[622,2813,1002],{"class":974},[622,2815,2816,2818,2820,2822,2825,2827,2829,2831,2833,2835,2837],{"class":624,"line":662},[622,2817,1446],{"class":980},[622,2819,984],{"class":974},[622,2821,1155],{"class":974},[622,2823,2824],{"class":980}," rates",[622,2826,984],{"class":974},[622,2828,1155],{"class":974},[622,2830,1730],{"class":980},[622,2832,984],{"class":974},[622,2834,1735],{"class":1473},[622,2836,1161],{"class":974},[622,2838,1758],{"class":974},[622,2840,2841,2843],{"class":624,"line":668},[622,2842,1042],{"class":974},[622,2844,1045],{"class":628},[622,2846,2847],{"class":624,"line":673},[622,2848,1179],{"emptyLinePlaceholder":1178},[622,2850,2851,2853,2855,2857,2859,2861,2863,2866,2868,2870,2873,2875,2877],{"class":624,"line":679},[622,2852,1185],{"class":1184},[622,2854,1188],{"class":628},[622,2856,1191],{"class":974},[622,2858,2736],{"class":967},[622,2860,971],{"class":628},[622,2862,1230],{"class":974},[622,2864,2865],{"class":980}," task",[622,2867,984],{"class":974},[622,2869,1167],{"class":974},[622,2871,2872],{"class":993},"migrate",[622,2874,990],{"class":974},[622,2876,1161],{"class":974},[622,2878,1045],{"class":628},[622,2880,2881,2883,2885,2887,2889,2891,2894,2896,2899,2901,2903,2905,2907,2910,2912,2914],{"class":624,"line":685},[622,2882,437],{"class":628},[622,2884,601],{"class":974},[622,2886,579],{"class":967},[622,2888,971],{"class":628},[622,2890,1230],{"class":974},[622,2892,2893],{"class":980}," records",[622,2895,984],{"class":974},[622,2897,2898],{"class":1473}," 500",[622,2900,1252],{"class":974},[622,2902,1488],{"class":980},[622,2904,984],{"class":974},[622,2906,1167],{"class":974},[622,2908,2909],{"class":993},"complete",[622,2911,990],{"class":974},[622,2913,1161],{"class":974},[622,2915,1045],{"class":628},[622,2917,2918,2920,2922,2924],{"class":624,"line":691},[622,2919,437],{"class":628},[622,2921,601],{"class":974},[622,2923,571],{"class":967},[622,2925,2926],{"class":628},"()\n",[415,2928,2930],{"id":2929},"next-steps","Next Steps",[1367,2932,2933,2938,2943,2948],{},[1370,2934,2935,2937],{},[597,2936,51],{"href":52}," - Design effective wide events",[1370,2939,2940,2942],{},[597,2941,175],{"href":176}," - Configure head and tail sampling",[1370,2944,2945,2947],{},[597,2946,300],{"href":305}," - Send events to external platforms",[1370,2949,2950,2952],{},[597,2951,387],{"href":392}," - Add derived context automatically",[2954,2955,2956],"style",{},"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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .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":618,"searchDepth":632,"depth":632,"links":2958},[2959,2960,2961,2975,2976,2977,2978,2979],{"id":417,"depth":632,"text":418},{"id":604,"depth":632,"text":605},{"id":925,"depth":632,"text":926,"children":2962},[2963,2964,2965,2966,2967,2969,2970,2971,2973],{"id":930,"depth":638,"text":931},{"id":1048,"depth":638,"text":1049},{"id":1134,"depth":638,"text":1135},{"id":1361,"depth":638,"text":1362},{"id":1411,"depth":638,"text":2968},"5. Tail Sampling (evlog:emit:keep)",{"id":1686,"depth":638,"text":1687},{"id":1795,"depth":638,"text":1796},{"id":2056,"depth":638,"text":2972},"8. Enrich (evlog:enrich)",{"id":2309,"depth":638,"text":2974},"9. Drain (evlog:drain)",{"id":2416,"depth":632,"text":2417},{"id":2485,"depth":632,"text":2486},{"id":2607,"depth":632,"text":2608},{"id":2660,"depth":632,"text":2661},{"id":2929,"depth":632,"text":2930},"Understand the full lifecycle of an evlog event, from creation to drain. Covers all three modes (simple logging, wide events, request logging), sampling, enrichment, and delivery.","md",[2983,2986],{"label":51,"icon":54,"to":52,"color":2984,"variant":2985},"neutral","subtle",{"label":175,"icon":178,"to":176,"color":2984,"variant":2985},{},{"icon":168},{"title":165,"description":2980},"ko0Yqtv5gfyASgTB4rgolHyD5Zyaq4AJN3VbVSQ4pIM",[2992,2994],{"title":156,"path":157,"stem":158,"description":2993,"icon":64,"children":-1},"File system, Axiom, and Postgres recipes for audit logs, plus mockAudit for tests and the full API reference.",{"title":170,"path":171,"stem":172,"description":2995,"icon":173,"children":-1},"Complete reference for all evlog configuration options including global logger settings, middleware options, environment context, and framework-specific overrides.",1778325963202]