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