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