[{"data":1,"prerenderedAt":2541},["ShallowReactive",2],{"navigation_docs":3,"-adapters-building-blocks-pipeline":388,"-adapters-building-blocks-pipeline-surround":2536},[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":390,"body":391,"description":2525,"extension":2526,"links":2527,"meta":2532,"navigation":2533,"path":355,"seo":2534,"stem":356,"__hash__":2535},"docs\u002F6.adapters\u002F04.building-blocks\u002F01.pipeline.md","Drain Pipeline",{"type":392,"value":393,"toc":2513},"minimark",[394,398,446,450,453,1322,1342,1346,1387,1390,1400,1722,1727,1873,1877,1932,1936,1943,2003,2007,2010,2220,2224,2227,2472,2487,2491,2509],[395,396,397],"p",{},"In production, sending one HTTP request per log event is wasteful. The drain pipeline buffers events and sends them in batches, retries on transient failures, and drops the oldest events when the buffer overflows.",[399,400,403,406,432],"prompt",{":actions":401,"description":402,"icon":357},"[\"copy\",\"cursor\",\"windsurf\"]","Add the drain pipeline (batch + retry + fan-out)",[395,404,405],{},"Wrap my evlog drain in the shared pipeline (batch + retry + buffer overflow protection).",[407,408,409,413,416,423,426,429],"ul",{},[410,411,412],"li",{},"Identify my framework and follow its evlog wiring pattern",[410,414,415],{},"Import createDrainPipeline from 'evlog\u002Fpipeline' and the adapter (e.g. evlog\u002Faxiom)",[410,417,418,419],{},"Wrap the adapter: const drain = createDrainPipeline",[420,421,422],"drain-context",{},"()(createAxiomDrain())",[410,424,425],{},"Configure batch ({ size, intervalMs }), retry ({ maxAttempts, backoff }), and bufferSize options",[410,427,428],{},"Use fan-out to send to multiple drains at once: pipeline(...adapters)",[410,430,431],{},"Hook drain.flush() on framework close \u002F SIGTERM so buffered events aren't lost on shutdown",[395,433,434,435,441,442],{},"Docs: ",[436,437,438],"a",{"href":438,"rel":439},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline",[440],"nofollow","\nAdapters: ",[436,443,444],{"href":444,"rel":445},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Foverview",[440],[447,448,20],"h2",{"id":449},"quick-start",[395,451,452],{},"The pipeline wraps any drain. The wiring depends on your framework — pick the tab that matches yours; every other example below uses the same shape.",[454,455,456,725,962,1158],"code-group",{},[457,458,464],"pre",{"className":459,"code":460,"filename":461,"language":462,"meta":463,"style":463},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nimport type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  const pipeline = createDrainPipeline\u003CDrainContext>()\n  const drain = pipeline(createAxiomDrain())\n\n  nitroApp.hooks.hook('evlog:drain', drain)\n  nitroApp.hooks.hook('close', () => drain.flush())\n})\n","Nuxt \u002F Nitro","typescript","",[465,466,467,476,510,531,552,559,591,619,639,644,679,717],"code",{"__ignoreMap":463},[468,469,472],"span",{"class":470,"line":471},"line",1,[468,473,475],{"class":474},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[468,477,479,483,486,490,494,497,500,503,507],{"class":470,"line":478},2,[468,480,482],{"class":481},"s7zQu","import",[468,484,485],{"class":481}," type",[468,487,489],{"class":488},"sMK4o"," {",[468,491,493],{"class":492},"sTEyZ"," DrainContext",[468,495,496],{"class":488}," }",[468,498,499],{"class":481}," from",[468,501,502],{"class":488}," '",[468,504,506],{"class":505},"sfazB","evlog",[468,508,509],{"class":488},"'\n",[468,511,513,515,517,520,522,524,526,529],{"class":470,"line":512},3,[468,514,482],{"class":481},[468,516,489],{"class":488},[468,518,519],{"class":492}," createDrainPipeline",[468,521,496],{"class":488},[468,523,499],{"class":481},[468,525,502],{"class":488},[468,527,528],{"class":505},"evlog\u002Fpipeline",[468,530,509],{"class":488},[468,532,534,536,538,541,543,545,547,550],{"class":470,"line":533},4,[468,535,482],{"class":481},[468,537,489],{"class":488},[468,539,540],{"class":492}," createAxiomDrain",[468,542,496],{"class":488},[468,544,499],{"class":481},[468,546,502],{"class":488},[468,548,549],{"class":505},"evlog\u002Faxiom",[468,551,509],{"class":488},[468,553,555],{"class":470,"line":554},5,[468,556,558],{"emptyLinePlaceholder":557},true,"\n",[468,560,562,565,568,572,575,577,581,584,588],{"class":470,"line":561},6,[468,563,564],{"class":481},"export",[468,566,567],{"class":481}," default",[468,569,571],{"class":570},"s2Zo4"," defineNitroPlugin",[468,573,574],{"class":492},"(",[468,576,574],{"class":488},[468,578,580],{"class":579},"sHdIc","nitroApp",[468,582,583],{"class":488},")",[468,585,587],{"class":586},"spNyl"," =>",[468,589,590],{"class":488}," {\n",[468,592,594,597,600,603,605,608,612,615],{"class":470,"line":593},7,[468,595,596],{"class":586},"  const",[468,598,599],{"class":492}," pipeline",[468,601,602],{"class":488}," =",[468,604,519],{"class":570},[468,606,607],{"class":488},"\u003C",[468,609,611],{"class":610},"sBMFI","DrainContext",[468,613,614],{"class":488},">",[468,616,618],{"class":617},"swJcz","()\n",[468,620,622,624,627,629,631,633,636],{"class":470,"line":621},8,[468,623,596],{"class":586},[468,625,626],{"class":492}," drain",[468,628,602],{"class":488},[468,630,599],{"class":570},[468,632,574],{"class":617},[468,634,635],{"class":570},"createAxiomDrain",[468,637,638],{"class":617},"())\n",[468,640,642],{"class":470,"line":641},9,[468,643,558],{"emptyLinePlaceholder":557},[468,645,647,650,653,656,658,661,663,666,669,671,674,676],{"class":470,"line":646},10,[468,648,649],{"class":492},"  nitroApp",[468,651,652],{"class":488},".",[468,654,655],{"class":492},"hooks",[468,657,652],{"class":488},[468,659,660],{"class":570},"hook",[468,662,574],{"class":617},[468,664,665],{"class":488},"'",[468,667,668],{"class":505},"evlog:drain",[468,670,665],{"class":488},[468,672,673],{"class":488},",",[468,675,626],{"class":492},[468,677,678],{"class":617},")\n",[468,680,682,684,686,688,690,692,694,696,699,701,703,706,708,710,712,715],{"class":470,"line":681},11,[468,683,649],{"class":492},[468,685,652],{"class":488},[468,687,655],{"class":492},[468,689,652],{"class":488},[468,691,660],{"class":570},[468,693,574],{"class":617},[468,695,665],{"class":488},[468,697,698],{"class":505},"close",[468,700,665],{"class":488},[468,702,673],{"class":488},[468,704,705],{"class":488}," ()",[468,707,587],{"class":586},[468,709,626],{"class":492},[468,711,652],{"class":488},[468,713,714],{"class":570},"flush",[468,716,638],{"class":617},[468,718,720,723],{"class":470,"line":719},12,[468,721,722],{"class":488},"}",[468,724,678],{"class":492},[457,726,728],{"className":459,"code":727,"filename":212,"language":462,"meta":463,"style":463},"\u002F\u002F lib\u002Fevlog.ts\nimport type { DrainContext } from 'evlog'\nimport { createEvlog } from 'evlog\u002Fnext'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>()\nconst drain = pipeline(createAxiomDrain())\n\nexport const { withEvlog, useLogger, log, createError } = createEvlog({\n  service: 'my-app',\n  drain,\n})\n\n\u002F\u002F Flush before shutdown (e.g. from your custom server or a teardown hook)\nexport const flushEvlog = () => drain.flush()\n",[465,729,730,735,755,775,793,811,815,836,853,857,895,913,920,927,932,938],{"__ignoreMap":463},[468,731,732],{"class":470,"line":471},[468,733,734],{"class":474},"\u002F\u002F lib\u002Fevlog.ts\n",[468,736,737,739,741,743,745,747,749,751,753],{"class":470,"line":478},[468,738,482],{"class":481},[468,740,485],{"class":481},[468,742,489],{"class":488},[468,744,493],{"class":492},[468,746,496],{"class":488},[468,748,499],{"class":481},[468,750,502],{"class":488},[468,752,506],{"class":505},[468,754,509],{"class":488},[468,756,757,759,761,764,766,768,770,773],{"class":470,"line":512},[468,758,482],{"class":481},[468,760,489],{"class":488},[468,762,763],{"class":492}," createEvlog",[468,765,496],{"class":488},[468,767,499],{"class":481},[468,769,502],{"class":488},[468,771,772],{"class":505},"evlog\u002Fnext",[468,774,509],{"class":488},[468,776,777,779,781,783,785,787,789,791],{"class":470,"line":533},[468,778,482],{"class":481},[468,780,489],{"class":488},[468,782,519],{"class":492},[468,784,496],{"class":488},[468,786,499],{"class":481},[468,788,502],{"class":488},[468,790,528],{"class":505},[468,792,509],{"class":488},[468,794,795,797,799,801,803,805,807,809],{"class":470,"line":554},[468,796,482],{"class":481},[468,798,489],{"class":488},[468,800,540],{"class":492},[468,802,496],{"class":488},[468,804,499],{"class":481},[468,806,502],{"class":488},[468,808,549],{"class":505},[468,810,509],{"class":488},[468,812,813],{"class":470,"line":561},[468,814,558],{"emptyLinePlaceholder":557},[468,816,817,820,823,826,828,830,832,834],{"class":470,"line":593},[468,818,819],{"class":586},"const",[468,821,822],{"class":492}," pipeline ",[468,824,825],{"class":488},"=",[468,827,519],{"class":570},[468,829,607],{"class":488},[468,831,611],{"class":610},[468,833,614],{"class":488},[468,835,618],{"class":492},[468,837,838,840,843,845,847,849,851],{"class":470,"line":621},[468,839,819],{"class":586},[468,841,842],{"class":492}," drain ",[468,844,825],{"class":488},[468,846,599],{"class":570},[468,848,574],{"class":492},[468,850,635],{"class":570},[468,852,638],{"class":492},[468,854,855],{"class":470,"line":641},[468,856,558],{"emptyLinePlaceholder":557},[468,858,859,861,864,866,869,871,874,876,879,881,884,886,888,890,892],{"class":470,"line":646},[468,860,564],{"class":481},[468,862,863],{"class":586}," const",[468,865,489],{"class":488},[468,867,868],{"class":492}," withEvlog",[468,870,673],{"class":488},[468,872,873],{"class":492}," useLogger",[468,875,673],{"class":488},[468,877,878],{"class":492}," log",[468,880,673],{"class":488},[468,882,883],{"class":492}," createError ",[468,885,722],{"class":488},[468,887,602],{"class":488},[468,889,763],{"class":570},[468,891,574],{"class":492},[468,893,894],{"class":488},"{\n",[468,896,897,900,903,905,908,910],{"class":470,"line":681},[468,898,899],{"class":617},"  service",[468,901,902],{"class":488},":",[468,904,502],{"class":488},[468,906,907],{"class":505},"my-app",[468,909,665],{"class":488},[468,911,912],{"class":488},",\n",[468,914,915,918],{"class":470,"line":719},[468,916,917],{"class":492},"  drain",[468,919,912],{"class":488},[468,921,923,925],{"class":470,"line":922},13,[468,924,722],{"class":488},[468,926,678],{"class":492},[468,928,930],{"class":470,"line":929},14,[468,931,558],{"emptyLinePlaceholder":557},[468,933,935],{"class":470,"line":934},15,[468,936,937],{"class":474},"\u002F\u002F Flush before shutdown (e.g. from your custom server or a teardown hook)\n",[468,939,941,943,945,948,950,952,954,956,958,960],{"class":470,"line":940},16,[468,942,564],{"class":481},[468,944,863],{"class":586},[468,946,947],{"class":492}," flushEvlog ",[468,949,825],{"class":488},[468,951,705],{"class":488},[468,953,587],{"class":586},[468,955,626],{"class":492},[468,957,652],{"class":488},[468,959,714],{"class":570},[468,961,618],{"class":492},[457,963,966],{"className":459,"code":964,"filename":965,"language":462,"meta":463,"style":463},"\u002F\u002F Same pattern — pass `drain` to the framework's evlog middleware\u002Fmodule\nimport type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>()\nconst drain = pipeline(createAxiomDrain())\n\napp.use(evlog({ drain })) \u002F\u002F Hono \u002F Express \u002F Elysia\n\u002F\u002F await app.register(evlog, { drain }) \u002F\u002F Fastify\n\u002F\u002F EvlogModule.forRoot({ drain }) \u002F\u002F NestJS\n\n\u002F\u002F Flush on shutdown\nprocess.on('SIGTERM', () => drain.flush())\n","Hono \u002F Express \u002F Fastify \u002F Elysia \u002F NestJS",[465,967,968,973,993,1011,1029,1033,1051,1067,1071,1100,1108,1116,1120,1125],{"__ignoreMap":463},[468,969,970],{"class":470,"line":471},[468,971,972],{"class":474},"\u002F\u002F Same pattern — pass `drain` to the framework's evlog middleware\u002Fmodule\n",[468,974,975,977,979,981,983,985,987,989,991],{"class":470,"line":478},[468,976,482],{"class":481},[468,978,485],{"class":481},[468,980,489],{"class":488},[468,982,493],{"class":492},[468,984,496],{"class":488},[468,986,499],{"class":481},[468,988,502],{"class":488},[468,990,506],{"class":505},[468,992,509],{"class":488},[468,994,995,997,999,1001,1003,1005,1007,1009],{"class":470,"line":512},[468,996,482],{"class":481},[468,998,489],{"class":488},[468,1000,519],{"class":492},[468,1002,496],{"class":488},[468,1004,499],{"class":481},[468,1006,502],{"class":488},[468,1008,528],{"class":505},[468,1010,509],{"class":488},[468,1012,1013,1015,1017,1019,1021,1023,1025,1027],{"class":470,"line":533},[468,1014,482],{"class":481},[468,1016,489],{"class":488},[468,1018,540],{"class":492},[468,1020,496],{"class":488},[468,1022,499],{"class":481},[468,1024,502],{"class":488},[468,1026,549],{"class":505},[468,1028,509],{"class":488},[468,1030,1031],{"class":470,"line":554},[468,1032,558],{"emptyLinePlaceholder":557},[468,1034,1035,1037,1039,1041,1043,1045,1047,1049],{"class":470,"line":561},[468,1036,819],{"class":586},[468,1038,822],{"class":492},[468,1040,825],{"class":488},[468,1042,519],{"class":570},[468,1044,607],{"class":488},[468,1046,611],{"class":610},[468,1048,614],{"class":488},[468,1050,618],{"class":492},[468,1052,1053,1055,1057,1059,1061,1063,1065],{"class":470,"line":593},[468,1054,819],{"class":586},[468,1056,842],{"class":492},[468,1058,825],{"class":488},[468,1060,599],{"class":570},[468,1062,574],{"class":492},[468,1064,635],{"class":570},[468,1066,638],{"class":492},[468,1068,1069],{"class":470,"line":621},[468,1070,558],{"emptyLinePlaceholder":557},[468,1072,1073,1076,1078,1081,1083,1085,1087,1090,1092,1094,1097],{"class":470,"line":641},[468,1074,1075],{"class":492},"app",[468,1077,652],{"class":488},[468,1079,1080],{"class":570},"use",[468,1082,574],{"class":492},[468,1084,506],{"class":570},[468,1086,574],{"class":492},[468,1088,1089],{"class":488},"{",[468,1091,842],{"class":492},[468,1093,722],{"class":488},[468,1095,1096],{"class":492},")) ",[468,1098,1099],{"class":474},"\u002F\u002F Hono \u002F Express \u002F Elysia\n",[468,1101,1102,1105],{"class":470,"line":646},[468,1103,1104],{"class":474},"\u002F\u002F await app.register(evlog, { drain })",[468,1106,1107],{"class":474}," \u002F\u002F Fastify\n",[468,1109,1110,1113],{"class":470,"line":681},[468,1111,1112],{"class":474},"\u002F\u002F EvlogModule.forRoot({ drain })",[468,1114,1115],{"class":474}," \u002F\u002F NestJS\n",[468,1117,1118],{"class":470,"line":719},[468,1119,558],{"emptyLinePlaceholder":557},[468,1121,1122],{"class":470,"line":922},[468,1123,1124],{"class":474},"\u002F\u002F Flush on shutdown\n",[468,1126,1127,1130,1132,1135,1137,1139,1142,1144,1146,1148,1150,1152,1154,1156],{"class":470,"line":929},[468,1128,1129],{"class":492},"process",[468,1131,652],{"class":488},[468,1133,1134],{"class":570},"on",[468,1136,574],{"class":492},[468,1138,665],{"class":488},[468,1140,1141],{"class":505},"SIGTERM",[468,1143,665],{"class":488},[468,1145,673],{"class":488},[468,1147,705],{"class":488},[468,1149,587],{"class":586},[468,1151,626],{"class":492},[468,1153,652],{"class":488},[468,1155,714],{"class":570},[468,1157,638],{"class":492},[457,1159,1161],{"className":459,"code":1160,"filename":267,"language":462,"meta":463,"style":463},"\u002F\u002F index.ts — plain TypeScript \u002F Bun \u002F Node script\nimport type { DrainContext } from 'evlog'\nimport { initLogger } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>()\nconst drain = pipeline(createAxiomDrain())\n\ninitLogger({ drain })\n\n\u002F\u002F Flush before exit\nawait drain.flush()\n",[465,1162,1163,1168,1188,1207,1225,1243,1247,1265,1281,1285,1300,1304,1309],{"__ignoreMap":463},[468,1164,1165],{"class":470,"line":471},[468,1166,1167],{"class":474},"\u002F\u002F index.ts — plain TypeScript \u002F Bun \u002F Node script\n",[468,1169,1170,1172,1174,1176,1178,1180,1182,1184,1186],{"class":470,"line":478},[468,1171,482],{"class":481},[468,1173,485],{"class":481},[468,1175,489],{"class":488},[468,1177,493],{"class":492},[468,1179,496],{"class":488},[468,1181,499],{"class":481},[468,1183,502],{"class":488},[468,1185,506],{"class":505},[468,1187,509],{"class":488},[468,1189,1190,1192,1194,1197,1199,1201,1203,1205],{"class":470,"line":512},[468,1191,482],{"class":481},[468,1193,489],{"class":488},[468,1195,1196],{"class":492}," initLogger",[468,1198,496],{"class":488},[468,1200,499],{"class":481},[468,1202,502],{"class":488},[468,1204,506],{"class":505},[468,1206,509],{"class":488},[468,1208,1209,1211,1213,1215,1217,1219,1221,1223],{"class":470,"line":533},[468,1210,482],{"class":481},[468,1212,489],{"class":488},[468,1214,519],{"class":492},[468,1216,496],{"class":488},[468,1218,499],{"class":481},[468,1220,502],{"class":488},[468,1222,528],{"class":505},[468,1224,509],{"class":488},[468,1226,1227,1229,1231,1233,1235,1237,1239,1241],{"class":470,"line":554},[468,1228,482],{"class":481},[468,1230,489],{"class":488},[468,1232,540],{"class":492},[468,1234,496],{"class":488},[468,1236,499],{"class":481},[468,1238,502],{"class":488},[468,1240,549],{"class":505},[468,1242,509],{"class":488},[468,1244,1245],{"class":470,"line":561},[468,1246,558],{"emptyLinePlaceholder":557},[468,1248,1249,1251,1253,1255,1257,1259,1261,1263],{"class":470,"line":593},[468,1250,819],{"class":586},[468,1252,822],{"class":492},[468,1254,825],{"class":488},[468,1256,519],{"class":570},[468,1258,607],{"class":488},[468,1260,611],{"class":610},[468,1262,614],{"class":488},[468,1264,618],{"class":492},[468,1266,1267,1269,1271,1273,1275,1277,1279],{"class":470,"line":621},[468,1268,819],{"class":586},[468,1270,842],{"class":492},[468,1272,825],{"class":488},[468,1274,599],{"class":570},[468,1276,574],{"class":492},[468,1278,635],{"class":570},[468,1280,638],{"class":492},[468,1282,1283],{"class":470,"line":641},[468,1284,558],{"emptyLinePlaceholder":557},[468,1286,1287,1290,1292,1294,1296,1298],{"class":470,"line":646},[468,1288,1289],{"class":570},"initLogger",[468,1291,574],{"class":492},[468,1293,1089],{"class":488},[468,1295,842],{"class":492},[468,1297,722],{"class":488},[468,1299,678],{"class":492},[468,1301,1302],{"class":470,"line":681},[468,1303,558],{"emptyLinePlaceholder":557},[468,1305,1306],{"class":470,"line":719},[468,1307,1308],{"class":474},"\u002F\u002F Flush before exit\n",[468,1310,1311,1314,1316,1318,1320],{"class":470,"line":922},[468,1312,1313],{"class":481},"await",[468,1315,626],{"class":492},[468,1317,652],{"class":488},[468,1319,714],{"class":570},[468,1321,618],{"class":492},[1323,1324,1327,1328,1331,1332,1334,1335,1338,1339,652],"callout",{"color":1325,"icon":1326},"warning","i-lucide-alert-triangle","Always flush the pipeline before the process exits (",[465,1329,1330],{},"drain.flush()","). On Nitro use the ",[465,1333,698],{}," hook; on standalone scripts call it before ",[465,1336,1337],{},"process.exit","; on serverless runtimes use ",[465,1340,1341],{},"waitUntil(drain.flush())",[447,1343,1345],{"id":1344},"how-it-works","How It Works",[1347,1348,1349,1355,1367,1373,1380],"ol",{},[410,1350,1351,1352,1354],{},"Events are buffered in memory as they arrive via the ",[465,1353,668],{}," hook",[410,1356,1357,1358,1362,1363,1366],{},"A batch is flushed when either the ",[1359,1360,1361],"strong",{},"batch size"," is reached or the ",[1359,1364,1365],{},"interval"," expires (whichever comes first)",[410,1368,1369,1370],{},"If the drain function fails, the batch is retried with the configured ",[1359,1371,1372],{},"backoff strategy",[410,1374,1375,1376,1379],{},"If all retries are exhausted, ",[465,1377,1378],{},"onDropped"," is called with the lost events",[410,1381,1382,1383,1386],{},"If the buffer exceeds ",[465,1384,1385],{},"maxBufferSize",", the oldest events are dropped to prevent memory leaks",[447,1388,166],{"id":1389},"configuration",[395,1391,1392,1393,1396,1397,652],{},"The options below apply to any framework — wire the resulting ",[465,1394,1395],{},"drain"," the same way you did in ",[436,1398,20],{"href":1399},"#quick-start",[457,1401,1404],{"className":459,"code":1402,"filename":1403,"language":462,"meta":463,"style":463},"import type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({\n  batch: {\n    size: 50,          \u002F\u002F Flush every 50 events\n    intervalMs: 5000,  \u002F\u002F Or every 5 seconds, whichever comes first\n  },\n  retry: {\n    maxAttempts: 3,\n    backoff: 'exponential',\n    initialDelayMs: 1000,\n    maxDelayMs: 30000,\n  },\n  maxBufferSize: 1000,\n  onDropped: (events, error) => {\n    console.error(`[evlog] Dropped ${events.length} events:`, error?.message)\n  },\n})\n\nexport const drain = pipeline(createAxiomDrain())\n\u002F\u002F Then wire `drain` to your framework — see Quick Start above.\n","pipeline-config.ts",[465,1405,1406,1426,1444,1462,1466,1486,1495,1511,1526,1531,1540,1552,1568,1580,1592,1596,1607,1632,1680,1685,1692,1697,1716],{"__ignoreMap":463},[468,1407,1408,1410,1412,1414,1416,1418,1420,1422,1424],{"class":470,"line":471},[468,1409,482],{"class":481},[468,1411,485],{"class":481},[468,1413,489],{"class":488},[468,1415,493],{"class":492},[468,1417,496],{"class":488},[468,1419,499],{"class":481},[468,1421,502],{"class":488},[468,1423,506],{"class":505},[468,1425,509],{"class":488},[468,1427,1428,1430,1432,1434,1436,1438,1440,1442],{"class":470,"line":478},[468,1429,482],{"class":481},[468,1431,489],{"class":488},[468,1433,519],{"class":492},[468,1435,496],{"class":488},[468,1437,499],{"class":481},[468,1439,502],{"class":488},[468,1441,528],{"class":505},[468,1443,509],{"class":488},[468,1445,1446,1448,1450,1452,1454,1456,1458,1460],{"class":470,"line":512},[468,1447,482],{"class":481},[468,1449,489],{"class":488},[468,1451,540],{"class":492},[468,1453,496],{"class":488},[468,1455,499],{"class":481},[468,1457,502],{"class":488},[468,1459,549],{"class":505},[468,1461,509],{"class":488},[468,1463,1464],{"class":470,"line":533},[468,1465,558],{"emptyLinePlaceholder":557},[468,1467,1468,1470,1472,1474,1476,1478,1480,1482,1484],{"class":470,"line":554},[468,1469,819],{"class":586},[468,1471,822],{"class":492},[468,1473,825],{"class":488},[468,1475,519],{"class":570},[468,1477,607],{"class":488},[468,1479,611],{"class":610},[468,1481,614],{"class":488},[468,1483,574],{"class":492},[468,1485,894],{"class":488},[468,1487,1488,1491,1493],{"class":470,"line":561},[468,1489,1490],{"class":617},"  batch",[468,1492,902],{"class":488},[468,1494,590],{"class":488},[468,1496,1497,1500,1502,1506,1508],{"class":470,"line":593},[468,1498,1499],{"class":617},"    size",[468,1501,902],{"class":488},[468,1503,1505],{"class":1504},"sbssI"," 50",[468,1507,673],{"class":488},[468,1509,1510],{"class":474},"          \u002F\u002F Flush every 50 events\n",[468,1512,1513,1516,1518,1521,1523],{"class":470,"line":621},[468,1514,1515],{"class":617},"    intervalMs",[468,1517,902],{"class":488},[468,1519,1520],{"class":1504}," 5000",[468,1522,673],{"class":488},[468,1524,1525],{"class":474},"  \u002F\u002F Or every 5 seconds, whichever comes first\n",[468,1527,1528],{"class":470,"line":641},[468,1529,1530],{"class":488},"  },\n",[468,1532,1533,1536,1538],{"class":470,"line":646},[468,1534,1535],{"class":617},"  retry",[468,1537,902],{"class":488},[468,1539,590],{"class":488},[468,1541,1542,1545,1547,1550],{"class":470,"line":681},[468,1543,1544],{"class":617},"    maxAttempts",[468,1546,902],{"class":488},[468,1548,1549],{"class":1504}," 3",[468,1551,912],{"class":488},[468,1553,1554,1557,1559,1561,1564,1566],{"class":470,"line":719},[468,1555,1556],{"class":617},"    backoff",[468,1558,902],{"class":488},[468,1560,502],{"class":488},[468,1562,1563],{"class":505},"exponential",[468,1565,665],{"class":488},[468,1567,912],{"class":488},[468,1569,1570,1573,1575,1578],{"class":470,"line":922},[468,1571,1572],{"class":617},"    initialDelayMs",[468,1574,902],{"class":488},[468,1576,1577],{"class":1504}," 1000",[468,1579,912],{"class":488},[468,1581,1582,1585,1587,1590],{"class":470,"line":929},[468,1583,1584],{"class":617},"    maxDelayMs",[468,1586,902],{"class":488},[468,1588,1589],{"class":1504}," 30000",[468,1591,912],{"class":488},[468,1593,1594],{"class":470,"line":934},[468,1595,1530],{"class":488},[468,1597,1598,1601,1603,1605],{"class":470,"line":940},[468,1599,1600],{"class":617},"  maxBufferSize",[468,1602,902],{"class":488},[468,1604,1577],{"class":1504},[468,1606,912],{"class":488},[468,1608,1610,1613,1615,1618,1621,1623,1626,1628,1630],{"class":470,"line":1609},17,[468,1611,1612],{"class":570},"  onDropped",[468,1614,902],{"class":488},[468,1616,1617],{"class":488}," (",[468,1619,1620],{"class":579},"events",[468,1622,673],{"class":488},[468,1624,1625],{"class":579}," error",[468,1627,583],{"class":488},[468,1629,587],{"class":586},[468,1631,590],{"class":488},[468,1633,1635,1638,1640,1643,1645,1648,1651,1654,1656,1658,1661,1663,1666,1668,1670,1672,1675,1678],{"class":470,"line":1634},18,[468,1636,1637],{"class":492},"    console",[468,1639,652],{"class":488},[468,1641,1642],{"class":570},"error",[468,1644,574],{"class":617},[468,1646,1647],{"class":488},"`",[468,1649,1650],{"class":505},"[evlog] Dropped ",[468,1652,1653],{"class":488},"${",[468,1655,1620],{"class":492},[468,1657,652],{"class":488},[468,1659,1660],{"class":492},"length",[468,1662,722],{"class":488},[468,1664,1665],{"class":505}," events:",[468,1667,1647],{"class":488},[468,1669,673],{"class":488},[468,1671,1625],{"class":492},[468,1673,1674],{"class":488},"?.",[468,1676,1677],{"class":492},"message",[468,1679,678],{"class":617},[468,1681,1683],{"class":470,"line":1682},19,[468,1684,1530],{"class":488},[468,1686,1688,1690],{"class":470,"line":1687},20,[468,1689,722],{"class":488},[468,1691,678],{"class":492},[468,1693,1695],{"class":470,"line":1694},21,[468,1696,558],{"emptyLinePlaceholder":557},[468,1698,1700,1702,1704,1706,1708,1710,1712,1714],{"class":470,"line":1699},22,[468,1701,564],{"class":481},[468,1703,863],{"class":586},[468,1705,842],{"class":492},[468,1707,825],{"class":488},[468,1709,599],{"class":570},[468,1711,574],{"class":492},[468,1713,635],{"class":570},[468,1715,638],{"class":492},[468,1717,1719],{"class":470,"line":1718},23,[468,1720,1721],{"class":474},"\u002F\u002F Then wire `drain` to your framework — see Quick Start above.\n",[1723,1724,1726],"h3",{"id":1725},"options-reference","Options Reference",[1728,1729,1730,1746],"table",{},[1731,1732,1733],"thead",{},[1734,1735,1736,1740,1743],"tr",{},[1737,1738,1739],"th",{},"Option",[1737,1741,1742],{},"Default",[1737,1744,1745],{},"Description",[1747,1748,1749,1765,1780,1795,1818,1833,1848,1861],"tbody",{},[1734,1750,1751,1757,1762],{},[1752,1753,1754],"td",{},[465,1755,1756],{},"batch.size",[1752,1758,1759],{},[465,1760,1761],{},"50",[1752,1763,1764],{},"Maximum events per batch",[1734,1766,1767,1772,1777],{},[1752,1768,1769],{},[465,1770,1771],{},"batch.intervalMs",[1752,1773,1774],{},[465,1775,1776],{},"5000",[1752,1778,1779],{},"Max time (ms) before flushing a partial batch",[1734,1781,1782,1787,1792],{},[1752,1783,1784],{},[465,1785,1786],{},"retry.maxAttempts",[1752,1788,1789],{},[465,1790,1791],{},"3",[1752,1793,1794],{},"Total attempts including the initial one",[1734,1796,1797,1802,1807],{},[1752,1798,1799],{},[465,1800,1801],{},"retry.backoff",[1752,1803,1804],{},[465,1805,1806],{},"'exponential'",[1752,1808,1809,1811,1812,1811,1815],{},[465,1810,1806],{}," | ",[465,1813,1814],{},"'linear'",[465,1816,1817],{},"'fixed'",[1734,1819,1820,1825,1830],{},[1752,1821,1822],{},[465,1823,1824],{},"retry.initialDelayMs",[1752,1826,1827],{},[465,1828,1829],{},"1000",[1752,1831,1832],{},"Base delay for the first retry",[1734,1834,1835,1840,1845],{},[1752,1836,1837],{},[465,1838,1839],{},"retry.maxDelayMs",[1752,1841,1842],{},[465,1843,1844],{},"30000",[1752,1846,1847],{},"Upper bound for any retry delay",[1734,1849,1850,1854,1858],{},[1752,1851,1852],{},[465,1853,1385],{},[1752,1855,1856],{},[465,1857,1829],{},[1752,1859,1860],{},"Max buffered events before dropping oldest",[1734,1862,1863,1867,1870],{},[1752,1864,1865],{},[465,1866,1378],{},[1752,1868,1869],{},"-",[1752,1871,1872],{},"Callback when events are dropped (overflow or retry exhaustion)",[447,1874,1876],{"id":1875},"backoff-strategies","Backoff Strategies",[1728,1878,1879,1892],{},[1731,1880,1881],{},[1734,1882,1883,1886,1889],{},[1737,1884,1885],{},"Strategy",[1737,1887,1888],{},"Delay Pattern",[1737,1890,1891],{},"Use Case",[1747,1893,1894,1906,1919],{},[1734,1895,1896,1900,1903],{},[1752,1897,1898],{},[465,1899,1563],{},[1752,1901,1902],{},"1s, 2s, 4s, 8s...",[1752,1904,1905],{},"Default. Best for transient failures that may need time to recover",[1734,1907,1908,1913,1916],{},[1752,1909,1910],{},[465,1911,1912],{},"linear",[1752,1914,1915],{},"1s, 2s, 3s, 4s...",[1752,1917,1918],{},"Predictable delay growth",[1734,1920,1921,1926,1929],{},[1752,1922,1923],{},[465,1924,1925],{},"fixed",[1752,1927,1928],{},"1s, 1s, 1s, 1s...",[1752,1930,1931],{},"Same delay every time. Useful for rate-limited APIs",[447,1933,1935],{"id":1934},"returned-drain-function","Returned Drain Function",[395,1937,1938,1939,1942],{},"The function returned by ",[465,1940,1941],{},"pipeline(drain)"," is hook-compatible and exposes:",[1728,1944,1945,1957],{},[1731,1946,1947],{},[1734,1948,1949,1952,1955],{},[1737,1950,1951],{},"Property",[1737,1953,1954],{},"Type",[1737,1956,1745],{},[1747,1958,1959,1974,1988],{},[1734,1960,1961,1966,1971],{},[1752,1962,1963],{},[465,1964,1965],{},"drain(ctx)",[1752,1967,1968],{},[465,1969,1970],{},"(ctx: T) => void",[1752,1972,1973],{},"Push a single event into the buffer",[1734,1975,1976,1980,1985],{},[1752,1977,1978],{},[465,1979,1330],{},[1752,1981,1982],{},[465,1983,1984],{},"() => Promise\u003Cvoid>",[1752,1986,1987],{},"Force-flush all buffered events",[1734,1989,1990,1995,2000],{},[1752,1991,1992],{},[465,1993,1994],{},"drain.pending",[1752,1996,1997],{},[465,1998,1999],{},"number",[1752,2001,2002],{},"Number of events currently buffered",[447,2004,2006],{"id":2005},"multiple-destinations","Multiple Destinations",[395,2008,2009],{},"Wrap multiple adapters with a single pipeline (one batch flushed in parallel to every destination):",[457,2011,2014],{"className":459,"code":2012,"filename":2013,"language":462,"meta":463,"style":463},"import type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createOTLPDrain } from 'evlog\u002Fotlp'\n\nconst axiom = createAxiomDrain()\nconst otlp = createOTLPDrain()\n\nconst pipeline = createDrainPipeline\u003CDrainContext>()\nexport const drain = pipeline(async (batch) => {\n  await Promise.allSettled([axiom(batch), otlp(batch)])\n})\n\u002F\u002F Wire `drain` exactly like in Quick Start — Nitro hook, framework middleware, or initLogger.\n","pipeline-fan-out.ts",[465,2015,2016,2036,2054,2072,2092,2096,2109,2122,2126,2144,2172,2209,2215],{"__ignoreMap":463},[468,2017,2018,2020,2022,2024,2026,2028,2030,2032,2034],{"class":470,"line":471},[468,2019,482],{"class":481},[468,2021,485],{"class":481},[468,2023,489],{"class":488},[468,2025,493],{"class":492},[468,2027,496],{"class":488},[468,2029,499],{"class":481},[468,2031,502],{"class":488},[468,2033,506],{"class":505},[468,2035,509],{"class":488},[468,2037,2038,2040,2042,2044,2046,2048,2050,2052],{"class":470,"line":478},[468,2039,482],{"class":481},[468,2041,489],{"class":488},[468,2043,519],{"class":492},[468,2045,496],{"class":488},[468,2047,499],{"class":481},[468,2049,502],{"class":488},[468,2051,528],{"class":505},[468,2053,509],{"class":488},[468,2055,2056,2058,2060,2062,2064,2066,2068,2070],{"class":470,"line":512},[468,2057,482],{"class":481},[468,2059,489],{"class":488},[468,2061,540],{"class":492},[468,2063,496],{"class":488},[468,2065,499],{"class":481},[468,2067,502],{"class":488},[468,2069,549],{"class":505},[468,2071,509],{"class":488},[468,2073,2074,2076,2078,2081,2083,2085,2087,2090],{"class":470,"line":533},[468,2075,482],{"class":481},[468,2077,489],{"class":488},[468,2079,2080],{"class":492}," createOTLPDrain",[468,2082,496],{"class":488},[468,2084,499],{"class":481},[468,2086,502],{"class":488},[468,2088,2089],{"class":505},"evlog\u002Fotlp",[468,2091,509],{"class":488},[468,2093,2094],{"class":470,"line":554},[468,2095,558],{"emptyLinePlaceholder":557},[468,2097,2098,2100,2103,2105,2107],{"class":470,"line":561},[468,2099,819],{"class":586},[468,2101,2102],{"class":492}," axiom ",[468,2104,825],{"class":488},[468,2106,540],{"class":570},[468,2108,618],{"class":492},[468,2110,2111,2113,2116,2118,2120],{"class":470,"line":593},[468,2112,819],{"class":586},[468,2114,2115],{"class":492}," otlp ",[468,2117,825],{"class":488},[468,2119,2080],{"class":570},[468,2121,618],{"class":492},[468,2123,2124],{"class":470,"line":621},[468,2125,558],{"emptyLinePlaceholder":557},[468,2127,2128,2130,2132,2134,2136,2138,2140,2142],{"class":470,"line":641},[468,2129,819],{"class":586},[468,2131,822],{"class":492},[468,2133,825],{"class":488},[468,2135,519],{"class":570},[468,2137,607],{"class":488},[468,2139,611],{"class":610},[468,2141,614],{"class":488},[468,2143,618],{"class":492},[468,2145,2146,2148,2150,2152,2154,2156,2158,2161,2163,2166,2168,2170],{"class":470,"line":646},[468,2147,564],{"class":481},[468,2149,863],{"class":586},[468,2151,842],{"class":492},[468,2153,825],{"class":488},[468,2155,599],{"class":570},[468,2157,574],{"class":492},[468,2159,2160],{"class":586},"async",[468,2162,1617],{"class":488},[468,2164,2165],{"class":579},"batch",[468,2167,583],{"class":488},[468,2169,587],{"class":586},[468,2171,590],{"class":488},[468,2173,2174,2177,2180,2182,2185,2188,2191,2193,2195,2197,2199,2202,2204,2206],{"class":470,"line":681},[468,2175,2176],{"class":481},"  await",[468,2178,2179],{"class":610}," Promise",[468,2181,652],{"class":488},[468,2183,2184],{"class":570},"allSettled",[468,2186,2187],{"class":617},"([",[468,2189,2190],{"class":570},"axiom",[468,2192,574],{"class":617},[468,2194,2165],{"class":492},[468,2196,583],{"class":617},[468,2198,673],{"class":488},[468,2200,2201],{"class":570}," otlp",[468,2203,574],{"class":617},[468,2205,2165],{"class":492},[468,2207,2208],{"class":617},")])\n",[468,2210,2211,2213],{"class":470,"line":719},[468,2212,722],{"class":488},[468,2214,678],{"class":492},[468,2216,2217],{"class":470,"line":922},[468,2218,2219],{"class":474},"\u002F\u002F Wire `drain` exactly like in Quick Start — Nitro hook, framework middleware, or initLogger.\n",[447,2221,2223],{"id":2222},"custom-drain-function","Custom Drain Function",[395,2225,2226],{},"You don't need an adapter. Pass any async function that accepts a batch:",[457,2228,2231],{"className":459,"code":2229,"filename":2230,"language":462,"meta":463,"style":463},"import type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({ batch: { size: 100 } })\n\nexport const drain = pipeline(async (batch) => {\n  await fetch('https:\u002F\u002Fyour-service.com\u002Flogs', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application\u002Fjson' },\n    body: JSON.stringify(batch.map(ctx => ctx.event)),\n  })\n})\n\u002F\u002F Wire `drain` to your framework — see Quick Start above.\n","pipeline-custom.ts",[465,2232,2233,2253,2271,2275,2316,2320,2346,2366,2382,2410,2454,2461,2467],{"__ignoreMap":463},[468,2234,2235,2237,2239,2241,2243,2245,2247,2249,2251],{"class":470,"line":471},[468,2236,482],{"class":481},[468,2238,485],{"class":481},[468,2240,489],{"class":488},[468,2242,493],{"class":492},[468,2244,496],{"class":488},[468,2246,499],{"class":481},[468,2248,502],{"class":488},[468,2250,506],{"class":505},[468,2252,509],{"class":488},[468,2254,2255,2257,2259,2261,2263,2265,2267,2269],{"class":470,"line":478},[468,2256,482],{"class":481},[468,2258,489],{"class":488},[468,2260,519],{"class":492},[468,2262,496],{"class":488},[468,2264,499],{"class":481},[468,2266,502],{"class":488},[468,2268,528],{"class":505},[468,2270,509],{"class":488},[468,2272,2273],{"class":470,"line":512},[468,2274,558],{"emptyLinePlaceholder":557},[468,2276,2277,2279,2281,2283,2285,2287,2289,2291,2293,2295,2298,2300,2302,2305,2307,2310,2312,2314],{"class":470,"line":533},[468,2278,819],{"class":586},[468,2280,822],{"class":492},[468,2282,825],{"class":488},[468,2284,519],{"class":570},[468,2286,607],{"class":488},[468,2288,611],{"class":610},[468,2290,614],{"class":488},[468,2292,574],{"class":492},[468,2294,1089],{"class":488},[468,2296,2297],{"class":617}," batch",[468,2299,902],{"class":488},[468,2301,489],{"class":488},[468,2303,2304],{"class":617}," size",[468,2306,902],{"class":488},[468,2308,2309],{"class":1504}," 100",[468,2311,496],{"class":488},[468,2313,496],{"class":488},[468,2315,678],{"class":492},[468,2317,2318],{"class":470,"line":554},[468,2319,558],{"emptyLinePlaceholder":557},[468,2321,2322,2324,2326,2328,2330,2332,2334,2336,2338,2340,2342,2344],{"class":470,"line":561},[468,2323,564],{"class":481},[468,2325,863],{"class":586},[468,2327,842],{"class":492},[468,2329,825],{"class":488},[468,2331,599],{"class":570},[468,2333,574],{"class":492},[468,2335,2160],{"class":586},[468,2337,1617],{"class":488},[468,2339,2165],{"class":579},[468,2341,583],{"class":488},[468,2343,587],{"class":586},[468,2345,590],{"class":488},[468,2347,2348,2350,2353,2355,2357,2360,2362,2364],{"class":470,"line":593},[468,2349,2176],{"class":481},[468,2351,2352],{"class":570}," fetch",[468,2354,574],{"class":617},[468,2356,665],{"class":488},[468,2358,2359],{"class":505},"https:\u002F\u002Fyour-service.com\u002Flogs",[468,2361,665],{"class":488},[468,2363,673],{"class":488},[468,2365,590],{"class":488},[468,2367,2368,2371,2373,2375,2378,2380],{"class":470,"line":621},[468,2369,2370],{"class":617},"    method",[468,2372,902],{"class":488},[468,2374,502],{"class":488},[468,2376,2377],{"class":505},"POST",[468,2379,665],{"class":488},[468,2381,912],{"class":488},[468,2383,2384,2387,2389,2391,2393,2396,2398,2400,2402,2405,2407],{"class":470,"line":641},[468,2385,2386],{"class":617},"    headers",[468,2388,902],{"class":488},[468,2390,489],{"class":488},[468,2392,502],{"class":488},[468,2394,2395],{"class":617},"Content-Type",[468,2397,665],{"class":488},[468,2399,902],{"class":488},[468,2401,502],{"class":488},[468,2403,2404],{"class":505},"application\u002Fjson",[468,2406,665],{"class":488},[468,2408,2409],{"class":488}," },\n",[468,2411,2412,2415,2417,2420,2422,2425,2427,2429,2431,2434,2436,2439,2441,2444,2446,2449,2452],{"class":470,"line":646},[468,2413,2414],{"class":617},"    body",[468,2416,902],{"class":488},[468,2418,2419],{"class":492}," JSON",[468,2421,652],{"class":488},[468,2423,2424],{"class":570},"stringify",[468,2426,574],{"class":617},[468,2428,2165],{"class":492},[468,2430,652],{"class":488},[468,2432,2433],{"class":570},"map",[468,2435,574],{"class":617},[468,2437,2438],{"class":579},"ctx",[468,2440,587],{"class":586},[468,2442,2443],{"class":492}," ctx",[468,2445,652],{"class":488},[468,2447,2448],{"class":492},"event",[468,2450,2451],{"class":617},"))",[468,2453,912],{"class":488},[468,2455,2456,2459],{"class":470,"line":681},[468,2457,2458],{"class":488},"  }",[468,2460,678],{"class":617},[468,2462,2463,2465],{"class":470,"line":719},[468,2464,722],{"class":488},[468,2466,678],{"class":492},[468,2468,2469],{"class":470,"line":922},[468,2470,2471],{"class":474},"\u002F\u002F Wire `drain` to your framework — see Quick Start above.\n",[1323,2473,2476,2477,2482,2483,2486],{"color":2474,"icon":2475},"neutral","i-lucide-arrow-right","See the full ",[436,2478,2481],{"href":2479,"rel":2480},"https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Fbun-script",[440],"bun-script example"," for a complete working script using the standalone wiring, and the ",[436,2484,2485],{"href":213},"Next.js guide"," for an App Router implementation.",[447,2488,2490],{"id":2489},"next-steps","Next Steps",[407,2492,2493,2499,2504],{},[410,2494,2495,2498],{},[436,2496,2497],{"href":291},"Adapters Overview"," - Available built-in adapters",[410,2500,2501,2503],{},[436,2502,364],{"href":365}," - Build your own drain function",[410,2505,2506,2508],{},[436,2507,181],{"href":182}," - Security and production tips",[2510,2511,2512],"style",{},"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 .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 .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 .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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":463,"searchDepth":478,"depth":478,"links":2514},[2515,2516,2517,2520,2521,2522,2523,2524],{"id":449,"depth":478,"text":20},{"id":1344,"depth":478,"text":1345},{"id":1389,"depth":478,"text":166,"children":2518},[2519],{"id":1725,"depth":512,"text":1726},{"id":1875,"depth":478,"text":1876},{"id":1934,"depth":478,"text":1935},{"id":2005,"depth":478,"text":2006},{"id":2222,"depth":478,"text":2223},{"id":2489,"depth":478,"text":2490},"Batch events, retry on failure, and protect against buffer overflow with the shared drain pipeline. Supports fan-out to multiple adapters.","md",[2528,2531],{"label":2497,"icon":2529,"to":291,"color":2474,"variant":2530},"i-custom-plug","subtle",{"label":364,"icon":78,"to":365,"color":2474,"variant":2530},{},{"title":354,"icon":357},{"title":390,"description":2525},"EYm-TLrD64WZ3s4aTkQxIVmB5a84Zl1aN1155oprN1s",[2537,2539],{"title":344,"path":345,"stem":346,"description":2538,"icon":347,"children":-1},"Self-hosted log retention for evlog using NuxtHub database storage. Store, query, and automatically clean up your structured logs with zero external dependencies.",{"title":359,"path":360,"stem":361,"description":2540,"icon":362,"children":-1},"Framework-agnostic HTTP log transport for sending client-side logs to your server via fetch or sendBeacon. Works in the browser or any environment with fetch. Use the `evlog\u002Fhttp` entry point.",1777901598256]