[{"data":1,"prerenderedAt":1799},["ShallowReactive",2],{"navigation_docs":3,"-adapters-overview":243,"-adapters-overview-surround":1794},[4,30,110,159,213,229],{"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},"Frameworks","\u002Fframeworks","2.frameworks",[35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Fframeworks\u002Foverview","2.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":41,"path":42,"stem":43,"icon":44},"Nuxt","\u002Fframeworks\u002Fnuxt","2.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":46,"path":47,"stem":48,"icon":49},"Next.js","\u002Fframeworks\u002Fnextjs","2.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":51,"path":52,"stem":53,"icon":54},"SvelteKit","\u002Fframeworks\u002Fsveltekit","2.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":56,"path":57,"stem":58,"icon":59},"Nitro","\u002Fframeworks\u002Fnitro","2.frameworks\u002F04.nitro","i-custom-nitro",{"title":61,"path":62,"stem":63,"icon":64},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","2.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":66,"path":67,"stem":68,"icon":69},"NestJS","\u002Fframeworks\u002Fnestjs","2.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":71,"path":72,"stem":73,"icon":74},"Express","\u002Fframeworks\u002Fexpress","2.frameworks\u002F07.express","i-simple-icons-express",{"title":76,"path":77,"stem":78,"icon":79},"Hono","\u002Fframeworks\u002Fhono","2.frameworks\u002F08.hono","i-simple-icons-hono",{"title":81,"path":82,"stem":83,"icon":84},"Fastify","\u002Fframeworks\u002Ffastify","2.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":86,"path":87,"stem":88,"icon":89},"Elysia","\u002Fframeworks\u002Felysia","2.frameworks\u002F10.elysia","i-custom-elysia",{"title":91,"path":92,"stem":93,"icon":94},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","2.frameworks\u002F11.cloudflare-workers","i-simple-icons-cloudflare",{"title":96,"path":97,"stem":98,"icon":99},"Standalone","\u002Fframeworks\u002Fstandalone","2.frameworks\u002F12.standalone","i-simple-icons-typescript",{"title":101,"path":102,"stem":103,"icon":104},"Astro","\u002Fframeworks\u002Fastro","2.frameworks\u002F13.astro","i-simple-icons-astro",{"title":106,"path":107,"stem":108,"icon":109},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","2.frameworks\u002F14.custom-integration","i-lucide-puzzle",{"title":111,"path":112,"stem":113,"children":114,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[115,120,125,130,135,139,144,149,154],{"title":116,"path":117,"stem":118,"icon":119},"Request Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":121,"path":122,"stem":123,"icon":124},"Wide Events","\u002Fcore-concepts\u002Fwide-events","3.core-concepts\u002F1.wide-events","i-lucide-layers",{"title":126,"path":127,"stem":128,"icon":129},"Structured Errors","\u002Fcore-concepts\u002Fstructured-errors","3.core-concepts\u002F2.structured-errors","i-lucide-shield-alert",{"title":131,"path":132,"stem":133,"icon":134},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F3.best-practices","i-lucide-shield-check",{"title":136,"path":137,"stem":138,"icon":99},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F4.typed-fields",{"title":140,"path":141,"stem":142,"icon":143},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F5.sampling","i-lucide-filter",{"title":145,"path":146,"stem":147,"icon":148},"Client Logging","\u002Fcore-concepts\u002Fclient-logging","3.core-concepts\u002F6.client-logging","i-lucide-monitor",{"title":150,"path":151,"stem":152,"icon":153},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F7.configuration","i-lucide-settings",{"title":155,"path":156,"stem":157,"icon":158},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F8.performance","i-lucide-gauge",{"title":160,"path":161,"stem":162,"children":163,"page":29},"Adapters","\u002Fadapters","4.adapters",[164,168,173,178,183,188,193,198,203,208],{"title":36,"path":165,"stem":166,"icon":167},"\u002Fadapters\u002Foverview","4.adapters\u002F1.overview","i-custom-plug",{"title":169,"path":170,"stem":171,"icon":172},"Browser","\u002Fadapters\u002Fbrowser","4.adapters\u002F10.browser","i-lucide-globe",{"title":174,"path":175,"stem":176,"icon":177},"Axiom","\u002Fadapters\u002Faxiom","4.adapters\u002F2.axiom","i-custom-axiom",{"title":179,"path":180,"stem":181,"icon":182},"OTLP","\u002Fadapters\u002Fotlp","4.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":184,"path":185,"stem":186,"icon":187},"PostHog","\u002Fadapters\u002Fposthog","4.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":189,"path":190,"stem":191,"icon":192},"Sentry","\u002Fadapters\u002Fsentry","4.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":194,"path":195,"stem":196,"icon":197},"Better Stack","\u002Fadapters\u002Fbetter-stack","4.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":199,"path":200,"stem":201,"icon":202},"File System","\u002Fadapters\u002Ffs","4.adapters\u002F7.fs","i-lucide-hard-drive",{"title":204,"path":205,"stem":206,"icon":207},"Custom Adapters","\u002Fadapters\u002Fcustom","4.adapters\u002F8.custom","i-lucide-code",{"title":209,"path":210,"stem":211,"icon":212},"Pipeline","\u002Fadapters\u002Fpipeline","4.adapters\u002F9.pipeline","i-lucide-workflow",{"title":214,"path":215,"stem":216,"children":217,"page":29},"Enrichers","\u002Fenrichers","5.enrichers",[218,221,225],{"title":36,"path":219,"stem":220,"icon":28},"\u002Fenrichers\u002Foverview","5.enrichers\u002F1.overview",{"title":222,"path":223,"stem":224,"icon":109},"Built-in","\u002Fenrichers\u002Fbuilt-in","5.enrichers\u002F2.built-in",{"title":226,"path":227,"stem":228,"icon":207},"Custom","\u002Fenrichers\u002Fcustom","5.enrichers\u002F3.custom",{"title":230,"path":231,"stem":232,"children":233,"page":29},"NuxtHub","\u002Fnuxthub","6.nuxthub",[234,238],{"title":36,"path":235,"stem":236,"icon":237},"\u002Fnuxthub\u002Foverview","6.nuxthub\u002F1.overview","i-lucide-database",{"title":239,"path":240,"stem":241,"icon":242},"Retention","\u002Fnuxthub\u002Fretention","6.nuxthub\u002F2.retention","i-lucide-clock",{"id":244,"title":245,"body":246,"description":1780,"extension":1781,"links":1782,"meta":1790,"navigation":1791,"path":165,"seo":1792,"stem":166,"__hash__":1793},"docs\u002F4.adapters\u002F1.overview.md","Adapters Overview",{"type":247,"value":248,"toc":1772},"minimark",[249,253,258,271,274,742,755,759,790,794,804,1155,1168,1172,1175,1317,1323,1534,1538,1544,1621,1638,1642,1645,1652,1761,1768],[250,251,252],"p",{},"Adapters let you send logs to external observability platforms. evlog provides built-in adapters for popular services, and you can create custom adapters for any destination.",[254,255,257],"h2",{"id":256},"how-adapters-work","How Adapters Work",[250,259,260,261,265,266,270],{},"Adapters receive a ",[262,263,264],"code",{},"DrainContext"," after each request completes and send the data to an external service. The drain runs in ",[267,268,269],"strong",{},"fire-and-forget"," mode, meaning it never blocks the HTTP response.",[250,272,273],{},"How you wire an adapter depends on your framework:",[275,276,277,411,474,528,587,641,694],"code-group",{},[278,279,285],"pre",{"className":280,"code":281,"filename":282,"language":283,"meta":284,"style":284},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n})\n","Nuxt \u002F Nitro","typescript","",[262,286,287,296,327,334,366,402],{"__ignoreMap":284},[288,289,292],"span",{"class":290,"line":291},"line",1,[288,293,295],{"class":294},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[288,297,299,303,307,311,314,317,320,324],{"class":290,"line":298},2,[288,300,302],{"class":301},"s7zQu","import",[288,304,306],{"class":305},"sMK4o"," {",[288,308,310],{"class":309},"sTEyZ"," createAxiomDrain",[288,312,313],{"class":305}," }",[288,315,316],{"class":301}," from",[288,318,319],{"class":305}," '",[288,321,323],{"class":322},"sfazB","evlog\u002Faxiom",[288,325,326],{"class":305},"'\n",[288,328,330],{"class":290,"line":329},3,[288,331,333],{"emptyLinePlaceholder":332},true,"\n",[288,335,337,340,343,347,350,352,356,359,363],{"class":290,"line":336},4,[288,338,339],{"class":301},"export",[288,341,342],{"class":301}," default",[288,344,346],{"class":345},"s2Zo4"," defineNitroPlugin",[288,348,349],{"class":309},"(",[288,351,349],{"class":305},[288,353,355],{"class":354},"sHdIc","nitroApp",[288,357,358],{"class":305},")",[288,360,362],{"class":361},"spNyl"," =>",[288,364,365],{"class":305}," {\n",[288,367,369,372,375,378,380,383,386,389,392,394,397,399],{"class":290,"line":368},5,[288,370,371],{"class":309},"  nitroApp",[288,373,374],{"class":305},".",[288,376,377],{"class":309},"hooks",[288,379,374],{"class":305},[288,381,382],{"class":345},"hook",[288,384,349],{"class":385},"swJcz",[288,387,388],{"class":305},"'",[288,390,391],{"class":322},"evlog:drain",[288,393,388],{"class":305},[288,395,396],{"class":305},",",[288,398,310],{"class":345},[288,400,401],{"class":385},"())\n",[288,403,405,408],{"class":290,"line":404},6,[288,406,407],{"class":305},"}",[288,409,410],{"class":309},")\n",[278,412,414],{"className":280,"code":413,"filename":76,"language":283,"meta":284,"style":284},"import { createAxiomDrain } from 'evlog\u002Faxiom'\n\napp.use(evlog({ drain: createAxiomDrain() }))\n",[262,415,416,434,438],{"__ignoreMap":284},[288,417,418,420,422,424,426,428,430,432],{"class":290,"line":291},[288,419,302],{"class":301},[288,421,306],{"class":305},[288,423,310],{"class":309},[288,425,313],{"class":305},[288,427,316],{"class":301},[288,429,319],{"class":305},[288,431,323],{"class":322},[288,433,326],{"class":305},[288,435,436],{"class":290,"line":298},[288,437,333],{"emptyLinePlaceholder":332},[288,439,440,443,445,448,450,453,455,458,461,464,466,469,471],{"class":290,"line":329},[288,441,442],{"class":309},"app",[288,444,374],{"class":305},[288,446,447],{"class":345},"use",[288,449,349],{"class":309},[288,451,452],{"class":345},"evlog",[288,454,349],{"class":309},[288,456,457],{"class":305},"{",[288,459,460],{"class":385}," drain",[288,462,463],{"class":305},":",[288,465,310],{"class":345},[288,467,468],{"class":309},"() ",[288,470,407],{"class":305},[288,472,473],{"class":309},"))\n",[278,475,476],{"className":280,"code":413,"filename":71,"language":283,"meta":284,"style":284},[262,477,478,496,500],{"__ignoreMap":284},[288,479,480,482,484,486,488,490,492,494],{"class":290,"line":291},[288,481,302],{"class":301},[288,483,306],{"class":305},[288,485,310],{"class":309},[288,487,313],{"class":305},[288,489,316],{"class":301},[288,491,319],{"class":305},[288,493,323],{"class":322},[288,495,326],{"class":305},[288,497,498],{"class":290,"line":298},[288,499,333],{"emptyLinePlaceholder":332},[288,501,502,504,506,508,510,512,514,516,518,520,522,524,526],{"class":290,"line":329},[288,503,442],{"class":309},[288,505,374],{"class":305},[288,507,447],{"class":345},[288,509,349],{"class":309},[288,511,452],{"class":345},[288,513,349],{"class":309},[288,515,457],{"class":305},[288,517,460],{"class":385},[288,519,463],{"class":305},[288,521,310],{"class":345},[288,523,468],{"class":309},[288,525,407],{"class":305},[288,527,473],{"class":309},[278,529,531],{"className":280,"code":530,"filename":81,"language":283,"meta":284,"style":284},"import { createAxiomDrain } from 'evlog\u002Faxiom'\n\nawait app.register(evlog, { drain: createAxiomDrain() })\n",[262,532,533,551,555],{"__ignoreMap":284},[288,534,535,537,539,541,543,545,547,549],{"class":290,"line":291},[288,536,302],{"class":301},[288,538,306],{"class":305},[288,540,310],{"class":309},[288,542,313],{"class":305},[288,544,316],{"class":301},[288,546,319],{"class":305},[288,548,323],{"class":322},[288,550,326],{"class":305},[288,552,553],{"class":290,"line":298},[288,554,333],{"emptyLinePlaceholder":332},[288,556,557,560,563,565,568,571,573,575,577,579,581,583,585],{"class":290,"line":329},[288,558,559],{"class":301},"await",[288,561,562],{"class":309}," app",[288,564,374],{"class":305},[288,566,567],{"class":345},"register",[288,569,570],{"class":309},"(evlog",[288,572,396],{"class":305},[288,574,306],{"class":305},[288,576,460],{"class":385},[288,578,463],{"class":305},[288,580,310],{"class":345},[288,582,468],{"class":309},[288,584,407],{"class":305},[288,586,410],{"class":309},[278,588,589],{"className":280,"code":413,"filename":86,"language":283,"meta":284,"style":284},[262,590,591,609,613],{"__ignoreMap":284},[288,592,593,595,597,599,601,603,605,607],{"class":290,"line":291},[288,594,302],{"class":301},[288,596,306],{"class":305},[288,598,310],{"class":309},[288,600,313],{"class":305},[288,602,316],{"class":301},[288,604,319],{"class":305},[288,606,323],{"class":322},[288,608,326],{"class":305},[288,610,611],{"class":290,"line":298},[288,612,333],{"emptyLinePlaceholder":332},[288,614,615,617,619,621,623,625,627,629,631,633,635,637,639],{"class":290,"line":329},[288,616,442],{"class":309},[288,618,374],{"class":305},[288,620,447],{"class":345},[288,622,349],{"class":309},[288,624,452],{"class":345},[288,626,349],{"class":309},[288,628,457],{"class":305},[288,630,460],{"class":385},[288,632,463],{"class":305},[288,634,310],{"class":345},[288,636,468],{"class":309},[288,638,407],{"class":305},[288,640,473],{"class":309},[278,642,644],{"className":280,"code":643,"filename":66,"language":283,"meta":284,"style":284},"import { createAxiomDrain } from 'evlog\u002Faxiom'\n\nEvlogModule.forRoot({ drain: createAxiomDrain() })\n",[262,645,646,664,668],{"__ignoreMap":284},[288,647,648,650,652,654,656,658,660,662],{"class":290,"line":291},[288,649,302],{"class":301},[288,651,306],{"class":305},[288,653,310],{"class":309},[288,655,313],{"class":305},[288,657,316],{"class":301},[288,659,319],{"class":305},[288,661,323],{"class":322},[288,663,326],{"class":305},[288,665,666],{"class":290,"line":298},[288,667,333],{"emptyLinePlaceholder":332},[288,669,670,673,675,678,680,682,684,686,688,690,692],{"class":290,"line":329},[288,671,672],{"class":309},"EvlogModule",[288,674,374],{"class":305},[288,676,677],{"class":345},"forRoot",[288,679,349],{"class":309},[288,681,457],{"class":305},[288,683,460],{"class":385},[288,685,463],{"class":305},[288,687,310],{"class":345},[288,689,468],{"class":309},[288,691,407],{"class":305},[288,693,410],{"class":309},[278,695,697],{"className":280,"code":696,"filename":96,"language":283,"meta":284,"style":284},"import { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({ drain: createAxiomDrain() })\n",[262,698,699,717,721],{"__ignoreMap":284},[288,700,701,703,705,707,709,711,713,715],{"class":290,"line":291},[288,702,302],{"class":301},[288,704,306],{"class":305},[288,706,310],{"class":309},[288,708,313],{"class":305},[288,710,316],{"class":301},[288,712,319],{"class":305},[288,714,323],{"class":322},[288,716,326],{"class":305},[288,718,719],{"class":290,"line":298},[288,720,333],{"emptyLinePlaceholder":332},[288,722,723,726,728,730,732,734,736,738,740],{"class":290,"line":329},[288,724,725],{"class":345},"initLogger",[288,727,349],{"class":309},[288,729,457],{"class":305},[288,731,460],{"class":385},[288,733,463],{"class":305},[288,735,310],{"class":345},[288,737,468],{"class":309},[288,739,407],{"class":305},[288,741,410],{"class":309},[743,744,747,750,751,754],"callout",{"color":745,"icon":746},"info","i-lucide-cloud",[267,748,749],{},"Serverless Support:"," On Cloudflare Workers and Vercel Edge, evlog automatically uses ",[262,752,753],{},"waitUntil()"," to ensure drains complete before the runtime terminates. No additional configuration needed.",[254,756,758],{"id":757},"available-adapters","Available Adapters",[760,761,762,766,769,772,775,778,781,784,787],"card-group",{},[763,764,765],"card",{"icon":177,"title":174,"to":175},"Send logs to Axiom for powerful querying and dashboards.",[763,767,768],{"icon":182,"title":179,"to":180},"OpenTelemetry Protocol for Grafana, Datadog, Honeycomb, and more.",[763,770,771],{"icon":187,"title":184,"to":185},"Send logs to PostHog Logs for structured logging and observability.",[763,773,774],{"icon":192,"title":189,"to":190},"Send structured logs to Sentry Logs for high-cardinality querying.",[763,776,777],{"icon":197,"title":194,"to":195},"Send logs to Better Stack for log management and alerting.",[763,779,780],{"icon":202,"title":199,"to":200},"Write logs to local NDJSON files for debugging and AI agent integration.",[763,782,783],{"icon":207,"title":226,"to":205},"Build your own adapter for any destination.",[763,785,786],{"icon":172,"title":169,"to":170},"Send browser logs to your server without framework coupling.",[763,788,789],{"icon":212,"title":209,"to":210},"Batch events, retry on failure, and handle buffer overflow.",[254,791,793],{"id":792},"standalone-usage","Standalone Usage",[250,795,796,797,800,801,803],{},"In plain TypeScript or Bun scripts (no HTTP framework), use the ",[262,798,799],{},"drain"," option in ",[262,802,725],{},". Every emitted event is drained automatically.",[278,805,808],{"className":280,"code":806,"filename":807,"language":283,"meta":284,"style":284},"import type { DrainContext } from 'evlog'\nimport { initLogger, log, createRequestLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>()\nconst drain = pipeline(createAxiomDrain())\n\ninitLogger({\n  env: { service: 'my-script' },\n  drain,\n})\n\nlog.info({ action: 'job_started' }) \u002F\u002F drained automatically\n\nconst reqLog = createRequestLogger({ method: 'POST', path: '\u002Fprocess' })\nreqLog.set({ processed: 42 })\nreqLog.emit() \u002F\u002F drained automatically\n\nawait drain.flush()\n","index.ts",[262,809,810,832,861,879,899,903,928,948,953,963,988,997,1004,1009,1043,1048,1094,1122,1136,1141],{"__ignoreMap":284},[288,811,812,814,817,819,822,824,826,828,830],{"class":290,"line":291},[288,813,302],{"class":301},[288,815,816],{"class":301}," type",[288,818,306],{"class":305},[288,820,821],{"class":309}," DrainContext",[288,823,313],{"class":305},[288,825,316],{"class":301},[288,827,319],{"class":305},[288,829,452],{"class":322},[288,831,326],{"class":305},[288,833,834,836,838,841,843,846,848,851,853,855,857,859],{"class":290,"line":298},[288,835,302],{"class":301},[288,837,306],{"class":305},[288,839,840],{"class":309}," initLogger",[288,842,396],{"class":305},[288,844,845],{"class":309}," log",[288,847,396],{"class":305},[288,849,850],{"class":309}," createRequestLogger",[288,852,313],{"class":305},[288,854,316],{"class":301},[288,856,319],{"class":305},[288,858,452],{"class":322},[288,860,326],{"class":305},[288,862,863,865,867,869,871,873,875,877],{"class":290,"line":329},[288,864,302],{"class":301},[288,866,306],{"class":305},[288,868,310],{"class":309},[288,870,313],{"class":305},[288,872,316],{"class":301},[288,874,319],{"class":305},[288,876,323],{"class":322},[288,878,326],{"class":305},[288,880,881,883,885,888,890,892,894,897],{"class":290,"line":336},[288,882,302],{"class":301},[288,884,306],{"class":305},[288,886,887],{"class":309}," createDrainPipeline",[288,889,313],{"class":305},[288,891,316],{"class":301},[288,893,319],{"class":305},[288,895,896],{"class":322},"evlog\u002Fpipeline",[288,898,326],{"class":305},[288,900,901],{"class":290,"line":368},[288,902,333],{"emptyLinePlaceholder":332},[288,904,905,908,911,914,916,919,922,925],{"class":290,"line":404},[288,906,907],{"class":361},"const",[288,909,910],{"class":309}," pipeline ",[288,912,913],{"class":305},"=",[288,915,887],{"class":345},[288,917,918],{"class":305},"\u003C",[288,920,264],{"class":921},"sBMFI",[288,923,924],{"class":305},">",[288,926,927],{"class":309},"()\n",[288,929,931,933,936,938,941,943,946],{"class":290,"line":930},7,[288,932,907],{"class":361},[288,934,935],{"class":309}," drain ",[288,937,913],{"class":305},[288,939,940],{"class":345}," pipeline",[288,942,349],{"class":309},[288,944,945],{"class":345},"createAxiomDrain",[288,947,401],{"class":309},[288,949,951],{"class":290,"line":950},8,[288,952,333],{"emptyLinePlaceholder":332},[288,954,956,958,960],{"class":290,"line":955},9,[288,957,725],{"class":345},[288,959,349],{"class":309},[288,961,962],{"class":305},"{\n",[288,964,966,969,971,973,976,978,980,983,985],{"class":290,"line":965},10,[288,967,968],{"class":385},"  env",[288,970,463],{"class":305},[288,972,306],{"class":305},[288,974,975],{"class":385}," service",[288,977,463],{"class":305},[288,979,319],{"class":305},[288,981,982],{"class":322},"my-script",[288,984,388],{"class":305},[288,986,987],{"class":305}," },\n",[288,989,991,994],{"class":290,"line":990},11,[288,992,993],{"class":309},"  drain",[288,995,996],{"class":305},",\n",[288,998,1000,1002],{"class":290,"line":999},12,[288,1001,407],{"class":305},[288,1003,410],{"class":309},[288,1005,1007],{"class":290,"line":1006},13,[288,1008,333],{"emptyLinePlaceholder":332},[288,1010,1012,1015,1017,1019,1021,1023,1026,1028,1030,1033,1035,1037,1040],{"class":290,"line":1011},14,[288,1013,1014],{"class":309},"log",[288,1016,374],{"class":305},[288,1018,745],{"class":345},[288,1020,349],{"class":309},[288,1022,457],{"class":305},[288,1024,1025],{"class":385}," action",[288,1027,463],{"class":305},[288,1029,319],{"class":305},[288,1031,1032],{"class":322},"job_started",[288,1034,388],{"class":305},[288,1036,313],{"class":305},[288,1038,1039],{"class":309},") ",[288,1041,1042],{"class":294},"\u002F\u002F drained automatically\n",[288,1044,1046],{"class":290,"line":1045},15,[288,1047,333],{"emptyLinePlaceholder":332},[288,1049,1051,1053,1056,1058,1060,1062,1064,1067,1069,1071,1074,1076,1078,1081,1083,1085,1088,1090,1092],{"class":290,"line":1050},16,[288,1052,907],{"class":361},[288,1054,1055],{"class":309}," reqLog ",[288,1057,913],{"class":305},[288,1059,850],{"class":345},[288,1061,349],{"class":309},[288,1063,457],{"class":305},[288,1065,1066],{"class":385}," method",[288,1068,463],{"class":305},[288,1070,319],{"class":305},[288,1072,1073],{"class":322},"POST",[288,1075,388],{"class":305},[288,1077,396],{"class":305},[288,1079,1080],{"class":385}," path",[288,1082,463],{"class":305},[288,1084,319],{"class":305},[288,1086,1087],{"class":322},"\u002Fprocess",[288,1089,388],{"class":305},[288,1091,313],{"class":305},[288,1093,410],{"class":309},[288,1095,1097,1100,1102,1105,1107,1109,1112,1114,1118,1120],{"class":290,"line":1096},17,[288,1098,1099],{"class":309},"reqLog",[288,1101,374],{"class":305},[288,1103,1104],{"class":345},"set",[288,1106,349],{"class":309},[288,1108,457],{"class":305},[288,1110,1111],{"class":385}," processed",[288,1113,463],{"class":305},[288,1115,1117],{"class":1116},"sbssI"," 42",[288,1119,313],{"class":305},[288,1121,410],{"class":309},[288,1123,1125,1127,1129,1132,1134],{"class":290,"line":1124},18,[288,1126,1099],{"class":309},[288,1128,374],{"class":305},[288,1130,1131],{"class":345},"emit",[288,1133,468],{"class":309},[288,1135,1042],{"class":294},[288,1137,1139],{"class":290,"line":1138},19,[288,1140,333],{"emptyLinePlaceholder":332},[288,1142,1144,1146,1148,1150,1153],{"class":290,"line":1143},20,[288,1145,559],{"class":301},[288,1147,460],{"class":309},[288,1149,374],{"class":305},[288,1151,1152],{"class":345},"flush",[288,1154,927],{"class":309},[743,1156,1159,1160,1167],{"color":1157,"icon":1158},"neutral","i-lucide-arrow-right","See the full ",[1161,1162,1166],"a",{"href":1163,"rel":1164},"https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Fbun-script",[1165],"nofollow","bun-script example"," for a realistic batch processing script.",[254,1169,1171],{"id":1170},"multiple-destinations","Multiple Destinations",[250,1173,1174],{},"Send logs to multiple services simultaneously by composing drains:",[278,1176,1178],{"className":280,"code":1177,"language":283,"meta":284,"style":284},"import { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createOTLPDrain } from 'evlog\u002Fotlp'\n\nconst axiom = createAxiomDrain()\nconst otlp = createOTLPDrain()\n\nconst drain = async (ctx) => {\n  await Promise.allSettled([axiom(ctx), otlp(ctx)])\n}\n",[262,1179,1180,1198,1218,1222,1235,1248,1252,1275,1312],{"__ignoreMap":284},[288,1181,1182,1184,1186,1188,1190,1192,1194,1196],{"class":290,"line":291},[288,1183,302],{"class":301},[288,1185,306],{"class":305},[288,1187,310],{"class":309},[288,1189,313],{"class":305},[288,1191,316],{"class":301},[288,1193,319],{"class":305},[288,1195,323],{"class":322},[288,1197,326],{"class":305},[288,1199,1200,1202,1204,1207,1209,1211,1213,1216],{"class":290,"line":298},[288,1201,302],{"class":301},[288,1203,306],{"class":305},[288,1205,1206],{"class":309}," createOTLPDrain",[288,1208,313],{"class":305},[288,1210,316],{"class":301},[288,1212,319],{"class":305},[288,1214,1215],{"class":322},"evlog\u002Fotlp",[288,1217,326],{"class":305},[288,1219,1220],{"class":290,"line":329},[288,1221,333],{"emptyLinePlaceholder":332},[288,1223,1224,1226,1229,1231,1233],{"class":290,"line":336},[288,1225,907],{"class":361},[288,1227,1228],{"class":309}," axiom ",[288,1230,913],{"class":305},[288,1232,310],{"class":345},[288,1234,927],{"class":309},[288,1236,1237,1239,1242,1244,1246],{"class":290,"line":368},[288,1238,907],{"class":361},[288,1240,1241],{"class":309}," otlp ",[288,1243,913],{"class":305},[288,1245,1206],{"class":345},[288,1247,927],{"class":309},[288,1249,1250],{"class":290,"line":404},[288,1251,333],{"emptyLinePlaceholder":332},[288,1253,1254,1256,1258,1260,1263,1266,1269,1271,1273],{"class":290,"line":930},[288,1255,907],{"class":361},[288,1257,935],{"class":309},[288,1259,913],{"class":305},[288,1261,1262],{"class":361}," async",[288,1264,1265],{"class":305}," (",[288,1267,1268],{"class":354},"ctx",[288,1270,358],{"class":305},[288,1272,362],{"class":361},[288,1274,365],{"class":305},[288,1276,1277,1280,1283,1285,1288,1291,1294,1296,1298,1300,1302,1305,1307,1309],{"class":290,"line":950},[288,1278,1279],{"class":301},"  await",[288,1281,1282],{"class":921}," Promise",[288,1284,374],{"class":305},[288,1286,1287],{"class":345},"allSettled",[288,1289,1290],{"class":385},"([",[288,1292,1293],{"class":345},"axiom",[288,1295,349],{"class":385},[288,1297,1268],{"class":309},[288,1299,358],{"class":385},[288,1301,396],{"class":305},[288,1303,1304],{"class":345}," otlp",[288,1306,349],{"class":385},[288,1308,1268],{"class":309},[288,1310,1311],{"class":385},")])\n",[288,1313,1314],{"class":290,"line":955},[288,1315,1316],{"class":305},"}\n",[250,1318,1319,1320,1322],{},"Then pass ",[262,1321,799],{}," to your framework:",[275,1324,1325,1386,1413,1439,1466,1492,1515],{},[278,1326,1328],{"className":280,"code":1327,"filename":282,"language":283,"meta":284,"style":284},"\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', drain)\n})\n",[262,1329,1330,1334,1354,1380],{"__ignoreMap":284},[288,1331,1332],{"class":290,"line":291},[288,1333,295],{"class":294},[288,1335,1336,1338,1340,1342,1344,1346,1348,1350,1352],{"class":290,"line":298},[288,1337,339],{"class":301},[288,1339,342],{"class":301},[288,1341,346],{"class":345},[288,1343,349],{"class":309},[288,1345,349],{"class":305},[288,1347,355],{"class":354},[288,1349,358],{"class":305},[288,1351,362],{"class":361},[288,1353,365],{"class":305},[288,1355,1356,1358,1360,1362,1364,1366,1368,1370,1372,1374,1376,1378],{"class":290,"line":329},[288,1357,371],{"class":309},[288,1359,374],{"class":305},[288,1361,377],{"class":309},[288,1363,374],{"class":305},[288,1365,382],{"class":345},[288,1367,349],{"class":385},[288,1369,388],{"class":305},[288,1371,391],{"class":322},[288,1373,388],{"class":305},[288,1375,396],{"class":305},[288,1377,460],{"class":309},[288,1379,410],{"class":385},[288,1381,1382,1384],{"class":290,"line":336},[288,1383,407],{"class":305},[288,1385,410],{"class":309},[278,1387,1389],{"className":280,"code":1388,"filename":76,"language":283,"meta":284,"style":284},"app.use(evlog({ drain }))\n",[262,1390,1391],{"__ignoreMap":284},[288,1392,1393,1395,1397,1399,1401,1403,1405,1407,1409,1411],{"class":290,"line":291},[288,1394,442],{"class":309},[288,1396,374],{"class":305},[288,1398,447],{"class":345},[288,1400,349],{"class":309},[288,1402,452],{"class":345},[288,1404,349],{"class":309},[288,1406,457],{"class":305},[288,1408,935],{"class":309},[288,1410,407],{"class":305},[288,1412,473],{"class":309},[278,1414,1415],{"className":280,"code":1388,"filename":71,"language":283,"meta":284,"style":284},[262,1416,1417],{"__ignoreMap":284},[288,1418,1419,1421,1423,1425,1427,1429,1431,1433,1435,1437],{"class":290,"line":291},[288,1420,442],{"class":309},[288,1422,374],{"class":305},[288,1424,447],{"class":345},[288,1426,349],{"class":309},[288,1428,452],{"class":345},[288,1430,349],{"class":309},[288,1432,457],{"class":305},[288,1434,935],{"class":309},[288,1436,407],{"class":305},[288,1438,473],{"class":309},[278,1440,1442],{"className":280,"code":1441,"filename":81,"language":283,"meta":284,"style":284},"await app.register(evlog, { drain })\n",[262,1443,1444],{"__ignoreMap":284},[288,1445,1446,1448,1450,1452,1454,1456,1458,1460,1462,1464],{"class":290,"line":291},[288,1447,559],{"class":301},[288,1449,562],{"class":309},[288,1451,374],{"class":305},[288,1453,567],{"class":345},[288,1455,570],{"class":309},[288,1457,396],{"class":305},[288,1459,306],{"class":305},[288,1461,935],{"class":309},[288,1463,407],{"class":305},[288,1465,410],{"class":309},[278,1467,1468],{"className":280,"code":1388,"filename":86,"language":283,"meta":284,"style":284},[262,1469,1470],{"__ignoreMap":284},[288,1471,1472,1474,1476,1478,1480,1482,1484,1486,1488,1490],{"class":290,"line":291},[288,1473,442],{"class":309},[288,1475,374],{"class":305},[288,1477,447],{"class":345},[288,1479,349],{"class":309},[288,1481,452],{"class":345},[288,1483,349],{"class":309},[288,1485,457],{"class":305},[288,1487,935],{"class":309},[288,1489,407],{"class":305},[288,1491,473],{"class":309},[278,1493,1495],{"className":280,"code":1494,"filename":66,"language":283,"meta":284,"style":284},"EvlogModule.forRoot({ drain })\n",[262,1496,1497],{"__ignoreMap":284},[288,1498,1499,1501,1503,1505,1507,1509,1511,1513],{"class":290,"line":291},[288,1500,672],{"class":309},[288,1502,374],{"class":305},[288,1504,677],{"class":345},[288,1506,349],{"class":309},[288,1508,457],{"class":305},[288,1510,935],{"class":309},[288,1512,407],{"class":305},[288,1514,410],{"class":309},[278,1516,1518],{"className":280,"code":1517,"filename":96,"language":283,"meta":284,"style":284},"initLogger({ drain })\n",[262,1519,1520],{"__ignoreMap":284},[288,1521,1522,1524,1526,1528,1530,1532],{"class":290,"line":291},[288,1523,725],{"class":345},[288,1525,349],{"class":309},[288,1527,457],{"class":305},[288,1529,935],{"class":309},[288,1531,407],{"class":305},[288,1533,410],{"class":309},[254,1535,1537],{"id":1536},"drain-context","Drain Context",[250,1539,1540,1541,1543],{},"Every adapter receives a ",[262,1542,264],{}," with:",[1545,1546,1547,1563],"table",{},[1548,1549,1550],"thead",{},[1551,1552,1553,1557,1560],"tr",{},[1554,1555,1556],"th",{},"Field",[1554,1558,1559],{},"Type",[1554,1561,1562],{},"Description",[1564,1565,1566,1582,1607],"tbody",{},[1551,1567,1568,1574,1579],{},[1569,1570,1571],"td",{},[262,1572,1573],{},"event",[1569,1575,1576],{},[262,1577,1578],{},"WideEvent",[1569,1580,1581],{},"The complete log event with all accumulated context",[1551,1583,1584,1589,1594],{},[1569,1585,1586],{},[262,1587,1588],{},"request",[1569,1590,1591],{},[262,1592,1593],{},"object",[1569,1595,1596,1597,1600,1601,1600,1604,358],{},"Request metadata (",[262,1598,1599],{},"method",", ",[262,1602,1603],{},"path",[262,1605,1606],{},"requestId",[1551,1608,1609,1614,1618],{},[1569,1610,1611],{},[262,1612,1613],{},"headers",[1569,1615,1616],{},[262,1617,1593],{},[1569,1619,1620],{},"Safe HTTP headers (sensitive headers are filtered)",[743,1622,1624,1627,1628,1600,1631,1600,1634,1637],{"color":1623,"icon":134},"success",[267,1625,1626],{},"Security:"," Sensitive headers (",[262,1629,1630],{},"authorization",[262,1632,1633],{},"cookie",[262,1635,1636],{},"x-api-key",", etc.) are automatically filtered and never passed to adapters.",[254,1639,1641],{"id":1640},"zero-config-setup","Zero-Config Setup",[250,1643,1644],{},"All adapters support automatic configuration via environment variables. No code changes needed when deploying to different environments.",[250,1646,1647,1648,1651],{},"Each adapter reads from ",[262,1649,1650],{},"NUXT_*"," prefixed variables (for Nuxt\u002FNitro runtimeConfig) and unprefixed fallbacks (for any framework):",[278,1653,1658],{"className":1654,"code":1655,"filename":1656,"language":1657,"meta":284,"style":284},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Axiom (NUXT_AXIOM_* or AXIOM_*)\nAXIOM_TOKEN=xaat-xxx\nAXIOM_DATASET=my-logs\n\n# OTLP (NUXT_OTLP_* or OTEL_*)\nOTLP_ENDPOINT=https:\u002F\u002Fotlp.example.com\n\n# PostHog (NUXT_POSTHOG_* or POSTHOG_*)\nPOSTHOG_API_KEY=phc_xxx\n\n# Sentry (NUXT_SENTRY_* or SENTRY_*)\nSENTRY_DSN=https:\u002F\u002Fkey@o0.ingest.sentry.io\u002F123\n\n# Better Stack (NUXT_BETTER_STACK_* or BETTER_STACK_*)\nBETTER_STACK_SOURCE_TOKEN=your-source-token\n",".env","bash",[262,1659,1660,1665,1675,1685,1689,1694,1704,1708,1713,1723,1727,1732,1742,1746,1751],{"__ignoreMap":284},[288,1661,1662],{"class":290,"line":291},[288,1663,1664],{"class":294},"# Axiom (NUXT_AXIOM_* or AXIOM_*)\n",[288,1666,1667,1670,1672],{"class":290,"line":298},[288,1668,1669],{"class":309},"AXIOM_TOKEN",[288,1671,913],{"class":305},[288,1673,1674],{"class":322},"xaat-xxx\n",[288,1676,1677,1680,1682],{"class":290,"line":329},[288,1678,1679],{"class":309},"AXIOM_DATASET",[288,1681,913],{"class":305},[288,1683,1684],{"class":322},"my-logs\n",[288,1686,1687],{"class":290,"line":336},[288,1688,333],{"emptyLinePlaceholder":332},[288,1690,1691],{"class":290,"line":368},[288,1692,1693],{"class":294},"# OTLP (NUXT_OTLP_* or OTEL_*)\n",[288,1695,1696,1699,1701],{"class":290,"line":404},[288,1697,1698],{"class":309},"OTLP_ENDPOINT",[288,1700,913],{"class":305},[288,1702,1703],{"class":322},"https:\u002F\u002Fotlp.example.com\n",[288,1705,1706],{"class":290,"line":930},[288,1707,333],{"emptyLinePlaceholder":332},[288,1709,1710],{"class":290,"line":950},[288,1711,1712],{"class":294},"# PostHog (NUXT_POSTHOG_* or POSTHOG_*)\n",[288,1714,1715,1718,1720],{"class":290,"line":955},[288,1716,1717],{"class":309},"POSTHOG_API_KEY",[288,1719,913],{"class":305},[288,1721,1722],{"class":322},"phc_xxx\n",[288,1724,1725],{"class":290,"line":965},[288,1726,333],{"emptyLinePlaceholder":332},[288,1728,1729],{"class":290,"line":990},[288,1730,1731],{"class":294},"# Sentry (NUXT_SENTRY_* or SENTRY_*)\n",[288,1733,1734,1737,1739],{"class":290,"line":999},[288,1735,1736],{"class":309},"SENTRY_DSN",[288,1738,913],{"class":305},[288,1740,1741],{"class":322},"https:\u002F\u002Fkey@o0.ingest.sentry.io\u002F123\n",[288,1743,1744],{"class":290,"line":1006},[288,1745,333],{"emptyLinePlaceholder":332},[288,1747,1748],{"class":290,"line":1011},[288,1749,1750],{"class":294},"# Better Stack (NUXT_BETTER_STACK_* or BETTER_STACK_*)\n",[288,1752,1753,1756,1758],{"class":290,"line":1045},[288,1754,1755],{"class":309},"BETTER_STACK_SOURCE_TOKEN",[288,1757,913],{"class":305},[288,1759,1760],{"class":322},"your-source-token\n",[250,1762,1763,1764,1767],{},"Adapters auto-read from these variables, so just call ",[262,1765,1766],{},"createXDrain()"," with no arguments.",[1769,1770,1771],"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 .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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":284,"searchDepth":298,"depth":298,"links":1773},[1774,1775,1776,1777,1778,1779],{"id":256,"depth":298,"text":257},{"id":757,"depth":298,"text":758},{"id":792,"depth":298,"text":793},{"id":1170,"depth":298,"text":1171},{"id":1536,"depth":298,"text":1537},{"id":1640,"depth":298,"text":1641},"Send your logs to external services with evlog adapters. Built-in support for popular observability platforms and custom destinations.","md",[1783,1785,1786,1787,1788,1789],{"label":174,"icon":177,"to":175,"color":1157,"variant":1784},"subtle",{"label":179,"icon":182,"to":180,"color":1157,"variant":1784},{"label":184,"icon":187,"to":185,"color":1157,"variant":1784},{"label":189,"icon":192,"to":190,"color":1157,"variant":1784},{"label":194,"icon":197,"to":195,"color":1157,"variant":1784},{"label":199,"icon":202,"to":200,"color":1157,"variant":1784},{},{"title":36,"icon":167},{"title":245,"description":1780},"dTqz3Pbvc06v4ATUU5et6eFaf60b8DsSpqNXevXnOQY",[1795,1797],{"title":155,"path":156,"stem":157,"description":1796,"icon":158,"children":-1},"Benchmark methodology, current numbers, and how evlog tracks performance regressions. Built for enterprise workloads with sub-microsecond overhead per request.",{"title":169,"path":170,"stem":171,"description":1798,"icon":172,"children":-1},"Framework-agnostic browser log transport for sending client-side logs to your server via fetch or sendBeacon. Works with any frontend stack.",1773505330317]