[{"data":1,"prerenderedAt":2280},["ShallowReactive",2],{"navigation_docs":3,"-adapters-pipeline":292,"-adapters-pipeline-surround":2275},[4,30,65,110,198,262,278],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24],{"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",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Logging","\u002Flogging","2.logging",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":61,"path":62,"stem":63,"icon":64},"AI SDK Integration","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk","i-simple-icons-vercel",{"title":66,"path":67,"stem":68,"children":69,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[70,75,80,85,90,95,100,105],{"title":71,"path":72,"stem":73,"icon":74},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":76,"path":77,"stem":78,"icon":79},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":81,"path":82,"stem":83,"icon":84},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":86,"path":87,"stem":88,"icon":89},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":91,"path":92,"stem":93,"icon":94},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices","i-lucide-shield-check",{"title":96,"path":97,"stem":98,"icon":99},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance","i-lucide-gauge",{"title":101,"path":102,"stem":103,"icon":104},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":106,"path":107,"stem":108,"icon":109},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":111,"path":112,"stem":113,"children":114,"page":29},"Frameworks","\u002Fframeworks","4.frameworks",[115,119,124,129,134,139,144,149,154,159,164,169,174,179,183,188,193],{"title":36,"path":116,"stem":117,"icon":118},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":120,"path":121,"stem":122,"icon":123},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":125,"path":126,"stem":127,"icon":128},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":130,"path":131,"stem":132,"icon":133},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":135,"path":136,"stem":137,"icon":138},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":140,"path":141,"stem":142,"icon":143},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":145,"path":146,"stem":147,"icon":148},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":150,"path":151,"stem":152,"icon":153},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":155,"path":156,"stem":157,"icon":158},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":160,"path":161,"stem":162,"icon":163},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":165,"path":166,"stem":167,"icon":168},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":170,"path":171,"stem":172,"icon":173},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":175,"path":176,"stem":177,"icon":178},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":180,"path":181,"stem":182,"icon":89},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":184,"path":185,"stem":186,"icon":187},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":189,"path":190,"stem":191,"icon":192},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F15.custom-integration","i-lucide-puzzle",{"title":194,"path":195,"stem":196,"icon":197},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":199,"path":200,"stem":201,"children":202,"page":29},"Adapters","\u002Fadapters","5.adapters",[203,207,212,217,222,227,232,237,242,247,252,257],{"title":36,"path":204,"stem":205,"icon":206},"\u002Fadapters\u002Foverview","5.adapters\u002F1.overview","i-custom-plug",{"title":208,"path":209,"stem":210,"icon":211},"Custom Adapters","\u002Fadapters\u002Fcustom","5.adapters\u002F10.custom","i-lucide-code",{"title":213,"path":214,"stem":215,"icon":216},"Pipeline","\u002Fadapters\u002Fpipeline","5.adapters\u002F11.pipeline","i-lucide-workflow",{"title":218,"path":219,"stem":220,"icon":221},"HTTP","\u002Fadapters\u002Fhttp","5.adapters\u002F12.http","i-lucide-globe",{"title":223,"path":224,"stem":225,"icon":226},"Axiom","\u002Fadapters\u002Faxiom","5.adapters\u002F2.axiom","i-custom-axiom",{"title":228,"path":229,"stem":230,"icon":231},"OTLP","\u002Fadapters\u002Fotlp","5.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":233,"path":234,"stem":235,"icon":236},"PostHog","\u002Fadapters\u002Fposthog","5.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":238,"path":239,"stem":240,"icon":241},"Sentry","\u002Fadapters\u002Fsentry","5.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":243,"path":244,"stem":245,"icon":246},"Better Stack","\u002Fadapters\u002Fbetter-stack","5.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":248,"path":249,"stem":250,"icon":251},"File System","\u002Fadapters\u002Ffs","5.adapters\u002F7.fs","i-lucide-hard-drive",{"title":253,"path":254,"stem":255,"icon":256},"Datadog","\u002Fadapters\u002Fdatadog","5.adapters\u002F8.datadog","i-simple-icons-datadog",{"title":258,"path":259,"stem":260,"icon":261},"HyperDX","\u002Fadapters\u002Fhyperdx","5.adapters\u002F9.hyperdx","i-custom-hyperdx",{"title":263,"path":264,"stem":265,"children":266,"page":29},"Enrichers","\u002Fenrichers","6.enrichers",[267,270,274],{"title":36,"path":268,"stem":269,"icon":28},"\u002Fenrichers\u002Foverview","6.enrichers\u002F1.overview",{"title":271,"path":272,"stem":273,"icon":192},"Built-in","\u002Fenrichers\u002Fbuilt-in","6.enrichers\u002F2.built-in",{"title":275,"path":276,"stem":277,"icon":211},"Custom","\u002Fenrichers\u002Fcustom","6.enrichers\u002F3.custom",{"title":279,"path":280,"stem":281,"children":282,"page":29},"NuxtHub","\u002Fnuxthub","7.nuxthub",[283,287],{"title":36,"path":284,"stem":285,"icon":286},"\u002Fnuxthub\u002Foverview","7.nuxthub\u002F1.overview","i-lucide-database",{"title":288,"path":289,"stem":290,"icon":291},"Retention","\u002Fnuxthub\u002Fretention","7.nuxthub\u002F2.retention","i-lucide-clock",{"id":293,"title":294,"body":295,"description":2265,"extension":2266,"links":2267,"meta":2271,"navigation":2272,"path":214,"seo":2273,"stem":215,"__hash__":2274},"docs\u002F5.adapters\u002F11.pipeline.md","Drain Pipeline",{"type":296,"value":297,"toc":2252},"minimark",[298,302,306,568,578,582,624,627,1045,1050,1196,1200,1255,1259,1266,1326,1330,1333,1624,1628,1631,1961,1965,1976,2205,2218,2225,2229,2248],[299,300,301],"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.",[303,304,20],"h2",{"id":305},"quick-start",[307,308,314],"pre",{"className":309,"code":310,"filename":311,"language":312,"meta":313,"style":313},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import 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","server\u002Fplugins\u002Fevlog-drain.ts","typescript","",[315,316,317,353,374,395,402,434,462,482,487,522,560],"code",{"__ignoreMap":313},[318,319,322,326,329,333,337,340,343,346,350],"span",{"class":320,"line":321},"line",1,[318,323,325],{"class":324},"s7zQu","import",[318,327,328],{"class":324}," type",[318,330,332],{"class":331},"sMK4o"," {",[318,334,336],{"class":335},"sTEyZ"," DrainContext",[318,338,339],{"class":331}," }",[318,341,342],{"class":324}," from",[318,344,345],{"class":331}," '",[318,347,349],{"class":348},"sfazB","evlog",[318,351,352],{"class":331},"'\n",[318,354,356,358,360,363,365,367,369,372],{"class":320,"line":355},2,[318,357,325],{"class":324},[318,359,332],{"class":331},[318,361,362],{"class":335}," createDrainPipeline",[318,364,339],{"class":331},[318,366,342],{"class":324},[318,368,345],{"class":331},[318,370,371],{"class":348},"evlog\u002Fpipeline",[318,373,352],{"class":331},[318,375,377,379,381,384,386,388,390,393],{"class":320,"line":376},3,[318,378,325],{"class":324},[318,380,332],{"class":331},[318,382,383],{"class":335}," createAxiomDrain",[318,385,339],{"class":331},[318,387,342],{"class":324},[318,389,345],{"class":331},[318,391,392],{"class":348},"evlog\u002Faxiom",[318,394,352],{"class":331},[318,396,398],{"class":320,"line":397},4,[318,399,401],{"emptyLinePlaceholder":400},true,"\n",[318,403,405,408,411,415,418,420,424,427,431],{"class":320,"line":404},5,[318,406,407],{"class":324},"export",[318,409,410],{"class":324}," default",[318,412,414],{"class":413},"s2Zo4"," defineNitroPlugin",[318,416,417],{"class":335},"(",[318,419,417],{"class":331},[318,421,423],{"class":422},"sHdIc","nitroApp",[318,425,426],{"class":331},")",[318,428,430],{"class":429},"spNyl"," =>",[318,432,433],{"class":331}," {\n",[318,435,437,440,443,446,448,451,455,458],{"class":320,"line":436},6,[318,438,439],{"class":429},"  const",[318,441,442],{"class":335}," pipeline",[318,444,445],{"class":331}," =",[318,447,362],{"class":413},[318,449,450],{"class":331},"\u003C",[318,452,454],{"class":453},"sBMFI","DrainContext",[318,456,457],{"class":331},">",[318,459,461],{"class":460},"swJcz","()\n",[318,463,465,467,470,472,474,476,479],{"class":320,"line":464},7,[318,466,439],{"class":429},[318,468,469],{"class":335}," drain",[318,471,445],{"class":331},[318,473,442],{"class":413},[318,475,417],{"class":460},[318,477,478],{"class":413},"createAxiomDrain",[318,480,481],{"class":460},"())\n",[318,483,485],{"class":320,"line":484},8,[318,486,401],{"emptyLinePlaceholder":400},[318,488,490,493,496,499,501,504,506,509,512,514,517,519],{"class":320,"line":489},9,[318,491,492],{"class":335},"  nitroApp",[318,494,495],{"class":331},".",[318,497,498],{"class":335},"hooks",[318,500,495],{"class":331},[318,502,503],{"class":413},"hook",[318,505,417],{"class":460},[318,507,508],{"class":331},"'",[318,510,511],{"class":348},"evlog:drain",[318,513,508],{"class":331},[318,515,516],{"class":331},",",[318,518,469],{"class":335},[318,520,521],{"class":460},")\n",[318,523,525,527,529,531,533,535,537,539,542,544,546,549,551,553,555,558],{"class":320,"line":524},10,[318,526,492],{"class":335},[318,528,495],{"class":331},[318,530,498],{"class":335},[318,532,495],{"class":331},[318,534,503],{"class":413},[318,536,417],{"class":460},[318,538,508],{"class":331},[318,540,541],{"class":348},"close",[318,543,508],{"class":331},[318,545,516],{"class":331},[318,547,548],{"class":331}," ()",[318,550,430],{"class":429},[318,552,469],{"class":335},[318,554,495],{"class":331},[318,556,557],{"class":413},"flush",[318,559,481],{"class":460},[318,561,563,566],{"class":320,"line":562},11,[318,564,565],{"class":331},"}",[318,567,521],{"class":335},[569,570,573,574,577],"callout",{"color":571,"icon":572},"warning","i-lucide-alert-triangle","Always call ",[315,575,576],{},"drain.flush()"," on server shutdown to ensure buffered events are sent before the process exits.",[303,579,581],{"id":580},"how-it-works","How It Works",[583,584,585,592,604,610,617],"ol",{},[586,587,588,589,591],"li",{},"Events are buffered in memory as they arrive via the ",[315,590,511],{}," hook",[586,593,594,595,599,600,603],{},"A batch is flushed when either the ",[596,597,598],"strong",{},"batch size"," is reached or the ",[596,601,602],{},"interval"," expires (whichever comes first)",[586,605,606,607],{},"If the drain function fails, the batch is retried with the configured ",[596,608,609],{},"backoff strategy",[586,611,612,613,616],{},"If all retries are exhausted, ",[315,614,615],{},"onDropped"," is called with the lost events",[586,618,619,620,623],{},"If the buffer exceeds ",[315,621,622],{},"maxBufferSize",", the oldest events are dropped to prevent memory leaks",[303,625,76],{"id":626},"configuration",[307,628,630],{"className":309,"code":629,"filename":311,"language":312,"meta":313,"style":313},"import 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    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\n  const drain = pipeline(createAxiomDrain())\n\n  nitroApp.hooks.hook('evlog:drain', drain)\n  nitroApp.hooks.hook('close', () => drain.flush())\n})\n",[315,631,632,652,670,688,692,712,733,743,760,775,780,789,803,820,833,846,851,863,888,936,941,949,954,971,976,1003,1038],{"__ignoreMap":313},[318,633,634,636,638,640,642,644,646,648,650],{"class":320,"line":321},[318,635,325],{"class":324},[318,637,328],{"class":324},[318,639,332],{"class":331},[318,641,336],{"class":335},[318,643,339],{"class":331},[318,645,342],{"class":324},[318,647,345],{"class":331},[318,649,349],{"class":348},[318,651,352],{"class":331},[318,653,654,656,658,660,662,664,666,668],{"class":320,"line":355},[318,655,325],{"class":324},[318,657,332],{"class":331},[318,659,362],{"class":335},[318,661,339],{"class":331},[318,663,342],{"class":324},[318,665,345],{"class":331},[318,667,371],{"class":348},[318,669,352],{"class":331},[318,671,672,674,676,678,680,682,684,686],{"class":320,"line":376},[318,673,325],{"class":324},[318,675,332],{"class":331},[318,677,383],{"class":335},[318,679,339],{"class":331},[318,681,342],{"class":324},[318,683,345],{"class":331},[318,685,392],{"class":348},[318,687,352],{"class":331},[318,689,690],{"class":320,"line":397},[318,691,401],{"emptyLinePlaceholder":400},[318,693,694,696,698,700,702,704,706,708,710],{"class":320,"line":404},[318,695,407],{"class":324},[318,697,410],{"class":324},[318,699,414],{"class":413},[318,701,417],{"class":335},[318,703,417],{"class":331},[318,705,423],{"class":422},[318,707,426],{"class":331},[318,709,430],{"class":429},[318,711,433],{"class":331},[318,713,714,716,718,720,722,724,726,728,730],{"class":320,"line":436},[318,715,439],{"class":429},[318,717,442],{"class":335},[318,719,445],{"class":331},[318,721,362],{"class":413},[318,723,450],{"class":331},[318,725,454],{"class":453},[318,727,457],{"class":331},[318,729,417],{"class":460},[318,731,732],{"class":331},"{\n",[318,734,735,738,741],{"class":320,"line":464},[318,736,737],{"class":460},"    batch",[318,739,740],{"class":331},":",[318,742,433],{"class":331},[318,744,745,748,750,754,756],{"class":320,"line":484},[318,746,747],{"class":460},"      size",[318,749,740],{"class":331},[318,751,753],{"class":752},"sbssI"," 50",[318,755,516],{"class":331},[318,757,759],{"class":758},"sHwdD","          \u002F\u002F Flush every 50 events\n",[318,761,762,765,767,770,772],{"class":320,"line":489},[318,763,764],{"class":460},"      intervalMs",[318,766,740],{"class":331},[318,768,769],{"class":752}," 5000",[318,771,516],{"class":331},[318,773,774],{"class":758},"  \u002F\u002F Or every 5 seconds, whichever comes first\n",[318,776,777],{"class":320,"line":524},[318,778,779],{"class":331},"    },\n",[318,781,782,785,787],{"class":320,"line":562},[318,783,784],{"class":460},"    retry",[318,786,740],{"class":331},[318,788,433],{"class":331},[318,790,792,795,797,800],{"class":320,"line":791},12,[318,793,794],{"class":460},"      maxAttempts",[318,796,740],{"class":331},[318,798,799],{"class":752}," 3",[318,801,802],{"class":331},",\n",[318,804,806,809,811,813,816,818],{"class":320,"line":805},13,[318,807,808],{"class":460},"      backoff",[318,810,740],{"class":331},[318,812,345],{"class":331},[318,814,815],{"class":348},"exponential",[318,817,508],{"class":331},[318,819,802],{"class":331},[318,821,823,826,828,831],{"class":320,"line":822},14,[318,824,825],{"class":460},"      initialDelayMs",[318,827,740],{"class":331},[318,829,830],{"class":752}," 1000",[318,832,802],{"class":331},[318,834,836,839,841,844],{"class":320,"line":835},15,[318,837,838],{"class":460},"      maxDelayMs",[318,840,740],{"class":331},[318,842,843],{"class":752}," 30000",[318,845,802],{"class":331},[318,847,849],{"class":320,"line":848},16,[318,850,779],{"class":331},[318,852,854,857,859,861],{"class":320,"line":853},17,[318,855,856],{"class":460},"    maxBufferSize",[318,858,740],{"class":331},[318,860,830],{"class":752},[318,862,802],{"class":331},[318,864,866,869,871,874,877,879,882,884,886],{"class":320,"line":865},18,[318,867,868],{"class":413},"    onDropped",[318,870,740],{"class":331},[318,872,873],{"class":331}," (",[318,875,876],{"class":422},"events",[318,878,516],{"class":331},[318,880,881],{"class":422}," error",[318,883,426],{"class":331},[318,885,430],{"class":429},[318,887,433],{"class":331},[318,889,891,894,896,899,901,904,907,910,912,914,917,919,922,924,926,928,931,934],{"class":320,"line":890},19,[318,892,893],{"class":335},"      console",[318,895,495],{"class":331},[318,897,898],{"class":413},"error",[318,900,417],{"class":460},[318,902,903],{"class":331},"`",[318,905,906],{"class":348},"[evlog] Dropped ",[318,908,909],{"class":331},"${",[318,911,876],{"class":335},[318,913,495],{"class":331},[318,915,916],{"class":335},"length",[318,918,565],{"class":331},[318,920,921],{"class":348}," events:",[318,923,903],{"class":331},[318,925,516],{"class":331},[318,927,881],{"class":335},[318,929,930],{"class":331},"?.",[318,932,933],{"class":335},"message",[318,935,521],{"class":460},[318,937,939],{"class":320,"line":938},20,[318,940,779],{"class":331},[318,942,944,947],{"class":320,"line":943},21,[318,945,946],{"class":331},"  }",[318,948,521],{"class":460},[318,950,952],{"class":320,"line":951},22,[318,953,401],{"emptyLinePlaceholder":400},[318,955,957,959,961,963,965,967,969],{"class":320,"line":956},23,[318,958,439],{"class":429},[318,960,469],{"class":335},[318,962,445],{"class":331},[318,964,442],{"class":413},[318,966,417],{"class":460},[318,968,478],{"class":413},[318,970,481],{"class":460},[318,972,974],{"class":320,"line":973},24,[318,975,401],{"emptyLinePlaceholder":400},[318,977,979,981,983,985,987,989,991,993,995,997,999,1001],{"class":320,"line":978},25,[318,980,492],{"class":335},[318,982,495],{"class":331},[318,984,498],{"class":335},[318,986,495],{"class":331},[318,988,503],{"class":413},[318,990,417],{"class":460},[318,992,508],{"class":331},[318,994,511],{"class":348},[318,996,508],{"class":331},[318,998,516],{"class":331},[318,1000,469],{"class":335},[318,1002,521],{"class":460},[318,1004,1006,1008,1010,1012,1014,1016,1018,1020,1022,1024,1026,1028,1030,1032,1034,1036],{"class":320,"line":1005},26,[318,1007,492],{"class":335},[318,1009,495],{"class":331},[318,1011,498],{"class":335},[318,1013,495],{"class":331},[318,1015,503],{"class":413},[318,1017,417],{"class":460},[318,1019,508],{"class":331},[318,1021,541],{"class":348},[318,1023,508],{"class":331},[318,1025,516],{"class":331},[318,1027,548],{"class":331},[318,1029,430],{"class":429},[318,1031,469],{"class":335},[318,1033,495],{"class":331},[318,1035,557],{"class":413},[318,1037,481],{"class":460},[318,1039,1041,1043],{"class":320,"line":1040},27,[318,1042,565],{"class":331},[318,1044,521],{"class":335},[1046,1047,1049],"h3",{"id":1048},"options-reference","Options Reference",[1051,1052,1053,1069],"table",{},[1054,1055,1056],"thead",{},[1057,1058,1059,1063,1066],"tr",{},[1060,1061,1062],"th",{},"Option",[1060,1064,1065],{},"Default",[1060,1067,1068],{},"Description",[1070,1071,1072,1088,1103,1118,1141,1156,1171,1184],"tbody",{},[1057,1073,1074,1080,1085],{},[1075,1076,1077],"td",{},[315,1078,1079],{},"batch.size",[1075,1081,1082],{},[315,1083,1084],{},"50",[1075,1086,1087],{},"Maximum events per batch",[1057,1089,1090,1095,1100],{},[1075,1091,1092],{},[315,1093,1094],{},"batch.intervalMs",[1075,1096,1097],{},[315,1098,1099],{},"5000",[1075,1101,1102],{},"Max time (ms) before flushing a partial batch",[1057,1104,1105,1110,1115],{},[1075,1106,1107],{},[315,1108,1109],{},"retry.maxAttempts",[1075,1111,1112],{},[315,1113,1114],{},"3",[1075,1116,1117],{},"Total attempts including the initial one",[1057,1119,1120,1125,1130],{},[1075,1121,1122],{},[315,1123,1124],{},"retry.backoff",[1075,1126,1127],{},[315,1128,1129],{},"'exponential'",[1075,1131,1132,1134,1135,1134,1138],{},[315,1133,1129],{}," | ",[315,1136,1137],{},"'linear'",[315,1139,1140],{},"'fixed'",[1057,1142,1143,1148,1153],{},[1075,1144,1145],{},[315,1146,1147],{},"retry.initialDelayMs",[1075,1149,1150],{},[315,1151,1152],{},"1000",[1075,1154,1155],{},"Base delay for the first retry",[1057,1157,1158,1163,1168],{},[1075,1159,1160],{},[315,1161,1162],{},"retry.maxDelayMs",[1075,1164,1165],{},[315,1166,1167],{},"30000",[1075,1169,1170],{},"Upper bound for any retry delay",[1057,1172,1173,1177,1181],{},[1075,1174,1175],{},[315,1176,622],{},[1075,1178,1179],{},[315,1180,1152],{},[1075,1182,1183],{},"Max buffered events before dropping oldest",[1057,1185,1186,1190,1193],{},[1075,1187,1188],{},[315,1189,615],{},[1075,1191,1192],{},"-",[1075,1194,1195],{},"Callback when events are dropped (overflow or retry exhaustion)",[303,1197,1199],{"id":1198},"backoff-strategies","Backoff Strategies",[1051,1201,1202,1215],{},[1054,1203,1204],{},[1057,1205,1206,1209,1212],{},[1060,1207,1208],{},"Strategy",[1060,1210,1211],{},"Delay Pattern",[1060,1213,1214],{},"Use Case",[1070,1216,1217,1229,1242],{},[1057,1218,1219,1223,1226],{},[1075,1220,1221],{},[315,1222,815],{},[1075,1224,1225],{},"1s, 2s, 4s, 8s...",[1075,1227,1228],{},"Default. Best for transient failures that may need time to recover",[1057,1230,1231,1236,1239],{},[1075,1232,1233],{},[315,1234,1235],{},"linear",[1075,1237,1238],{},"1s, 2s, 3s, 4s...",[1075,1240,1241],{},"Predictable delay growth",[1057,1243,1244,1249,1252],{},[1075,1245,1246],{},[315,1247,1248],{},"fixed",[1075,1250,1251],{},"1s, 1s, 1s, 1s...",[1075,1253,1254],{},"Same delay every time. Useful for rate-limited APIs",[303,1256,1258],{"id":1257},"returned-drain-function","Returned Drain Function",[299,1260,1261,1262,1265],{},"The function returned by ",[315,1263,1264],{},"pipeline(drain)"," is hook-compatible and exposes:",[1051,1267,1268,1280],{},[1054,1269,1270],{},[1057,1271,1272,1275,1278],{},[1060,1273,1274],{},"Property",[1060,1276,1277],{},"Type",[1060,1279,1068],{},[1070,1281,1282,1297,1311],{},[1057,1283,1284,1289,1294],{},[1075,1285,1286],{},[315,1287,1288],{},"drain(ctx)",[1075,1290,1291],{},[315,1292,1293],{},"(ctx: T) => void",[1075,1295,1296],{},"Push a single event into the buffer",[1057,1298,1299,1303,1308],{},[1075,1300,1301],{},[315,1302,576],{},[1075,1304,1305],{},[315,1306,1307],{},"() => Promise\u003Cvoid>",[1075,1309,1310],{},"Force-flush all buffered events",[1057,1312,1313,1318,1323],{},[1075,1314,1315],{},[315,1316,1317],{},"drain.pending",[1075,1319,1320],{},[315,1321,1322],{},"number",[1075,1324,1325],{},"Number of events currently buffered",[303,1327,1329],{"id":1328},"multiple-destinations","Multiple Destinations",[299,1331,1332],{},"Wrap multiple adapters with a single pipeline:",[307,1334,1336],{"className":309,"code":1335,"filename":311,"language":312,"meta":313,"style":313},"import type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createOTLPDrain } from 'evlog\u002Fotlp'\n\nexport default defineNitroPlugin((nitroApp) => {\n  const axiom = createAxiomDrain()\n  const otlp = createOTLPDrain()\n\n  const pipeline = createDrainPipeline\u003CDrainContext>()\n  const drain = pipeline(async (batch) => {\n    await Promise.allSettled([axiom(batch), otlp(batch)])\n  })\n\n  nitroApp.hooks.hook('evlog:drain', drain)\n  nitroApp.hooks.hook('close', () => drain.flush())\n})\n",[315,1337,1338,1358,1376,1394,1414,1418,1438,1451,1464,1468,1486,1512,1548,1554,1558,1584,1618],{"__ignoreMap":313},[318,1339,1340,1342,1344,1346,1348,1350,1352,1354,1356],{"class":320,"line":321},[318,1341,325],{"class":324},[318,1343,328],{"class":324},[318,1345,332],{"class":331},[318,1347,336],{"class":335},[318,1349,339],{"class":331},[318,1351,342],{"class":324},[318,1353,345],{"class":331},[318,1355,349],{"class":348},[318,1357,352],{"class":331},[318,1359,1360,1362,1364,1366,1368,1370,1372,1374],{"class":320,"line":355},[318,1361,325],{"class":324},[318,1363,332],{"class":331},[318,1365,362],{"class":335},[318,1367,339],{"class":331},[318,1369,342],{"class":324},[318,1371,345],{"class":331},[318,1373,371],{"class":348},[318,1375,352],{"class":331},[318,1377,1378,1380,1382,1384,1386,1388,1390,1392],{"class":320,"line":376},[318,1379,325],{"class":324},[318,1381,332],{"class":331},[318,1383,383],{"class":335},[318,1385,339],{"class":331},[318,1387,342],{"class":324},[318,1389,345],{"class":331},[318,1391,392],{"class":348},[318,1393,352],{"class":331},[318,1395,1396,1398,1400,1403,1405,1407,1409,1412],{"class":320,"line":397},[318,1397,325],{"class":324},[318,1399,332],{"class":331},[318,1401,1402],{"class":335}," createOTLPDrain",[318,1404,339],{"class":331},[318,1406,342],{"class":324},[318,1408,345],{"class":331},[318,1410,1411],{"class":348},"evlog\u002Fotlp",[318,1413,352],{"class":331},[318,1415,1416],{"class":320,"line":404},[318,1417,401],{"emptyLinePlaceholder":400},[318,1419,1420,1422,1424,1426,1428,1430,1432,1434,1436],{"class":320,"line":436},[318,1421,407],{"class":324},[318,1423,410],{"class":324},[318,1425,414],{"class":413},[318,1427,417],{"class":335},[318,1429,417],{"class":331},[318,1431,423],{"class":422},[318,1433,426],{"class":331},[318,1435,430],{"class":429},[318,1437,433],{"class":331},[318,1439,1440,1442,1445,1447,1449],{"class":320,"line":464},[318,1441,439],{"class":429},[318,1443,1444],{"class":335}," axiom",[318,1446,445],{"class":331},[318,1448,383],{"class":413},[318,1450,461],{"class":460},[318,1452,1453,1455,1458,1460,1462],{"class":320,"line":484},[318,1454,439],{"class":429},[318,1456,1457],{"class":335}," otlp",[318,1459,445],{"class":331},[318,1461,1402],{"class":413},[318,1463,461],{"class":460},[318,1465,1466],{"class":320,"line":489},[318,1467,401],{"emptyLinePlaceholder":400},[318,1469,1470,1472,1474,1476,1478,1480,1482,1484],{"class":320,"line":524},[318,1471,439],{"class":429},[318,1473,442],{"class":335},[318,1475,445],{"class":331},[318,1477,362],{"class":413},[318,1479,450],{"class":331},[318,1481,454],{"class":453},[318,1483,457],{"class":331},[318,1485,461],{"class":460},[318,1487,1488,1490,1492,1494,1496,1498,1501,1503,1506,1508,1510],{"class":320,"line":562},[318,1489,439],{"class":429},[318,1491,469],{"class":335},[318,1493,445],{"class":331},[318,1495,442],{"class":413},[318,1497,417],{"class":460},[318,1499,1500],{"class":429},"async",[318,1502,873],{"class":331},[318,1504,1505],{"class":422},"batch",[318,1507,426],{"class":331},[318,1509,430],{"class":429},[318,1511,433],{"class":331},[318,1513,1514,1517,1520,1522,1525,1528,1531,1533,1535,1537,1539,1541,1543,1545],{"class":320,"line":791},[318,1515,1516],{"class":324},"    await",[318,1518,1519],{"class":453}," Promise",[318,1521,495],{"class":331},[318,1523,1524],{"class":413},"allSettled",[318,1526,1527],{"class":460},"([",[318,1529,1530],{"class":413},"axiom",[318,1532,417],{"class":460},[318,1534,1505],{"class":335},[318,1536,426],{"class":460},[318,1538,516],{"class":331},[318,1540,1457],{"class":413},[318,1542,417],{"class":460},[318,1544,1505],{"class":335},[318,1546,1547],{"class":460},")])\n",[318,1549,1550,1552],{"class":320,"line":805},[318,1551,946],{"class":331},[318,1553,521],{"class":460},[318,1555,1556],{"class":320,"line":822},[318,1557,401],{"emptyLinePlaceholder":400},[318,1559,1560,1562,1564,1566,1568,1570,1572,1574,1576,1578,1580,1582],{"class":320,"line":835},[318,1561,492],{"class":335},[318,1563,495],{"class":331},[318,1565,498],{"class":335},[318,1567,495],{"class":331},[318,1569,503],{"class":413},[318,1571,417],{"class":460},[318,1573,508],{"class":331},[318,1575,511],{"class":348},[318,1577,508],{"class":331},[318,1579,516],{"class":331},[318,1581,469],{"class":335},[318,1583,521],{"class":460},[318,1585,1586,1588,1590,1592,1594,1596,1598,1600,1602,1604,1606,1608,1610,1612,1614,1616],{"class":320,"line":848},[318,1587,492],{"class":335},[318,1589,495],{"class":331},[318,1591,498],{"class":335},[318,1593,495],{"class":331},[318,1595,503],{"class":413},[318,1597,417],{"class":460},[318,1599,508],{"class":331},[318,1601,541],{"class":348},[318,1603,508],{"class":331},[318,1605,516],{"class":331},[318,1607,548],{"class":331},[318,1609,430],{"class":429},[318,1611,469],{"class":335},[318,1613,495],{"class":331},[318,1615,557],{"class":413},[318,1617,481],{"class":460},[318,1619,1620,1622],{"class":320,"line":853},[318,1621,565],{"class":331},[318,1623,521],{"class":335},[303,1625,1627],{"id":1626},"custom-drain-function","Custom Drain Function",[299,1629,1630],{},"You don't need an adapter. Pass any async function that accepts a batch:",[307,1632,1634],{"className":309,"code":1633,"filename":311,"language":312,"meta":313,"style":313},"import type { DrainContext } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nexport default defineNitroPlugin((nitroApp) => {\n  const pipeline = createDrainPipeline\u003CDrainContext>({\n    batch: { size: 100 },\n  })\n\n  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\n  nitroApp.hooks.hook('evlog:drain', drain)\n  nitroApp.hooks.hook('close', () => drain.flush())\n})\n",[315,1635,1636,1656,1674,1678,1698,1718,1737,1743,1747,1771,1791,1807,1834,1878,1885,1891,1895,1921,1955],{"__ignoreMap":313},[318,1637,1638,1640,1642,1644,1646,1648,1650,1652,1654],{"class":320,"line":321},[318,1639,325],{"class":324},[318,1641,328],{"class":324},[318,1643,332],{"class":331},[318,1645,336],{"class":335},[318,1647,339],{"class":331},[318,1649,342],{"class":324},[318,1651,345],{"class":331},[318,1653,349],{"class":348},[318,1655,352],{"class":331},[318,1657,1658,1660,1662,1664,1666,1668,1670,1672],{"class":320,"line":355},[318,1659,325],{"class":324},[318,1661,332],{"class":331},[318,1663,362],{"class":335},[318,1665,339],{"class":331},[318,1667,342],{"class":324},[318,1669,345],{"class":331},[318,1671,371],{"class":348},[318,1673,352],{"class":331},[318,1675,1676],{"class":320,"line":376},[318,1677,401],{"emptyLinePlaceholder":400},[318,1679,1680,1682,1684,1686,1688,1690,1692,1694,1696],{"class":320,"line":397},[318,1681,407],{"class":324},[318,1683,410],{"class":324},[318,1685,414],{"class":413},[318,1687,417],{"class":335},[318,1689,417],{"class":331},[318,1691,423],{"class":422},[318,1693,426],{"class":331},[318,1695,430],{"class":429},[318,1697,433],{"class":331},[318,1699,1700,1702,1704,1706,1708,1710,1712,1714,1716],{"class":320,"line":404},[318,1701,439],{"class":429},[318,1703,442],{"class":335},[318,1705,445],{"class":331},[318,1707,362],{"class":413},[318,1709,450],{"class":331},[318,1711,454],{"class":453},[318,1713,457],{"class":331},[318,1715,417],{"class":460},[318,1717,732],{"class":331},[318,1719,1720,1722,1724,1726,1729,1731,1734],{"class":320,"line":436},[318,1721,737],{"class":460},[318,1723,740],{"class":331},[318,1725,332],{"class":331},[318,1727,1728],{"class":460}," size",[318,1730,740],{"class":331},[318,1732,1733],{"class":752}," 100",[318,1735,1736],{"class":331}," },\n",[318,1738,1739,1741],{"class":320,"line":464},[318,1740,946],{"class":331},[318,1742,521],{"class":460},[318,1744,1745],{"class":320,"line":484},[318,1746,401],{"emptyLinePlaceholder":400},[318,1748,1749,1751,1753,1755,1757,1759,1761,1763,1765,1767,1769],{"class":320,"line":489},[318,1750,439],{"class":429},[318,1752,469],{"class":335},[318,1754,445],{"class":331},[318,1756,442],{"class":413},[318,1758,417],{"class":460},[318,1760,1500],{"class":429},[318,1762,873],{"class":331},[318,1764,1505],{"class":422},[318,1766,426],{"class":331},[318,1768,430],{"class":429},[318,1770,433],{"class":331},[318,1772,1773,1775,1778,1780,1782,1785,1787,1789],{"class":320,"line":524},[318,1774,1516],{"class":324},[318,1776,1777],{"class":413}," fetch",[318,1779,417],{"class":460},[318,1781,508],{"class":331},[318,1783,1784],{"class":348},"https:\u002F\u002Fyour-service.com\u002Flogs",[318,1786,508],{"class":331},[318,1788,516],{"class":331},[318,1790,433],{"class":331},[318,1792,1793,1796,1798,1800,1803,1805],{"class":320,"line":562},[318,1794,1795],{"class":460},"      method",[318,1797,740],{"class":331},[318,1799,345],{"class":331},[318,1801,1802],{"class":348},"POST",[318,1804,508],{"class":331},[318,1806,802],{"class":331},[318,1808,1809,1812,1814,1816,1818,1821,1823,1825,1827,1830,1832],{"class":320,"line":791},[318,1810,1811],{"class":460},"      headers",[318,1813,740],{"class":331},[318,1815,332],{"class":331},[318,1817,345],{"class":331},[318,1819,1820],{"class":460},"Content-Type",[318,1822,508],{"class":331},[318,1824,740],{"class":331},[318,1826,345],{"class":331},[318,1828,1829],{"class":348},"application\u002Fjson",[318,1831,508],{"class":331},[318,1833,1736],{"class":331},[318,1835,1836,1839,1841,1844,1846,1849,1851,1853,1855,1858,1860,1863,1865,1868,1870,1873,1876],{"class":320,"line":805},[318,1837,1838],{"class":460},"      body",[318,1840,740],{"class":331},[318,1842,1843],{"class":335}," JSON",[318,1845,495],{"class":331},[318,1847,1848],{"class":413},"stringify",[318,1850,417],{"class":460},[318,1852,1505],{"class":335},[318,1854,495],{"class":331},[318,1856,1857],{"class":413},"map",[318,1859,417],{"class":460},[318,1861,1862],{"class":422},"ctx",[318,1864,430],{"class":429},[318,1866,1867],{"class":335}," ctx",[318,1869,495],{"class":331},[318,1871,1872],{"class":335},"event",[318,1874,1875],{"class":460},"))",[318,1877,802],{"class":331},[318,1879,1880,1883],{"class":320,"line":822},[318,1881,1882],{"class":331},"    }",[318,1884,521],{"class":460},[318,1886,1887,1889],{"class":320,"line":835},[318,1888,946],{"class":331},[318,1890,521],{"class":460},[318,1892,1893],{"class":320,"line":848},[318,1894,401],{"emptyLinePlaceholder":400},[318,1896,1897,1899,1901,1903,1905,1907,1909,1911,1913,1915,1917,1919],{"class":320,"line":853},[318,1898,492],{"class":335},[318,1900,495],{"class":331},[318,1902,498],{"class":335},[318,1904,495],{"class":331},[318,1906,503],{"class":413},[318,1908,417],{"class":460},[318,1910,508],{"class":331},[318,1912,511],{"class":348},[318,1914,508],{"class":331},[318,1916,516],{"class":331},[318,1918,469],{"class":335},[318,1920,521],{"class":460},[318,1922,1923,1925,1927,1929,1931,1933,1935,1937,1939,1941,1943,1945,1947,1949,1951,1953],{"class":320,"line":865},[318,1924,492],{"class":335},[318,1926,495],{"class":331},[318,1928,498],{"class":335},[318,1930,495],{"class":331},[318,1932,503],{"class":413},[318,1934,417],{"class":460},[318,1936,508],{"class":331},[318,1938,541],{"class":348},[318,1940,508],{"class":331},[318,1942,516],{"class":331},[318,1944,548],{"class":331},[318,1946,430],{"class":429},[318,1948,469],{"class":335},[318,1950,495],{"class":331},[318,1952,557],{"class":413},[318,1954,481],{"class":460},[318,1956,1957,1959],{"class":320,"line":890},[318,1958,565],{"class":331},[318,1960,521],{"class":335},[303,1962,1964],{"id":1963},"standalone-usage-without-nitro","Standalone Usage (Without Nitro)",[299,1966,1967,1968,1971,1972,1975],{},"The pipeline works outside of Nitro. Use the ",[315,1969,1970],{},"drain"," option in ",[315,1973,1974],{},"initLogger"," to wire it up:",[307,1977,1980],{"className":309,"code":1978,"filename":1979,"language":312,"meta":313,"style":313},"import type { DrainContext } from 'evlog'\nimport { initLogger, log } from 'evlog'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({ batch: { size: 25 } })\nconst drain = pipeline(createAxiomDrain())\n\ninitLogger({ drain })\n\nlog.info({ action: 'started' }) \u002F\u002F batched and drained\n\n\u002F\u002F Flush before exit\nawait drain.flush()\n","index.ts",[315,1981,1982,2002,2026,2044,2062,2066,2110,2127,2131,2145,2149,2183,2187,2192],{"__ignoreMap":313},[318,1983,1984,1986,1988,1990,1992,1994,1996,1998,2000],{"class":320,"line":321},[318,1985,325],{"class":324},[318,1987,328],{"class":324},[318,1989,332],{"class":331},[318,1991,336],{"class":335},[318,1993,339],{"class":331},[318,1995,342],{"class":324},[318,1997,345],{"class":331},[318,1999,349],{"class":348},[318,2001,352],{"class":331},[318,2003,2004,2006,2008,2011,2013,2016,2018,2020,2022,2024],{"class":320,"line":355},[318,2005,325],{"class":324},[318,2007,332],{"class":331},[318,2009,2010],{"class":335}," initLogger",[318,2012,516],{"class":331},[318,2014,2015],{"class":335}," log",[318,2017,339],{"class":331},[318,2019,342],{"class":324},[318,2021,345],{"class":331},[318,2023,349],{"class":348},[318,2025,352],{"class":331},[318,2027,2028,2030,2032,2034,2036,2038,2040,2042],{"class":320,"line":376},[318,2029,325],{"class":324},[318,2031,332],{"class":331},[318,2033,362],{"class":335},[318,2035,339],{"class":331},[318,2037,342],{"class":324},[318,2039,345],{"class":331},[318,2041,371],{"class":348},[318,2043,352],{"class":331},[318,2045,2046,2048,2050,2052,2054,2056,2058,2060],{"class":320,"line":397},[318,2047,325],{"class":324},[318,2049,332],{"class":331},[318,2051,383],{"class":335},[318,2053,339],{"class":331},[318,2055,342],{"class":324},[318,2057,345],{"class":331},[318,2059,392],{"class":348},[318,2061,352],{"class":331},[318,2063,2064],{"class":320,"line":404},[318,2065,401],{"emptyLinePlaceholder":400},[318,2067,2068,2071,2074,2077,2079,2081,2083,2085,2087,2090,2093,2095,2097,2099,2101,2104,2106,2108],{"class":320,"line":436},[318,2069,2070],{"class":429},"const",[318,2072,2073],{"class":335}," pipeline ",[318,2075,2076],{"class":331},"=",[318,2078,362],{"class":413},[318,2080,450],{"class":331},[318,2082,454],{"class":453},[318,2084,457],{"class":331},[318,2086,417],{"class":335},[318,2088,2089],{"class":331},"{",[318,2091,2092],{"class":460}," batch",[318,2094,740],{"class":331},[318,2096,332],{"class":331},[318,2098,1728],{"class":460},[318,2100,740],{"class":331},[318,2102,2103],{"class":752}," 25",[318,2105,339],{"class":331},[318,2107,339],{"class":331},[318,2109,521],{"class":335},[318,2111,2112,2114,2117,2119,2121,2123,2125],{"class":320,"line":464},[318,2113,2070],{"class":429},[318,2115,2116],{"class":335}," drain ",[318,2118,2076],{"class":331},[318,2120,442],{"class":413},[318,2122,417],{"class":335},[318,2124,478],{"class":413},[318,2126,481],{"class":335},[318,2128,2129],{"class":320,"line":484},[318,2130,401],{"emptyLinePlaceholder":400},[318,2132,2133,2135,2137,2139,2141,2143],{"class":320,"line":489},[318,2134,1974],{"class":413},[318,2136,417],{"class":335},[318,2138,2089],{"class":331},[318,2140,2116],{"class":335},[318,2142,565],{"class":331},[318,2144,521],{"class":335},[318,2146,2147],{"class":320,"line":524},[318,2148,401],{"emptyLinePlaceholder":400},[318,2150,2151,2154,2156,2159,2161,2163,2166,2168,2170,2173,2175,2177,2180],{"class":320,"line":562},[318,2152,2153],{"class":335},"log",[318,2155,495],{"class":331},[318,2157,2158],{"class":413},"info",[318,2160,417],{"class":335},[318,2162,2089],{"class":331},[318,2164,2165],{"class":460}," action",[318,2167,740],{"class":331},[318,2169,345],{"class":331},[318,2171,2172],{"class":348},"started",[318,2174,508],{"class":331},[318,2176,339],{"class":331},[318,2178,2179],{"class":335},") ",[318,2181,2182],{"class":758},"\u002F\u002F batched and drained\n",[318,2184,2185],{"class":320,"line":791},[318,2186,401],{"emptyLinePlaceholder":400},[318,2188,2189],{"class":320,"line":805},[318,2190,2191],{"class":758},"\u002F\u002F Flush before exit\n",[318,2193,2194,2197,2199,2201,2203],{"class":320,"line":822},[318,2195,2196],{"class":324},"await",[318,2198,469],{"class":335},[318,2200,495],{"class":331},[318,2202,557],{"class":413},[318,2204,461],{"class":335},[569,2206,2209,2210,2217],{"color":2207,"icon":2208},"neutral","i-lucide-arrow-right","See the full ",[2211,2212,2216],"a",{"href":2213,"rel":2214},"https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Fbun-script",[2215],"nofollow","bun-script example"," for a complete working script.",[569,2219,2220,2221,2224],{"color":2207,"icon":211},"See the ",[2211,2222,2223],{"href":126},"Next.js guide"," for a working implementation.",[303,2226,2228],{"id":2227},"next-steps","Next Steps",[2230,2231,2232,2238,2243],"ul",{},[586,2233,2234,2237],{},[2211,2235,2236],{"href":204},"Adapters Overview"," - Available built-in adapters",[586,2239,2240,2242],{},[2211,2241,208],{"href":209}," - Build your own drain function",[586,2244,2245,2247],{},[2211,2246,91],{"href":92}," - Security and production tips",[2249,2250,2251],"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 .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}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}",{"title":313,"searchDepth":355,"depth":355,"links":2253},[2254,2255,2256,2259,2260,2261,2262,2263,2264],{"id":305,"depth":355,"text":20},{"id":580,"depth":355,"text":581},{"id":626,"depth":355,"text":76,"children":2257},[2258],{"id":1048,"depth":376,"text":1049},{"id":1198,"depth":355,"text":1199},{"id":1257,"depth":355,"text":1258},{"id":1328,"depth":355,"text":1329},{"id":1626,"depth":355,"text":1627},{"id":1963,"depth":355,"text":1964},{"id":2227,"depth":355,"text":2228},"Batch events, retry on failure, and protect against buffer overflow with the shared drain pipeline. Supports fan-out to multiple adapters.","md",[2268,2270],{"label":2236,"icon":206,"to":204,"color":2207,"variant":2269},"subtle",{"label":208,"icon":211,"to":209,"color":2207,"variant":2269},{},{"title":213,"icon":216},{"title":294,"description":2265},"7b_HFbDx539Yckffdxnx4Ivv2MenqNzR76Sdnppkr6E",[2276,2278],{"title":208,"path":209,"stem":210,"description":2277,"icon":211,"children":-1},"Build your own adapter to send logs to any destination. Factory patterns, batching, filtering, and error handling best practices.",{"title":218,"path":219,"stem":220,"description":2279,"icon":221,"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.",1776042671493]