[{"data":1,"prerenderedAt":2420},["ShallowReactive",2],{"navigation_docs":3,"-core-concepts-configuration":388,"-core-concepts-configuration-surround":2415},[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":166,"body":390,"description":2403,"extension":2404,"links":2405,"meta":2411,"navigation":2412,"path":167,"seo":2413,"stem":168,"__hash__":2414},"docs\u002F3.core-concepts\u002F1.configuration.md",{"type":391,"value":392,"toc":2387},"minimark",[393,406,416,423,698,925,932,989,1005,1009,1019,1158,1162,1168,1268,1277,1281,1284,1940,2066,2088,2092,2101,2226,2230,2233,2236,2246,2341,2348,2351,2376,2383],[394,395,396,397,401,402,405],"p",{},"evlog has two configuration surfaces: ",[398,399,400],"strong",{},"global options"," set once at startup, and ",[398,403,404],{},"middleware options"," set per-framework integration. This page documents both.",[407,408,410,411,415],"h2",{"id":409},"global-options-initlogger","Global Options (",[412,413,414],"code",{},"initLogger",")",[394,417,418,419,422],{},"These options apply to all frameworks. Call ",[412,420,421],{},"initLogger()"," once at application startup for standalone frameworks (Hono, Express, Fastify, Elysia, NestJS, SvelteKit, Cloudflare Workers). For Nuxt and Nitro, these are set via module config and passed through automatically.",[424,425,431],"pre",{"className":426,"code":427,"filename":428,"language":429,"meta":430,"style":430},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { initLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  enabled: true,\n  env: { service: 'my-api', environment: 'production' },\n  pretty: false,\n  silent: false,\n  stringify: true,\n  minLevel: 'info',\n  sampling: { rates: { info: 10 }, keep: [{ status: 400 }] },\n  drain: createAxiomDrain(),\n})\n","src\u002Findex.ts","typescript","",[412,432,433,466,487,494,506,523,564,577,589,601,618,674,689],{"__ignoreMap":430},[434,435,438,442,446,450,453,456,459,463],"span",{"class":436,"line":437},"line",1,[434,439,441],{"class":440},"s7zQu","import",[434,443,445],{"class":444},"sMK4o"," {",[434,447,449],{"class":448},"sTEyZ"," initLogger",[434,451,452],{"class":444}," }",[434,454,455],{"class":440}," from",[434,457,458],{"class":444}," '",[434,460,462],{"class":461},"sfazB","evlog",[434,464,465],{"class":444},"'\n",[434,467,469,471,473,476,478,480,482,485],{"class":436,"line":468},2,[434,470,441],{"class":440},[434,472,445],{"class":444},[434,474,475],{"class":448}," createAxiomDrain",[434,477,452],{"class":444},[434,479,455],{"class":440},[434,481,458],{"class":444},[434,483,484],{"class":461},"evlog\u002Faxiom",[434,486,465],{"class":444},[434,488,490],{"class":436,"line":489},3,[434,491,493],{"emptyLinePlaceholder":492},true,"\n",[434,495,497,500,503],{"class":436,"line":496},4,[434,498,414],{"class":499},"s2Zo4",[434,501,502],{"class":448},"(",[434,504,505],{"class":444},"{\n",[434,507,509,513,516,520],{"class":436,"line":508},5,[434,510,512],{"class":511},"swJcz","  enabled",[434,514,515],{"class":444},":",[434,517,519],{"class":518},"sfNiH"," true",[434,521,522],{"class":444},",\n",[434,524,526,529,531,533,536,538,540,543,546,549,552,554,556,559,561],{"class":436,"line":525},6,[434,527,528],{"class":511},"  env",[434,530,515],{"class":444},[434,532,445],{"class":444},[434,534,535],{"class":511}," service",[434,537,515],{"class":444},[434,539,458],{"class":444},[434,541,542],{"class":461},"my-api",[434,544,545],{"class":444},"'",[434,547,548],{"class":444},",",[434,550,551],{"class":511}," environment",[434,553,515],{"class":444},[434,555,458],{"class":444},[434,557,558],{"class":461},"production",[434,560,545],{"class":444},[434,562,563],{"class":444}," },\n",[434,565,567,570,572,575],{"class":436,"line":566},7,[434,568,569],{"class":511},"  pretty",[434,571,515],{"class":444},[434,573,574],{"class":518}," false",[434,576,522],{"class":444},[434,578,580,583,585,587],{"class":436,"line":579},8,[434,581,582],{"class":511},"  silent",[434,584,515],{"class":444},[434,586,574],{"class":518},[434,588,522],{"class":444},[434,590,592,595,597,599],{"class":436,"line":591},9,[434,593,594],{"class":511},"  stringify",[434,596,515],{"class":444},[434,598,519],{"class":518},[434,600,522],{"class":444},[434,602,604,607,609,611,614,616],{"class":436,"line":603},10,[434,605,606],{"class":511},"  minLevel",[434,608,515],{"class":444},[434,610,458],{"class":444},[434,612,613],{"class":461},"info",[434,615,545],{"class":444},[434,617,522],{"class":444},[434,619,621,624,626,628,631,633,635,638,640,644,647,650,652,655,658,661,663,666,668,671],{"class":436,"line":620},11,[434,622,623],{"class":511},"  sampling",[434,625,515],{"class":444},[434,627,445],{"class":444},[434,629,630],{"class":511}," rates",[434,632,515],{"class":444},[434,634,445],{"class":444},[434,636,637],{"class":511}," info",[434,639,515],{"class":444},[434,641,643],{"class":642},"sbssI"," 10",[434,645,646],{"class":444}," },",[434,648,649],{"class":511}," keep",[434,651,515],{"class":444},[434,653,654],{"class":448}," [",[434,656,657],{"class":444},"{",[434,659,660],{"class":511}," status",[434,662,515],{"class":444},[434,664,665],{"class":642}," 400",[434,667,452],{"class":444},[434,669,670],{"class":448},"] ",[434,672,673],{"class":444},"},\n",[434,675,677,680,682,684,687],{"class":436,"line":676},12,[434,678,679],{"class":511},"  drain",[434,681,515],{"class":444},[434,683,475],{"class":499},[434,685,686],{"class":448},"()",[434,688,522],{"class":444},[434,690,692,695],{"class":436,"line":691},13,[434,693,694],{"class":444},"}",[434,696,697],{"class":448},")\n",[699,700,701,720],"table",{},[702,703,704],"thead",{},[705,706,707,711,714,717],"tr",{},[708,709,710],"th",{},"Option",[708,712,713],{},"Type",[708,715,716],{},"Default",[708,718,719],{},"Description",[721,722,723,748,766,788,806,830,858,881,906],"tbody",{},[705,724,725,731,736,741],{},[726,727,728],"td",{},[412,729,730],{},"enabled",[726,732,733],{},[412,734,735],{},"boolean",[726,737,738],{},[412,739,740],{},"true",[726,742,743,744,747],{},"Enable\u002Fdisable all logging globally. When ",[412,745,746],{},"false",", all operations become no-ops",[705,749,750,755,760,763],{},[726,751,752],{},[412,753,754],{},"env",[726,756,757],{},[412,758,759],{},"Partial\u003CEnvironmentContext>",[726,761,762],{},"Auto-detected",[726,764,765],{},"Environment context overrides (see below)",[705,767,768,773,777,782],{},[726,769,770],{},[412,771,772],{},"pretty",[726,774,775],{},[412,776,735],{},[726,778,779,781],{},[412,780,740],{}," in dev",[726,783,784,785],{},"Pretty print with tree formatting. Auto-detected based on ",[412,786,787],{},"NODE_ENV",[705,789,790,795,799,803],{},[726,791,792],{},[412,793,794],{},"silent",[726,796,797],{},[412,798,735],{},[726,800,801],{},[412,802,746],{},[726,804,805],{},"Suppress console output. Events are still built, sampled, and passed to drains",[705,807,808,813,817,821],{},[726,809,810],{},[412,811,812],{},"stringify",[726,814,815],{},[412,816,735],{},[726,818,819],{},[412,820,740],{},[726,822,823,824,826,827,829],{},"Emit JSON strings when ",[412,825,772],{}," is disabled. Set to ",[412,828,746],{}," for Cloudflare Workers",[705,831,832,837,842,847],{},[726,833,834],{},[412,835,836],{},"minLevel",[726,838,839],{},[412,840,841],{},"'debug' | 'info' | 'warn' | 'error'",[726,843,844],{},[412,845,846],{},"'debug'",[726,848,849,850,853,854,857],{},"Minimum severity for the global ",[412,851,852],{},"log"," API only (not ",[412,855,856],{},"createLogger"," \u002F request wide events). Order: debug \u003C info \u003C warn \u003C error",[705,859,860,865,870,875],{},[726,861,862],{},[412,863,864],{},"sampling",[726,866,867],{},[412,868,869],{},"SamplingConfig",[726,871,872],{},[412,873,874],{},"undefined",[726,876,877,878],{},"Head and tail sampling configuration. See ",[879,880,171],"a",{"href":172},[705,882,883,888,893,898],{},[726,884,885],{},[412,886,887],{},"redact",[726,889,890],{},[412,891,892],{},"boolean | RedactConfig",[726,894,895,897],{},[412,896,740],{}," in production",[726,899,900,901,903,904],{},"Enabled by default in production. ",[412,902,746],{}," to disable. Object for fine-grained control. See ",[879,905,193],{"href":194},[705,907,908,913,918,922],{},[726,909,910],{},[412,911,912],{},"drain",[726,914,915],{},[412,916,917],{},"(ctx: DrainContext) => void",[726,919,920],{},[412,921,874],{},[726,923,924],{},"Drain callback for sending events to external services",[926,927,929,931],"h3",{"id":928},"minlevel-vs-sampling",[412,930,836],{}," vs sampling",[933,934,935,973],"ul",{},[936,937,938,942,943,946,947,950,951,954,955,958,959,962,963,968,969,972],"li",{},[398,939,940],{},[412,941,836],{}," is a ",[398,944,945],{},"hard threshold"," on the simple ",[412,948,949],{},"log.*"," API: levels below the threshold are never emitted. It does ",[398,952,953],{},"not"," apply to wide events from ",[412,956,957],{},"useLogger"," \u002F ",[412,960,961],{},"createLogger().emit()"," — use ",[398,964,965],{},[412,966,967],{},"sampling.rates"," (and tail ",[412,970,971],{},"keep",") for request volume.",[936,974,975,978,979,981,982,985,986,988],{},[398,976,977],{},"Head sampling"," (",[412,980,967],{},") is ",[398,983,984],{},"probabilistic"," on what is already allowed by ",[412,987,836],{}," for simple logs.",[394,990,991,992,958,995,998,999,1001,1002,1004],{},"Evaluation order for ",[412,993,994],{},"log.info",[412,996,997],{},"log.debug"," \u002F etc.: ",[412,1000,730],{}," → ",[412,1003,836],{}," → head sampling → output.",[926,1006,1008],{"id":1007},"environment-context","Environment Context",[394,1010,1011,1012,1014,1015,1018],{},"The ",[412,1013,754],{}," option controls the fields included in every log event. Most values are auto-detected from environment variables and ",[412,1016,1017],{},"package.json",".",[699,1020,1021,1035],{},[702,1022,1023],{},[705,1024,1025,1028,1030,1032],{},[708,1026,1027],{},"Field",[708,1029,713],{},[708,1031,716],{},[708,1033,1034],{},"Auto-detected from",[721,1036,1037,1063,1083,1106,1132],{},[705,1038,1039,1044,1049,1054],{},[726,1040,1041],{},[412,1042,1043],{},"service",[726,1045,1046],{},[412,1047,1048],{},"string",[726,1050,1051],{},[412,1052,1053],{},"'app'",[726,1055,1056,1059,1060,1062],{},[412,1057,1058],{},"SERVICE_NAME",", ",[412,1061,1017],{}," name",[705,1064,1065,1070,1074,1079],{},[726,1066,1067],{},[412,1068,1069],{},"environment",[726,1071,1072],{},[412,1073,1048],{},[726,1075,1076],{},[412,1077,1078],{},"'development'",[726,1080,1081],{},[412,1082,787],{},[705,1084,1085,1090,1094,1098],{},[726,1086,1087],{},[412,1088,1089],{},"version",[726,1091,1092],{},[412,1093,1048],{},[726,1095,1096],{},[412,1097,874],{},[726,1099,1100,1059,1103,1105],{},[412,1101,1102],{},"APP_VERSION",[412,1104,1017],{}," version",[705,1107,1108,1113,1117,1121],{},[726,1109,1110],{},[412,1111,1112],{},"commitHash",[726,1114,1115],{},[412,1116,1048],{},[726,1118,1119],{},[412,1120,874],{},[726,1122,1123,1059,1126,1059,1129],{},[412,1124,1125],{},"COMMIT_SHA",[412,1127,1128],{},"GIT_COMMIT",[412,1130,1131],{},"VERCEL_GIT_COMMIT_SHA",[705,1133,1134,1139,1143,1147],{},[726,1135,1136],{},[412,1137,1138],{},"region",[726,1140,1141],{},[412,1142,1048],{},[726,1144,1145],{},[412,1146,874],{},[726,1148,1149,1059,1152,1059,1155],{},[412,1150,1151],{},"FLY_REGION",[412,1153,1154],{},"AWS_REGION",[412,1156,1157],{},"VERCEL_REGION",[926,1159,1161],{"id":1160},"silent-mode","Silent Mode",[394,1163,1164,1165,1167],{},"Use ",[412,1166,794],{}," when your deployment platform captures stdout as its primary log ingestion (GCP Cloud Run, AWS Lambda, Fly.io, Railway, etc.) and you want a drain adapter to control the output format.",[424,1169,1171],{"className":426,"code":1170,"filename":428,"language":429,"meta":430,"style":430},"import { initLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  silent: process.env.NODE_ENV === 'production',\n  drain: createAxiomDrain(),\n})\n",[412,1172,1173,1191,1209,1213,1221,1250,1262],{"__ignoreMap":430},[434,1174,1175,1177,1179,1181,1183,1185,1187,1189],{"class":436,"line":437},[434,1176,441],{"class":440},[434,1178,445],{"class":444},[434,1180,449],{"class":448},[434,1182,452],{"class":444},[434,1184,455],{"class":440},[434,1186,458],{"class":444},[434,1188,462],{"class":461},[434,1190,465],{"class":444},[434,1192,1193,1195,1197,1199,1201,1203,1205,1207],{"class":436,"line":468},[434,1194,441],{"class":440},[434,1196,445],{"class":444},[434,1198,475],{"class":448},[434,1200,452],{"class":444},[434,1202,455],{"class":440},[434,1204,458],{"class":444},[434,1206,484],{"class":461},[434,1208,465],{"class":444},[434,1210,1211],{"class":436,"line":489},[434,1212,493],{"emptyLinePlaceholder":492},[434,1214,1215,1217,1219],{"class":436,"line":496},[434,1216,414],{"class":499},[434,1218,502],{"class":448},[434,1220,505],{"class":444},[434,1222,1223,1225,1227,1230,1232,1234,1236,1239,1242,1244,1246,1248],{"class":436,"line":508},[434,1224,582],{"class":511},[434,1226,515],{"class":444},[434,1228,1229],{"class":448}," process",[434,1231,1018],{"class":444},[434,1233,754],{"class":448},[434,1235,1018],{"class":444},[434,1237,1238],{"class":448},"NODE_ENV ",[434,1240,1241],{"class":444},"===",[434,1243,458],{"class":444},[434,1245,558],{"class":461},[434,1247,545],{"class":444},[434,1249,522],{"class":444},[434,1251,1252,1254,1256,1258,1260],{"class":436,"line":525},[434,1253,679],{"class":511},[434,1255,515],{"class":444},[434,1257,475],{"class":499},[434,1259,686],{"class":448},[434,1261,522],{"class":444},[434,1263,1264,1266],{"class":436,"line":566},[434,1265,694],{"class":444},[434,1267,697],{"class":448},[1269,1270,1273,1274,1276],"callout",{"color":1271,"icon":1272},"warning","i-lucide-alert-triangle","If ",[412,1275,794],{}," is enabled without a drain, events are built and sampled but never output anywhere. evlog will warn you about this at startup.",[407,1278,1280],{"id":1279},"middleware-options","Middleware Options",[394,1282,1283],{},"These options are passed to the framework middleware\u002Fplugin. They control per-request behavior: which routes to log, how to drain and enrich events, and custom tail sampling logic.",[1285,1286,1287,1587,1781,1878],"code-group",{},[424,1288,1290],{"className":426,"code":1289,"filename":212,"language":429,"meta":430,"style":430},"\u002F\u002F lib\u002Fevlog.ts\nimport { createEvlog } from 'evlog\u002Fnext'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nexport const { withEvlog, useLogger, log, createError } = createEvlog({\n  service: 'my-app',\n  include: ['\u002Fapi\u002F**'],\n  exclude: ['\u002Fapi\u002Fhealth'],\n  routes: { '\u002Fapi\u002Fauth\u002F**': { service: 'auth' } },\n  drain: createAxiomDrain(),\n  enrich: (ctx) => { ctx.event.region = process.env.FLY_REGION },\n  keep: (ctx) => { if (ctx.duration > 2000) ctx.shouldKeep = true },\n})\n",[412,1291,1292,1298,1318,1336,1340,1380,1396,1417,1437,1472,1484,1530,1581],{"__ignoreMap":430},[434,1293,1294],{"class":436,"line":437},[434,1295,1297],{"class":1296},"sHwdD","\u002F\u002F lib\u002Fevlog.ts\n",[434,1299,1300,1302,1304,1307,1309,1311,1313,1316],{"class":436,"line":468},[434,1301,441],{"class":440},[434,1303,445],{"class":444},[434,1305,1306],{"class":448}," createEvlog",[434,1308,452],{"class":444},[434,1310,455],{"class":440},[434,1312,458],{"class":444},[434,1314,1315],{"class":461},"evlog\u002Fnext",[434,1317,465],{"class":444},[434,1319,1320,1322,1324,1326,1328,1330,1332,1334],{"class":436,"line":489},[434,1321,441],{"class":440},[434,1323,445],{"class":444},[434,1325,475],{"class":448},[434,1327,452],{"class":444},[434,1329,455],{"class":440},[434,1331,458],{"class":444},[434,1333,484],{"class":461},[434,1335,465],{"class":444},[434,1337,1338],{"class":436,"line":496},[434,1339,493],{"emptyLinePlaceholder":492},[434,1341,1342,1345,1349,1351,1354,1356,1359,1361,1364,1366,1369,1371,1374,1376,1378],{"class":436,"line":508},[434,1343,1344],{"class":440},"export",[434,1346,1348],{"class":1347},"spNyl"," const",[434,1350,445],{"class":444},[434,1352,1353],{"class":448}," withEvlog",[434,1355,548],{"class":444},[434,1357,1358],{"class":448}," useLogger",[434,1360,548],{"class":444},[434,1362,1363],{"class":448}," log",[434,1365,548],{"class":444},[434,1367,1368],{"class":448}," createError ",[434,1370,694],{"class":444},[434,1372,1373],{"class":444}," =",[434,1375,1306],{"class":499},[434,1377,502],{"class":448},[434,1379,505],{"class":444},[434,1381,1382,1385,1387,1389,1392,1394],{"class":436,"line":525},[434,1383,1384],{"class":511},"  service",[434,1386,515],{"class":444},[434,1388,458],{"class":444},[434,1390,1391],{"class":461},"my-app",[434,1393,545],{"class":444},[434,1395,522],{"class":444},[434,1397,1398,1401,1403,1405,1407,1410,1412,1415],{"class":436,"line":566},[434,1399,1400],{"class":511},"  include",[434,1402,515],{"class":444},[434,1404,654],{"class":448},[434,1406,545],{"class":444},[434,1408,1409],{"class":461},"\u002Fapi\u002F**",[434,1411,545],{"class":444},[434,1413,1414],{"class":448},"]",[434,1416,522],{"class":444},[434,1418,1419,1422,1424,1426,1428,1431,1433,1435],{"class":436,"line":579},[434,1420,1421],{"class":511},"  exclude",[434,1423,515],{"class":444},[434,1425,654],{"class":448},[434,1427,545],{"class":444},[434,1429,1430],{"class":461},"\u002Fapi\u002Fhealth",[434,1432,545],{"class":444},[434,1434,1414],{"class":448},[434,1436,522],{"class":444},[434,1438,1439,1442,1444,1446,1448,1451,1453,1455,1457,1459,1461,1463,1466,1468,1470],{"class":436,"line":591},[434,1440,1441],{"class":511},"  routes",[434,1443,515],{"class":444},[434,1445,445],{"class":444},[434,1447,458],{"class":444},[434,1449,1450],{"class":511},"\u002Fapi\u002Fauth\u002F**",[434,1452,545],{"class":444},[434,1454,515],{"class":444},[434,1456,445],{"class":444},[434,1458,535],{"class":511},[434,1460,515],{"class":444},[434,1462,458],{"class":444},[434,1464,1465],{"class":461},"auth",[434,1467,545],{"class":444},[434,1469,452],{"class":444},[434,1471,563],{"class":444},[434,1473,1474,1476,1478,1480,1482],{"class":436,"line":603},[434,1475,679],{"class":511},[434,1477,515],{"class":444},[434,1479,475],{"class":499},[434,1481,686],{"class":448},[434,1483,522],{"class":444},[434,1485,1486,1489,1491,1493,1497,1499,1502,1504,1507,1509,1512,1514,1516,1518,1520,1522,1524,1526,1528],{"class":436,"line":620},[434,1487,1488],{"class":499},"  enrich",[434,1490,515],{"class":444},[434,1492,978],{"class":444},[434,1494,1496],{"class":1495},"sHdIc","ctx",[434,1498,415],{"class":444},[434,1500,1501],{"class":1347}," =>",[434,1503,445],{"class":444},[434,1505,1506],{"class":448}," ctx",[434,1508,1018],{"class":444},[434,1510,1511],{"class":448},"event",[434,1513,1018],{"class":444},[434,1515,1138],{"class":448},[434,1517,1373],{"class":444},[434,1519,1229],{"class":448},[434,1521,1018],{"class":444},[434,1523,754],{"class":448},[434,1525,1018],{"class":444},[434,1527,1151],{"class":448},[434,1529,563],{"class":444},[434,1531,1532,1535,1537,1539,1541,1543,1545,1547,1550,1552,1554,1556,1559,1562,1565,1568,1570,1572,1575,1577,1579],{"class":436,"line":676},[434,1533,1534],{"class":499},"  keep",[434,1536,515],{"class":444},[434,1538,978],{"class":444},[434,1540,1496],{"class":1495},[434,1542,415],{"class":444},[434,1544,1501],{"class":1347},[434,1546,445],{"class":444},[434,1548,1549],{"class":440}," if",[434,1551,978],{"class":511},[434,1553,1496],{"class":448},[434,1555,1018],{"class":444},[434,1557,1558],{"class":448},"duration",[434,1560,1561],{"class":444}," >",[434,1563,1564],{"class":642}," 2000",[434,1566,1567],{"class":511},") ",[434,1569,1496],{"class":448},[434,1571,1018],{"class":444},[434,1573,1574],{"class":448},"shouldKeep",[434,1576,1373],{"class":444},[434,1578,519],{"class":518},[434,1580,563],{"class":444},[434,1582,1583,1585],{"class":436,"line":691},[434,1584,694],{"class":444},[434,1586,697],{"class":448},[424,1588,1590],{"className":426,"code":1589,"filename":242,"language":429,"meta":430,"style":430},"app.use(evlog({\n  include: ['\u002Fapi\u002F**'],\n  exclude: ['\u002Fapi\u002Fhealth'],\n  routes: { '\u002Fapi\u002Fauth\u002F**': { service: 'auth' } },\n  drain: createAxiomDrain(),\n  enrich: (ctx) => { ctx.event.region = process.env.FLY_REGION },\n  keep: (ctx) => { if (ctx.duration > 2000) ctx.shouldKeep = true },\n}))\n",[412,1591,1592,1610,1628,1646,1678,1690,1730,1774],{"__ignoreMap":430},[434,1593,1594,1597,1599,1602,1604,1606,1608],{"class":436,"line":437},[434,1595,1596],{"class":448},"app",[434,1598,1018],{"class":444},[434,1600,1601],{"class":499},"use",[434,1603,502],{"class":448},[434,1605,462],{"class":499},[434,1607,502],{"class":448},[434,1609,505],{"class":444},[434,1611,1612,1614,1616,1618,1620,1622,1624,1626],{"class":436,"line":468},[434,1613,1400],{"class":511},[434,1615,515],{"class":444},[434,1617,654],{"class":448},[434,1619,545],{"class":444},[434,1621,1409],{"class":461},[434,1623,545],{"class":444},[434,1625,1414],{"class":448},[434,1627,522],{"class":444},[434,1629,1630,1632,1634,1636,1638,1640,1642,1644],{"class":436,"line":489},[434,1631,1421],{"class":511},[434,1633,515],{"class":444},[434,1635,654],{"class":448},[434,1637,545],{"class":444},[434,1639,1430],{"class":461},[434,1641,545],{"class":444},[434,1643,1414],{"class":448},[434,1645,522],{"class":444},[434,1647,1648,1650,1652,1654,1656,1658,1660,1662,1664,1666,1668,1670,1672,1674,1676],{"class":436,"line":496},[434,1649,1441],{"class":511},[434,1651,515],{"class":444},[434,1653,445],{"class":444},[434,1655,458],{"class":444},[434,1657,1450],{"class":511},[434,1659,545],{"class":444},[434,1661,515],{"class":444},[434,1663,445],{"class":444},[434,1665,535],{"class":511},[434,1667,515],{"class":444},[434,1669,458],{"class":444},[434,1671,1465],{"class":461},[434,1673,545],{"class":444},[434,1675,452],{"class":444},[434,1677,563],{"class":444},[434,1679,1680,1682,1684,1686,1688],{"class":436,"line":508},[434,1681,679],{"class":511},[434,1683,515],{"class":444},[434,1685,475],{"class":499},[434,1687,686],{"class":448},[434,1689,522],{"class":444},[434,1691,1692,1694,1696,1698,1700,1702,1704,1706,1708,1710,1712,1714,1716,1718,1720,1722,1724,1726,1728],{"class":436,"line":525},[434,1693,1488],{"class":499},[434,1695,515],{"class":444},[434,1697,978],{"class":444},[434,1699,1496],{"class":1495},[434,1701,415],{"class":444},[434,1703,1501],{"class":1347},[434,1705,445],{"class":444},[434,1707,1506],{"class":448},[434,1709,1018],{"class":444},[434,1711,1511],{"class":448},[434,1713,1018],{"class":444},[434,1715,1138],{"class":448},[434,1717,1373],{"class":444},[434,1719,1229],{"class":448},[434,1721,1018],{"class":444},[434,1723,754],{"class":448},[434,1725,1018],{"class":444},[434,1727,1151],{"class":448},[434,1729,563],{"class":444},[434,1731,1732,1734,1736,1738,1740,1742,1744,1746,1748,1750,1752,1754,1756,1758,1760,1762,1764,1766,1768,1770,1772],{"class":436,"line":566},[434,1733,1534],{"class":499},[434,1735,515],{"class":444},[434,1737,978],{"class":444},[434,1739,1496],{"class":1495},[434,1741,415],{"class":444},[434,1743,1501],{"class":1347},[434,1745,445],{"class":444},[434,1747,1549],{"class":440},[434,1749,978],{"class":511},[434,1751,1496],{"class":448},[434,1753,1018],{"class":444},[434,1755,1558],{"class":448},[434,1757,1561],{"class":444},[434,1759,1564],{"class":642},[434,1761,1567],{"class":511},[434,1763,1496],{"class":448},[434,1765,1018],{"class":444},[434,1767,1574],{"class":448},[434,1769,1373],{"class":444},[434,1771,519],{"class":518},[434,1773,563],{"class":444},[434,1775,1776,1778],{"class":436,"line":579},[434,1777,694],{"class":444},[434,1779,1780],{"class":448},"))\n",[424,1782,1784],{"className":426,"code":1783,"filename":237,"language":429,"meta":430,"style":430},"app.use(evlog({\n  include: ['\u002Fapi\u002F**'],\n  drain: createAxiomDrain(),\n  enrich: (ctx) => { ctx.event.region = process.env.FLY_REGION },\n}))\n",[412,1785,1786,1802,1820,1832,1872],{"__ignoreMap":430},[434,1787,1788,1790,1792,1794,1796,1798,1800],{"class":436,"line":437},[434,1789,1596],{"class":448},[434,1791,1018],{"class":444},[434,1793,1601],{"class":499},[434,1795,502],{"class":448},[434,1797,462],{"class":499},[434,1799,502],{"class":448},[434,1801,505],{"class":444},[434,1803,1804,1806,1808,1810,1812,1814,1816,1818],{"class":436,"line":468},[434,1805,1400],{"class":511},[434,1807,515],{"class":444},[434,1809,654],{"class":448},[434,1811,545],{"class":444},[434,1813,1409],{"class":461},[434,1815,545],{"class":444},[434,1817,1414],{"class":448},[434,1819,522],{"class":444},[434,1821,1822,1824,1826,1828,1830],{"class":436,"line":489},[434,1823,679],{"class":511},[434,1825,515],{"class":444},[434,1827,475],{"class":499},[434,1829,686],{"class":448},[434,1831,522],{"class":444},[434,1833,1834,1836,1838,1840,1842,1844,1846,1848,1850,1852,1854,1856,1858,1860,1862,1864,1866,1868,1870],{"class":436,"line":496},[434,1835,1488],{"class":499},[434,1837,515],{"class":444},[434,1839,978],{"class":444},[434,1841,1496],{"class":1495},[434,1843,415],{"class":444},[434,1845,1501],{"class":1347},[434,1847,445],{"class":444},[434,1849,1506],{"class":448},[434,1851,1018],{"class":444},[434,1853,1511],{"class":448},[434,1855,1018],{"class":444},[434,1857,1138],{"class":448},[434,1859,1373],{"class":444},[434,1861,1229],{"class":448},[434,1863,1018],{"class":444},[434,1865,754],{"class":448},[434,1867,1018],{"class":444},[434,1869,1151],{"class":448},[434,1871,563],{"class":444},[434,1873,1874,1876],{"class":436,"line":508},[434,1875,694],{"class":444},[434,1877,1780],{"class":448},[424,1879,1881],{"className":426,"code":1880,"filename":247,"language":429,"meta":430,"style":430},"await app.register(evlog, {\n  include: ['\u002Fapi\u002F**'],\n  drain: createAxiomDrain(),\n})\n",[412,1882,1883,1904,1922,1934],{"__ignoreMap":430},[434,1884,1885,1888,1891,1893,1896,1899,1901],{"class":436,"line":437},[434,1886,1887],{"class":440},"await",[434,1889,1890],{"class":448}," app",[434,1892,1018],{"class":444},[434,1894,1895],{"class":499},"register",[434,1897,1898],{"class":448},"(evlog",[434,1900,548],{"class":444},[434,1902,1903],{"class":444}," {\n",[434,1905,1906,1908,1910,1912,1914,1916,1918,1920],{"class":436,"line":468},[434,1907,1400],{"class":511},[434,1909,515],{"class":444},[434,1911,654],{"class":448},[434,1913,545],{"class":444},[434,1915,1409],{"class":461},[434,1917,545],{"class":444},[434,1919,1414],{"class":448},[434,1921,522],{"class":444},[434,1923,1924,1926,1928,1930,1932],{"class":436,"line":489},[434,1925,679],{"class":511},[434,1927,515],{"class":444},[434,1929,475],{"class":499},[434,1931,686],{"class":448},[434,1933,522],{"class":444},[434,1935,1936,1938],{"class":436,"line":496},[434,1937,694],{"class":444},[434,1939,697],{"class":448},[699,1941,1942,1954],{},[702,1943,1944],{},[705,1945,1946,1948,1950,1952],{},[708,1947,710],{},[708,1949,713],{},[708,1951,716],{},[708,1953,719],{},[721,1955,1956,1975,1993,2012,2029,2048],{},[705,1957,1958,1963,1968,1972],{},[726,1959,1960],{},[412,1961,1962],{},"include",[726,1964,1965],{},[412,1966,1967],{},"string[]",[726,1969,1970],{},[412,1971,874],{},[726,1973,1974],{},"Route glob patterns to log. If not set, all routes are logged",[705,1976,1977,1982,1986,1990],{},[726,1978,1979],{},[412,1980,1981],{},"exclude",[726,1983,1984],{},[412,1985,1967],{},[726,1987,1988],{},[412,1989,874],{},[726,1991,1992],{},"Route patterns to exclude. Exclusions take precedence over inclusions",[705,1994,1995,2000,2005,2009],{},[726,1996,1997],{},[412,1998,1999],{},"routes",[726,2001,2002],{},[412,2003,2004],{},"Record\u003Cstring, { service: string }>",[726,2006,2007],{},[412,2008,874],{},[726,2010,2011],{},"Route-specific service name overrides",[705,2013,2014,2018,2022,2026],{},[726,2015,2016],{},[412,2017,912],{},[726,2019,2020],{},[412,2021,917],{},[726,2023,2024],{},[412,2025,874],{},[726,2027,2028],{},"Drain callback called with every emitted event",[705,2030,2031,2036,2041,2045],{},[726,2032,2033],{},[412,2034,2035],{},"enrich",[726,2037,2038],{},[412,2039,2040],{},"(ctx: EnrichContext) => void",[726,2042,2043],{},[412,2044,874],{},[726,2046,2047],{},"Enrich callback called after emit, before drain",[705,2049,2050,2054,2059,2063],{},[726,2051,2052],{},[412,2053,971],{},[726,2055,2056],{},[412,2057,2058],{},"(ctx: TailSamplingContext) => void",[726,2060,2061],{},[412,2062,874],{},[726,2064,2065],{},"Custom tail sampling callback",[1269,2067,2068,2071,2072,1059,2075,1059,2078,2081,2082,2084,2085,2087],{"color":613,"icon":13},[398,2069,2070],{},"Nuxt and Nitro"," use module config and Nitro hooks (",[412,2073,2074],{},"evlog:drain",[412,2076,2077],{},"evlog:enrich",[412,2079,2080],{},"evlog:emit:keep",") instead of middleware options. See the ",[879,2083,207],{"href":208}," and ",[879,2086,222],{"href":223}," pages.",[926,2089,2091],{"id":2090},"middleware-drain-vs-global-drain","Middleware drain vs global drain",[394,2093,2094,2095,2097,2098,2100],{},"When a middleware ",[412,2096,912],{}," is set, it takes precedence over the global drain from ",[412,2099,421],{},". If no middleware drain is set, the global drain is used as fallback, with the benefit of receiving the full enriched event with request context (method, path, headers).",[424,2102,2104],{"className":426,"code":2103,"filename":428,"language":429,"meta":430,"style":430},"import { initLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  env: { service: 'my-api' },\n  drain: createAxiomDrain(), \u002F\u002F fallback: used by singleton log API AND middleware (if no middleware drain)\n})\n\napp.use(evlog({\n  \u002F\u002F no drain here - falls back to globalDrain from initLogger, with full request context\n}))\n",[412,2105,2106,2124,2142,2146,2154,2174,2189,2195,2199,2215,2220],{"__ignoreMap":430},[434,2107,2108,2110,2112,2114,2116,2118,2120,2122],{"class":436,"line":437},[434,2109,441],{"class":440},[434,2111,445],{"class":444},[434,2113,449],{"class":448},[434,2115,452],{"class":444},[434,2117,455],{"class":440},[434,2119,458],{"class":444},[434,2121,462],{"class":461},[434,2123,465],{"class":444},[434,2125,2126,2128,2130,2132,2134,2136,2138,2140],{"class":436,"line":468},[434,2127,441],{"class":440},[434,2129,445],{"class":444},[434,2131,475],{"class":448},[434,2133,452],{"class":444},[434,2135,455],{"class":440},[434,2137,458],{"class":444},[434,2139,484],{"class":461},[434,2141,465],{"class":444},[434,2143,2144],{"class":436,"line":489},[434,2145,493],{"emptyLinePlaceholder":492},[434,2147,2148,2150,2152],{"class":436,"line":496},[434,2149,414],{"class":499},[434,2151,502],{"class":448},[434,2153,505],{"class":444},[434,2155,2156,2158,2160,2162,2164,2166,2168,2170,2172],{"class":436,"line":508},[434,2157,528],{"class":511},[434,2159,515],{"class":444},[434,2161,445],{"class":444},[434,2163,535],{"class":511},[434,2165,515],{"class":444},[434,2167,458],{"class":444},[434,2169,542],{"class":461},[434,2171,545],{"class":444},[434,2173,563],{"class":444},[434,2175,2176,2178,2180,2182,2184,2186],{"class":436,"line":525},[434,2177,679],{"class":511},[434,2179,515],{"class":444},[434,2181,475],{"class":499},[434,2183,686],{"class":448},[434,2185,548],{"class":444},[434,2187,2188],{"class":1296}," \u002F\u002F fallback: used by singleton log API AND middleware (if no middleware drain)\n",[434,2190,2191,2193],{"class":436,"line":566},[434,2192,694],{"class":444},[434,2194,697],{"class":448},[434,2196,2197],{"class":436,"line":579},[434,2198,493],{"emptyLinePlaceholder":492},[434,2200,2201,2203,2205,2207,2209,2211,2213],{"class":436,"line":591},[434,2202,1596],{"class":448},[434,2204,1018],{"class":444},[434,2206,1601],{"class":499},[434,2208,502],{"class":448},[434,2210,462],{"class":499},[434,2212,502],{"class":448},[434,2214,505],{"class":444},[434,2216,2217],{"class":436,"line":603},[434,2218,2219],{"class":1296},"  \u002F\u002F no drain here - falls back to globalDrain from initLogger, with full request context\n",[434,2221,2222,2224],{"class":436,"line":620},[434,2223,694],{"class":444},[434,2225,1780],{"class":448},[407,2227,2229],{"id":2228},"framework-specific-options","Framework-Specific Options",[394,2231,2232],{},"Some frameworks have additional options beyond the shared config:",[926,2234,207],{"id":2235},"nuxt",[394,2237,2238,2239,2242,2243,2245],{},"The Nuxt module accepts all global options and middleware options in ",[412,2240,2241],{},"nuxt.config.ts"," under the ",[412,2244,462],{}," key, plus:",[699,2247,2248,2260],{},[702,2249,2250],{},[705,2251,2252,2254,2256,2258],{},[708,2253,710],{},[708,2255,713],{},[708,2257,716],{},[708,2259,719],{},[721,2261,2262,2280,2298,2317],{},[705,2263,2264,2269,2273,2277],{},[726,2265,2266],{},[412,2267,2268],{},"console",[726,2270,2271],{},[412,2272,735],{},[726,2274,2275],{},[412,2276,740],{},[726,2278,2279],{},"Enable\u002Fdisable browser console output (client-side only)",[705,2281,2282,2287,2291,2295],{},[726,2283,2284],{},[412,2285,2286],{},"transport.enabled",[726,2288,2289],{},[412,2290,735],{},[726,2292,2293],{},[412,2294,746],{},[726,2296,2297],{},"Send client logs to the server via API endpoint",[705,2299,2300,2305,2309,2314],{},[726,2301,2302],{},[412,2303,2304],{},"transport.endpoint",[726,2306,2307],{},[412,2308,1048],{},[726,2310,2311],{},[412,2312,2313],{},"'\u002Fapi\u002F_evlog\u002Fingest'",[726,2315,2316],{},"Custom transport endpoint",[705,2318,2319,2324,2329,2334],{},[726,2320,2321],{},[412,2322,2323],{},"transport.credentials",[726,2325,2326],{},[412,2327,2328],{},"RequestCredentials",[726,2330,2331],{},[412,2332,2333],{},"'same-origin'",[726,2335,2336,2337,2340],{},"Fetch credentials mode (",[412,2338,2339],{},"'include'"," for cross-origin endpoints)",[394,2342,2343,2344,1018],{},"See the full ",[879,2345,2347],{"href":2346},"\u002Fframeworks\u002Fnuxt#configuration","Nuxt configuration",[926,2349,222],{"id":2350},"nitro",[394,2352,2353,2354,1059,2356,1059,2358,1059,2360,1059,2362,1059,2364,1059,2366,2368,2369,2371,2372,2375],{},"The Nitro module accepts ",[412,2355,730],{},[412,2357,754],{},[412,2359,772],{},[412,2361,794],{},[412,2363,864],{},[412,2365,1962],{},[412,2367,1981],{},", and ",[412,2370,1999],{}," in ",[412,2373,2374],{},"nitro.config.ts",". Drain and enrichment are done via Nitro hooks.",[394,2377,2378,2379,1018],{},"See ",[879,2380,2382],{"href":2381},"\u002Fframeworks\u002Fnitro#drain--enrichers","Nitro drain & enrichers",[2384,2385,2386],"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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}",{"title":430,"searchDepth":468,"depth":468,"links":2388},[2389,2396,2399],{"id":409,"depth":468,"text":2390,"children":2391},"Global Options (initLogger)",[2392,2394,2395],{"id":928,"depth":489,"text":2393},"minLevel vs sampling",{"id":1007,"depth":489,"text":1008},{"id":1160,"depth":489,"text":1161},{"id":1279,"depth":468,"text":1280,"children":2397},[2398],{"id":2090,"depth":489,"text":2091},{"id":2228,"depth":468,"text":2229,"children":2400},[2401,2402],{"id":2235,"depth":489,"text":207},{"id":2350,"depth":489,"text":222},"Complete reference for all evlog configuration options including global logger settings, middleware options, environment context, and framework-specific overrides.","md",[2406,2409],{"label":171,"icon":174,"to":172,"color":2407,"variant":2408},"neutral","subtle",{"label":2410,"icon":88,"to":291,"color":2407,"variant":2408},"Drain Adapters",{},{"icon":169},{"title":166,"description":2403},"zQJYXD22Tmkw_b4qCh8Ma2ztDhtu7OXPvcD-6PqFTws",[2416,2418],{"title":161,"path":162,"stem":163,"description":2417,"icon":164,"children":-1},"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.",{"title":171,"path":172,"stem":173,"description":2419,"icon":174,"children":-1},"Control log volume with two-tier sampling. Head sampling drops noise by level, tail sampling rescues critical events based on outcome. Never miss errors, slow requests, or critical paths.",1777982710448]