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