[{"data":1,"prerenderedAt":1451},["ShallowReactive",2],{"navigation_docs":3,"-adapters-better-stack":228,"-adapters-better-stack-surround":1446},[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":1431,"extension":1432,"links":1433,"meta":1442,"navigation":1443,"path":180,"seo":1444,"stem":181,"__hash__":1445},"docs\u002F4.adapters\u002F6.better-stack.md","Better Stack Adapter",{"type":232,"value":233,"toc":1408},"minimark",[234,244,248,251,294,297,302,327,331,350,354,803,806,810,813,847,851,903,907,914,983,987,990,1047,1051,1126,1130,1136,1159,1162,1166,1169,1209,1213,1217,1225,1228,1232,1238,1242,1245,1249,1252,1381,1385,1404],[235,236,237,243],"p",{},[238,239,179],"a",{"href":240,"rel":241},"https:\u002F\u002Fbetterstack.com",[242],"nofollow"," is a DX-first log management platform with powerful search, alerting, and dashboards. The evlog Better Stack adapter sends your wide events to the Better Stack HTTP ingestion API.",[245,246,15],"h2",{"id":247},"installation",[235,249,250],{},"The Better Stack adapter comes bundled with evlog:",[252,253,258],"pre",{"className":254,"code":255,"language":256,"meta":257,"style":257},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n","typescript","",[259,260,261],"code",{"__ignoreMap":257},[262,263,266,270,274,278,281,284,287,291],"span",{"class":264,"line":265},"line",1,[262,267,269],{"class":268},"s7zQu","import",[262,271,273],{"class":272},"sMK4o"," {",[262,275,277],{"class":276},"sTEyZ"," createBetterStackDrain",[262,279,280],{"class":272}," }",[262,282,283],{"class":268}," from",[262,285,286],{"class":272}," '",[262,288,290],{"class":289},"sfazB","evlog\u002Fbetter-stack",[262,292,293],{"class":272},"'\n",[245,295,20],{"id":296},"quick-start",[298,299,301],"h3",{"id":300},"_1-get-your-source-token","1. Get your source token",[303,304,305,313,321],"ol",{},[306,307,308,309],"li",{},"Create a ",[238,310,312],{"href":240,"rel":311},[242],"Better Stack account",[306,314,315,316,320],{},"Go to ",[317,318,319],"strong",{},"Telemetry > Sources"," and create a new source",[306,322,323,324],{},"Copy the ",[317,325,326],{},"Source Token",[298,328,330],{"id":329},"_2-set-environment-variables","2. Set environment variables",[252,332,337],{"className":333,"code":334,"filename":335,"language":336,"meta":257,"style":257},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","BETTER_STACK_SOURCE_TOKEN=your-source-token-here\n",".env","bash",[259,338,339],{"__ignoreMap":257},[262,340,341,344,347],{"class":264,"line":265},[262,342,343],{"class":276},"BETTER_STACK_SOURCE_TOKEN",[262,345,346],{"class":272},"=",[262,348,349],{"class":289},"your-source-token-here\n",[298,351,353],{"id":352},"_3-wire-the-drain-to-your-framework","3. Wire the drain to your framework",[355,356,357,472,535,589,648,702,755],"code-group",{},[252,358,361],{"className":254,"code":359,"filename":360,"language":256,"meta":257,"style":257},"\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nimport { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createBetterStackDrain())\n})\n","Nuxt \u002F Nitro",[259,362,363,369,388,395,427,463],{"__ignoreMap":257},[262,364,365],{"class":264,"line":265},[262,366,368],{"class":367},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[262,370,372,374,376,378,380,382,384,386],{"class":264,"line":371},2,[262,373,269],{"class":268},[262,375,273],{"class":272},[262,377,277],{"class":276},[262,379,280],{"class":272},[262,381,283],{"class":268},[262,383,286],{"class":272},[262,385,290],{"class":289},[262,387,293],{"class":272},[262,389,391],{"class":264,"line":390},3,[262,392,394],{"emptyLinePlaceholder":393},true,"\n",[262,396,398,401,404,408,411,413,417,420,424],{"class":264,"line":397},4,[262,399,400],{"class":268},"export",[262,402,403],{"class":268}," default",[262,405,407],{"class":406},"s2Zo4"," defineNitroPlugin",[262,409,410],{"class":276},"(",[262,412,410],{"class":272},[262,414,416],{"class":415},"sHdIc","nitroApp",[262,418,419],{"class":272},")",[262,421,423],{"class":422},"spNyl"," =>",[262,425,426],{"class":272}," {\n",[262,428,430,433,436,439,441,444,447,450,453,455,458,460],{"class":264,"line":429},5,[262,431,432],{"class":276},"  nitroApp",[262,434,435],{"class":272},".",[262,437,438],{"class":276},"hooks",[262,440,435],{"class":272},[262,442,443],{"class":406},"hook",[262,445,410],{"class":446},"swJcz",[262,448,449],{"class":272},"'",[262,451,452],{"class":289},"evlog:drain",[262,454,449],{"class":272},[262,456,457],{"class":272},",",[262,459,277],{"class":406},[262,461,462],{"class":446},"())\n",[262,464,466,469],{"class":264,"line":465},6,[262,467,468],{"class":272},"}",[262,470,471],{"class":276},")\n",[252,473,475],{"className":254,"code":474,"filename":76,"language":256,"meta":257,"style":257},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\napp.use(evlog({ drain: createBetterStackDrain() }))\n",[259,476,477,495,499],{"__ignoreMap":257},[262,478,479,481,483,485,487,489,491,493],{"class":264,"line":265},[262,480,269],{"class":268},[262,482,273],{"class":272},[262,484,277],{"class":276},[262,486,280],{"class":272},[262,488,283],{"class":268},[262,490,286],{"class":272},[262,492,290],{"class":289},[262,494,293],{"class":272},[262,496,497],{"class":264,"line":371},[262,498,394],{"emptyLinePlaceholder":393},[262,500,501,504,506,509,511,514,516,519,522,525,527,530,532],{"class":264,"line":390},[262,502,503],{"class":276},"app",[262,505,435],{"class":272},[262,507,508],{"class":406},"use",[262,510,410],{"class":276},[262,512,513],{"class":406},"evlog",[262,515,410],{"class":276},[262,517,518],{"class":272},"{",[262,520,521],{"class":446}," drain",[262,523,524],{"class":272},":",[262,526,277],{"class":406},[262,528,529],{"class":276},"() ",[262,531,468],{"class":272},[262,533,534],{"class":276},"))\n",[252,536,537],{"className":254,"code":474,"filename":71,"language":256,"meta":257,"style":257},[259,538,539,557,561],{"__ignoreMap":257},[262,540,541,543,545,547,549,551,553,555],{"class":264,"line":265},[262,542,269],{"class":268},[262,544,273],{"class":272},[262,546,277],{"class":276},[262,548,280],{"class":272},[262,550,283],{"class":268},[262,552,286],{"class":272},[262,554,290],{"class":289},[262,556,293],{"class":272},[262,558,559],{"class":264,"line":371},[262,560,394],{"emptyLinePlaceholder":393},[262,562,563,565,567,569,571,573,575,577,579,581,583,585,587],{"class":264,"line":390},[262,564,503],{"class":276},[262,566,435],{"class":272},[262,568,508],{"class":406},[262,570,410],{"class":276},[262,572,513],{"class":406},[262,574,410],{"class":276},[262,576,518],{"class":272},[262,578,521],{"class":446},[262,580,524],{"class":272},[262,582,277],{"class":406},[262,584,529],{"class":276},[262,586,468],{"class":272},[262,588,534],{"class":276},[252,590,592],{"className":254,"code":591,"filename":81,"language":256,"meta":257,"style":257},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\nawait app.register(evlog, { drain: createBetterStackDrain() })\n",[259,593,594,612,616],{"__ignoreMap":257},[262,595,596,598,600,602,604,606,608,610],{"class":264,"line":265},[262,597,269],{"class":268},[262,599,273],{"class":272},[262,601,277],{"class":276},[262,603,280],{"class":272},[262,605,283],{"class":268},[262,607,286],{"class":272},[262,609,290],{"class":289},[262,611,293],{"class":272},[262,613,614],{"class":264,"line":371},[262,615,394],{"emptyLinePlaceholder":393},[262,617,618,621,624,626,629,632,634,636,638,640,642,644,646],{"class":264,"line":390},[262,619,620],{"class":268},"await",[262,622,623],{"class":276}," app",[262,625,435],{"class":272},[262,627,628],{"class":406},"register",[262,630,631],{"class":276},"(evlog",[262,633,457],{"class":272},[262,635,273],{"class":272},[262,637,521],{"class":446},[262,639,524],{"class":272},[262,641,277],{"class":406},[262,643,529],{"class":276},[262,645,468],{"class":272},[262,647,471],{"class":276},[252,649,650],{"className":254,"code":474,"filename":86,"language":256,"meta":257,"style":257},[259,651,652,670,674],{"__ignoreMap":257},[262,653,654,656,658,660,662,664,666,668],{"class":264,"line":265},[262,655,269],{"class":268},[262,657,273],{"class":272},[262,659,277],{"class":276},[262,661,280],{"class":272},[262,663,283],{"class":268},[262,665,286],{"class":272},[262,667,290],{"class":289},[262,669,293],{"class":272},[262,671,672],{"class":264,"line":371},[262,673,394],{"emptyLinePlaceholder":393},[262,675,676,678,680,682,684,686,688,690,692,694,696,698,700],{"class":264,"line":390},[262,677,503],{"class":276},[262,679,435],{"class":272},[262,681,508],{"class":406},[262,683,410],{"class":276},[262,685,513],{"class":406},[262,687,410],{"class":276},[262,689,518],{"class":272},[262,691,521],{"class":446},[262,693,524],{"class":272},[262,695,277],{"class":406},[262,697,529],{"class":276},[262,699,468],{"class":272},[262,701,534],{"class":276},[252,703,705],{"className":254,"code":704,"filename":66,"language":256,"meta":257,"style":257},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\nEvlogModule.forRoot({ drain: createBetterStackDrain() })\n",[259,706,707,725,729],{"__ignoreMap":257},[262,708,709,711,713,715,717,719,721,723],{"class":264,"line":265},[262,710,269],{"class":268},[262,712,273],{"class":272},[262,714,277],{"class":276},[262,716,280],{"class":272},[262,718,283],{"class":268},[262,720,286],{"class":272},[262,722,290],{"class":289},[262,724,293],{"class":272},[262,726,727],{"class":264,"line":371},[262,728,394],{"emptyLinePlaceholder":393},[262,730,731,734,736,739,741,743,745,747,749,751,753],{"class":264,"line":390},[262,732,733],{"class":276},"EvlogModule",[262,735,435],{"class":272},[262,737,738],{"class":406},"forRoot",[262,740,410],{"class":276},[262,742,518],{"class":272},[262,744,521],{"class":446},[262,746,524],{"class":272},[262,748,277],{"class":406},[262,750,529],{"class":276},[262,752,468],{"class":272},[262,754,471],{"class":276},[252,756,758],{"className":254,"code":757,"filename":96,"language":256,"meta":257,"style":257},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\ninitLogger({ drain: createBetterStackDrain() })\n",[259,759,760,778,782],{"__ignoreMap":257},[262,761,762,764,766,768,770,772,774,776],{"class":264,"line":265},[262,763,269],{"class":268},[262,765,273],{"class":272},[262,767,277],{"class":276},[262,769,280],{"class":272},[262,771,283],{"class":268},[262,773,286],{"class":272},[262,775,290],{"class":289},[262,777,293],{"class":272},[262,779,780],{"class":264,"line":371},[262,781,394],{"emptyLinePlaceholder":393},[262,783,784,787,789,791,793,795,797,799,801],{"class":264,"line":390},[262,785,786],{"class":406},"initLogger",[262,788,410],{"class":276},[262,790,518],{"class":272},[262,792,521],{"class":446},[262,794,524],{"class":272},[262,796,277],{"class":406},[262,798,529],{"class":276},[262,800,468],{"class":272},[262,802,471],{"class":276},[235,804,805],{},"That's it! Your logs will now appear in Better Stack.",[245,807,809],{"id":808},"configuration","Configuration",[235,811,812],{},"The adapter reads configuration from multiple sources (highest priority first):",[303,814,815,824,834],{},[306,816,817,820,821],{},[317,818,819],{},"Overrides"," passed to ",[259,822,823],{},"createBetterStackDrain()",[306,825,826,829,830,833],{},[317,827,828],{},"Runtime config"," at ",[259,831,832],{},"runtimeConfig.betterStack"," (Nuxt\u002FNitro only)",[306,835,836,839,840,843,844,419],{},[317,837,838],{},"Environment variables"," (",[259,841,842],{},"BETTER_STACK_*"," or ",[259,845,846],{},"NUXT_BETTER_STACK_*",[298,848,850],{"id":849},"environment-variables","Environment Variables",[852,853,854,870],"table",{},[855,856,857],"thead",{},[858,859,860,864,867],"tr",{},[861,862,863],"th",{},"Variable",[861,865,866],{},"Nuxt alias",[861,868,869],{},"Description",[871,872,873,888],"tbody",{},[858,874,875,880,885],{},[876,877,878],"td",{},[259,879,343],{},[876,881,882],{},[259,883,884],{},"NUXT_BETTER_STACK_SOURCE_TOKEN",[876,886,887],{},"Better Stack source token (required)",[858,889,890,895,900],{},[876,891,892],{},[259,893,894],{},"BETTER_STACK_ENDPOINT",[876,896,897],{},[259,898,899],{},"NUXT_BETTER_STACK_ENDPOINT",[876,901,902],{},"Custom ingestion endpoint",[298,904,906],{"id":905},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[235,908,909,910,913],{},"Configure via ",[259,911,912],{},"nuxt.config.ts"," for type-safe configuration:",[252,915,917],{"className":254,"code":916,"filename":912,"language":256,"meta":257,"style":257},"export default defineNuxtConfig({\n  runtimeConfig: {\n    betterStack: {\n      sourceToken: '', \u002F\u002F Set via NUXT_BETTER_STACK_SOURCE_TOKEN\n    },\n  },\n})\n",[259,918,919,933,942,951,966,971,976],{"__ignoreMap":257},[262,920,921,923,925,928,930],{"class":264,"line":265},[262,922,400],{"class":268},[262,924,403],{"class":268},[262,926,927],{"class":406}," defineNuxtConfig",[262,929,410],{"class":276},[262,931,932],{"class":272},"{\n",[262,934,935,938,940],{"class":264,"line":371},[262,936,937],{"class":446},"  runtimeConfig",[262,939,524],{"class":272},[262,941,426],{"class":272},[262,943,944,947,949],{"class":264,"line":390},[262,945,946],{"class":446},"    betterStack",[262,948,524],{"class":272},[262,950,426],{"class":272},[262,952,953,956,958,961,963],{"class":264,"line":397},[262,954,955],{"class":446},"      sourceToken",[262,957,524],{"class":272},[262,959,960],{"class":272}," ''",[262,962,457],{"class":272},[262,964,965],{"class":367}," \u002F\u002F Set via NUXT_BETTER_STACK_SOURCE_TOKEN\n",[262,967,968],{"class":264,"line":429},[262,969,970],{"class":272},"    },\n",[262,972,973],{"class":264,"line":465},[262,974,975],{"class":272},"  },\n",[262,977,979,981],{"class":264,"line":978},7,[262,980,468],{"class":272},[262,982,471],{"class":276},[298,984,986],{"id":985},"override-options","Override Options",[235,988,989],{},"Pass options directly to override any configuration:",[252,991,993],{"className":254,"code":992,"language":256,"meta":257,"style":257},"const drain = createBetterStackDrain({\n  sourceToken: 'my-token',\n  timeout: 10000,\n})\n",[259,994,995,1011,1028,1041],{"__ignoreMap":257},[262,996,997,1000,1003,1005,1007,1009],{"class":264,"line":265},[262,998,999],{"class":422},"const",[262,1001,1002],{"class":276}," drain ",[262,1004,346],{"class":272},[262,1006,277],{"class":406},[262,1008,410],{"class":276},[262,1010,932],{"class":272},[262,1012,1013,1016,1018,1020,1023,1025],{"class":264,"line":371},[262,1014,1015],{"class":446},"  sourceToken",[262,1017,524],{"class":272},[262,1019,286],{"class":272},[262,1021,1022],{"class":289},"my-token",[262,1024,449],{"class":272},[262,1026,1027],{"class":272},",\n",[262,1029,1030,1033,1035,1039],{"class":264,"line":390},[262,1031,1032],{"class":446},"  timeout",[262,1034,524],{"class":272},[262,1036,1038],{"class":1037},"sbssI"," 10000",[262,1040,1027],{"class":272},[262,1042,1043,1045],{"class":264,"line":397},[262,1044,468],{"class":272},[262,1046,471],{"class":276},[298,1048,1050],{"id":1049},"full-configuration-reference","Full Configuration Reference",[852,1052,1053,1068],{},[855,1054,1055],{},[858,1056,1057,1060,1063,1066],{},[861,1058,1059],{},"Option",[861,1061,1062],{},"Type",[861,1064,1065],{},"Default",[861,1067,869],{},[871,1069,1070,1087,1106],{},[858,1071,1072,1077,1082,1085],{},[876,1073,1074],{},[259,1075,1076],{},"sourceToken",[876,1078,1079],{},[259,1080,1081],{},"string",[876,1083,1084],{},"-",[876,1086,887],{},[858,1088,1089,1094,1098,1103],{},[876,1090,1091],{},[259,1092,1093],{},"endpoint",[876,1095,1096],{},[259,1097,1081],{},[876,1099,1100],{},[259,1101,1102],{},"https:\u002F\u002Fin.logs.betterstack.com",[876,1104,1105],{},"Ingestion endpoint",[858,1107,1108,1113,1118,1123],{},[876,1109,1110],{},[259,1111,1112],{},"timeout",[876,1114,1115],{},[259,1116,1117],{},"number",[876,1119,1120],{},[259,1121,1122],{},"5000",[876,1124,1125],{},"Request timeout in milliseconds",[245,1127,1129],{"id":1128},"log-transformation","Log Transformation",[235,1131,1132,1133,524],{},"evlog wide events are transformed using ",[259,1134,1135],{},"toBetterStackEvent()",[1137,1138,1139,1153],"ul",{},[306,1140,1141,1144,1145,1148,1149,1152],{},[317,1142,1143],{},"Timestamp",": ",[259,1146,1147],{},"timestamp"," is mapped to ",[259,1150,1151],{},"dt"," (Better Stack's expected ISO-8601 timestamp field)",[306,1154,1155,1158],{},[317,1156,1157],{},"All other fields",": Spread as-is into the event body",[235,1160,1161],{},"Better Stack accepts arbitrary JSON fields, so all your wide event context (level, service, action, user data, etc.) is automatically searchable.",[245,1163,1165],{"id":1164},"querying-logs-in-better-stack","Querying Logs in Better Stack",[235,1167,1168],{},"Better Stack provides a powerful log search interface:",[1137,1170,1171,1177,1183,1197,1203],{},[306,1172,1173,1176],{},[317,1174,1175],{},"Live tail",": Stream logs in real time",[306,1178,1179,1182],{},[317,1180,1181],{},"Full-text search",": Search across all fields",[306,1184,1185,1188,1189,1192,1193,1196],{},[317,1186,1187],{},"Structured queries",": Filter by ",[259,1190,1191],{},"level:error",", ",[259,1194,1195],{},"service:my-app",", or any wide event field",[306,1198,1199,1202],{},[317,1200,1201],{},"Dashboards",": Create custom dashboards from your wide event data",[306,1204,1205,1208],{},[317,1206,1207],{},"Alerts",": Set up alerts based on log patterns or thresholds",[245,1210,1212],{"id":1211},"troubleshooting","Troubleshooting",[298,1214,1216],{"id":1215},"missing-source-token-error","Missing source token error",[252,1218,1223],{"className":1219,"code":1221,"language":1222},[1220],"language-text","[evlog\u002Fbetter-stack] Missing source token. Set BETTER_STACK_SOURCE_TOKEN env var or pass to createBetterStackDrain()\n","text",[259,1224,1221],{"__ignoreMap":257},[235,1226,1227],{},"Make sure your environment variable is set and the server was restarted after adding it.",[298,1229,1231],{"id":1230},"_401-unauthorized","401 Unauthorized",[235,1233,1234,1235,1237],{},"Your source token may be invalid or revoked. Generate a new source token in ",[317,1236,319],{}," in the Better Stack dashboard.",[298,1239,1241],{"id":1240},"_403-forbidden","403 Forbidden",[235,1243,1244],{},"The source may be archived or deleted. Create a new source in Better Stack.",[245,1246,1248],{"id":1247},"direct-api-usage","Direct API Usage",[235,1250,1251],{},"For advanced use cases, you can use the lower-level functions:",[252,1253,1256],{"className":254,"code":1254,"filename":1255,"language":256,"meta":257,"style":257},"import { sendToBetterStack, sendBatchToBetterStack } from 'evlog\u002Fbetter-stack'\n\n\u002F\u002F Send a single event\nawait sendToBetterStack(event, {\n  sourceToken: process.env.BETTER_STACK_SOURCE_TOKEN!,\n})\n\n\u002F\u002F Send multiple events in one request\nawait sendBatchToBetterStack(events, {\n  sourceToken: process.env.BETTER_STACK_SOURCE_TOKEN!,\n})\n","server\u002Futils\u002Fbetter-stack.ts",[259,1257,1258,1282,1286,1291,1304,1325,1331,1335,1341,1355,1374],{"__ignoreMap":257},[262,1259,1260,1262,1264,1267,1269,1272,1274,1276,1278,1280],{"class":264,"line":265},[262,1261,269],{"class":268},[262,1263,273],{"class":272},[262,1265,1266],{"class":276}," sendToBetterStack",[262,1268,457],{"class":272},[262,1270,1271],{"class":276}," sendBatchToBetterStack",[262,1273,280],{"class":272},[262,1275,283],{"class":268},[262,1277,286],{"class":272},[262,1279,290],{"class":289},[262,1281,293],{"class":272},[262,1283,1284],{"class":264,"line":371},[262,1285,394],{"emptyLinePlaceholder":393},[262,1287,1288],{"class":264,"line":390},[262,1289,1290],{"class":367},"\u002F\u002F Send a single event\n",[262,1292,1293,1295,1297,1300,1302],{"class":264,"line":397},[262,1294,620],{"class":268},[262,1296,1266],{"class":406},[262,1298,1299],{"class":276},"(event",[262,1301,457],{"class":272},[262,1303,426],{"class":272},[262,1305,1306,1308,1310,1313,1315,1318,1320,1322],{"class":264,"line":429},[262,1307,1015],{"class":446},[262,1309,524],{"class":272},[262,1311,1312],{"class":276}," process",[262,1314,435],{"class":272},[262,1316,1317],{"class":276},"env",[262,1319,435],{"class":272},[262,1321,343],{"class":276},[262,1323,1324],{"class":272},"!,\n",[262,1326,1327,1329],{"class":264,"line":465},[262,1328,468],{"class":272},[262,1330,471],{"class":276},[262,1332,1333],{"class":264,"line":978},[262,1334,394],{"emptyLinePlaceholder":393},[262,1336,1338],{"class":264,"line":1337},8,[262,1339,1340],{"class":367},"\u002F\u002F Send multiple events in one request\n",[262,1342,1344,1346,1348,1351,1353],{"class":264,"line":1343},9,[262,1345,620],{"class":268},[262,1347,1271],{"class":406},[262,1349,1350],{"class":276},"(events",[262,1352,457],{"class":272},[262,1354,426],{"class":272},[262,1356,1358,1360,1362,1364,1366,1368,1370,1372],{"class":264,"line":1357},10,[262,1359,1015],{"class":446},[262,1361,524],{"class":272},[262,1363,1312],{"class":276},[262,1365,435],{"class":272},[262,1367,1317],{"class":276},[262,1369,435],{"class":272},[262,1371,343],{"class":276},[262,1373,1324],{"class":272},[262,1375,1377,1379],{"class":264,"line":1376},11,[262,1378,468],{"class":272},[262,1380,471],{"class":276},[245,1382,1384],{"id":1383},"next-steps","Next Steps",[1137,1386,1387,1393,1399],{},[306,1388,1389,1392],{},[238,1390,1391],{"href":160},"Axiom Adapter"," - Send logs to Axiom for querying and dashboards",[306,1394,1395,1398],{},[238,1396,1397],{"href":165},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[306,1400,1401,1403],{},[238,1402,184],{"href":185}," - Build your own adapter",[1405,1406,1407],"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 .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .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 pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":257,"searchDepth":371,"depth":371,"links":1409},[1410,1411,1416,1422,1423,1424,1429,1430],{"id":247,"depth":371,"text":15},{"id":296,"depth":371,"text":20,"children":1412},[1413,1414,1415],{"id":300,"depth":390,"text":301},{"id":329,"depth":390,"text":330},{"id":352,"depth":390,"text":353},{"id":808,"depth":371,"text":809,"children":1417},[1418,1419,1420,1421],{"id":849,"depth":390,"text":850},{"id":905,"depth":390,"text":906},{"id":985,"depth":390,"text":986},{"id":1049,"depth":390,"text":1050},{"id":1128,"depth":371,"text":1129},{"id":1164,"depth":371,"text":1165},{"id":1211,"depth":371,"text":1212,"children":1425},[1426,1427,1428],{"id":1215,"depth":390,"text":1216},{"id":1230,"depth":390,"text":1231},{"id":1240,"depth":390,"text":1241},{"id":1247,"depth":371,"text":1248},{"id":1383,"depth":371,"text":1384},"Send wide events to Better Stack (formerly Logtail) for log management, alerting, and dashboards. Zero-config setup with environment variables.","md",[1434,1441],{"label":1435,"icon":1436,"to":1437,"target":1438,"color":1439,"variant":1440},"Better Stack Dashboard","i-lucide-external-link","https:\u002F\u002Flogs.betterstack.com","_blank","neutral","subtle",{"label":1391,"icon":162,"to":160,"color":1439,"variant":1440},{},{"title":179,"icon":182},{"title":230,"description":1431},"odZEsQE9Xtt3UVOAmaRcdfS3_8bbnmYQ5AwNAEaNU2s",[1447,1449],{"title":174,"path":175,"stem":176,"description":1448,"icon":177,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",{"title":184,"path":185,"stem":186,"description":1450,"icon":187,"children":-1},"Build your own adapter to send logs to any destination. Factory patterns, batching, filtering, and error handling best practices.",1773428030702]