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