[{"data":1,"prerenderedAt":2756},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-sveltekit":276,"-frameworks-sveltekit-surround":2751},[4,30,65,105,187,246,262],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Logging","\u002Flogging","2.logging",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":61,"path":62,"stem":63,"icon":64},"AI SDK Integration","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk","i-simple-icons-vercel",{"title":66,"path":67,"stem":68,"children":69,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[70,75,80,85,90,95,100],{"title":71,"path":72,"stem":73,"icon":74},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":76,"path":77,"stem":78,"icon":79},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":81,"path":82,"stem":83,"icon":84},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":86,"path":87,"stem":88,"icon":89},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":91,"path":92,"stem":93,"icon":94},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices","i-lucide-shield-check",{"title":96,"path":97,"stem":98,"icon":99},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance","i-lucide-gauge",{"title":101,"path":102,"stem":103,"icon":104},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Frameworks","\u002Fframeworks","4.frameworks",[110,114,119,124,129,134,139,144,149,154,159,164,168,173,177,182],{"title":36,"path":111,"stem":112,"icon":113},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":115,"path":116,"stem":117,"icon":118},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":120,"path":121,"stem":122,"icon":123},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":125,"path":126,"stem":127,"icon":128},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":130,"path":131,"stem":132,"icon":133},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":135,"path":136,"stem":137,"icon":138},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":140,"path":141,"stem":142,"icon":143},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":145,"path":146,"stem":147,"icon":148},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":150,"path":151,"stem":152,"icon":153},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":155,"path":156,"stem":157,"icon":158},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":160,"path":161,"stem":162,"icon":163},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":165,"path":166,"stem":167},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router",{"title":169,"path":170,"stem":171,"icon":172},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":174,"path":175,"stem":176,"icon":89},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":178,"path":179,"stem":180,"icon":181},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":183,"path":184,"stem":185,"icon":186},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F15.custom-integration","i-lucide-puzzle",{"title":188,"path":189,"stem":190,"children":191,"page":29},"Adapters","\u002Fadapters","5.adapters",[192,196,201,206,211,216,221,226,231,236,241],{"title":36,"path":193,"stem":194,"icon":195},"\u002Fadapters\u002Foverview","5.adapters\u002F1.overview","i-custom-plug",{"title":197,"path":198,"stem":199,"icon":200},"Pipeline","\u002Fadapters\u002Fpipeline","5.adapters\u002F10.pipeline","i-lucide-workflow",{"title":202,"path":203,"stem":204,"icon":205},"Browser","\u002Fadapters\u002Fbrowser","5.adapters\u002F11.browser","i-lucide-globe",{"title":207,"path":208,"stem":209,"icon":210},"Axiom","\u002Fadapters\u002Faxiom","5.adapters\u002F2.axiom","i-custom-axiom",{"title":212,"path":213,"stem":214,"icon":215},"OTLP","\u002Fadapters\u002Fotlp","5.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":217,"path":218,"stem":219,"icon":220},"PostHog","\u002Fadapters\u002Fposthog","5.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":222,"path":223,"stem":224,"icon":225},"Sentry","\u002Fadapters\u002Fsentry","5.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":227,"path":228,"stem":229,"icon":230},"Better Stack","\u002Fadapters\u002Fbetter-stack","5.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":232,"path":233,"stem":234,"icon":235},"File System","\u002Fadapters\u002Ffs","5.adapters\u002F7.fs","i-lucide-hard-drive",{"title":237,"path":238,"stem":239,"icon":240},"HyperDX","\u002Fadapters\u002Fhyperdx","5.adapters\u002F8.hyperdx","i-custom-hyperdx",{"title":242,"path":243,"stem":244,"icon":245},"Custom Adapters","\u002Fadapters\u002Fcustom","5.adapters\u002F9.custom","i-lucide-code",{"title":247,"path":248,"stem":249,"children":250,"page":29},"Enrichers","\u002Fenrichers","6.enrichers",[251,254,258],{"title":36,"path":252,"stem":253,"icon":28},"\u002Fenrichers\u002Foverview","6.enrichers\u002F1.overview",{"title":255,"path":256,"stem":257,"icon":186},"Built-in","\u002Fenrichers\u002Fbuilt-in","6.enrichers\u002F2.built-in",{"title":259,"path":260,"stem":261,"icon":245},"Custom","\u002Fenrichers\u002Fcustom","6.enrichers\u002F3.custom",{"title":263,"path":264,"stem":265,"children":266,"page":29},"NuxtHub","\u002Fnuxthub","7.nuxthub",[267,271],{"title":36,"path":268,"stem":269,"icon":270},"\u002Fnuxthub\u002Foverview","7.nuxthub\u002F1.overview","i-lucide-database",{"title":272,"path":273,"stem":274,"icon":275},"Retention","\u002Fnuxthub\u002Fretention","7.nuxthub\u002F2.retention","i-lucide-clock",{"id":277,"title":125,"body":278,"description":2741,"extension":2742,"links":2743,"meta":2747,"navigation":2748,"path":126,"seo":2749,"stem":127,"__hash__":2750},"docs\u002F4.frameworks\u002F03.sveltekit.md",{"type":279,"value":280,"toc":2722},"minimark",[281,305,386,390,395,416,420,590,598,602,660,664,764,767,770,1116,1119,1184,1187,1193,1374,1505,1520,1524,1545,1807,1810,1867,1870,1880,1884,1887,2081,2085,2092,2311,2323,2327,2333,2446,2450,2460,2613,2617,2657,2666,2676,2680,2687,2718],[282,283,284,285,289,290,293,294,297,298,293,301,304],"p",{},"The ",[286,287,288],"code",{},"evlog\u002Fsveltekit"," adapter provides ",[286,291,292],{},"handle"," and ",[286,295,296],{},"handleError"," hooks that auto-create a request-scoped logger accessible via ",[286,299,300],{},"event.locals.log",[286,302,303],{},"useLogger()",", emitting a wide event when the response completes.",[306,307,308],"code-collapse",{},[309,310,316],"pre",{"className":311,"code":312,"filename":313,"language":314,"meta":315,"style":315},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Set up evlog in my SvelteKit app.\n\n- Install evlog: pnpm add evlog\n- Add evlog\u002Fvite plugin to vite.config.ts with service name (handles auto-init, debug stripping)\n- Export handle and handleError from evlog\u002Fsveltekit in hooks.server.ts\n- Access the logger via event.locals.log or useLogger() in routes and services\n- Use log.set() to accumulate context, throw createError() for structured errors\n- Wide events are auto-emitted when each request completes\n\nDocs: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Fsveltekit\nAdapters: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\n","Prompt","txt","",[286,317,318,326,333,339,345,351,357,363,369,374,380],{"__ignoreMap":315},[319,320,323],"span",{"class":321,"line":322},"line",1,[319,324,325],{},"Set up evlog in my SvelteKit app.\n",[319,327,329],{"class":321,"line":328},2,[319,330,332],{"emptyLinePlaceholder":331},true,"\n",[319,334,336],{"class":321,"line":335},3,[319,337,338],{},"- Install evlog: pnpm add evlog\n",[319,340,342],{"class":321,"line":341},4,[319,343,344],{},"- Add evlog\u002Fvite plugin to vite.config.ts with service name (handles auto-init, debug stripping)\n",[319,346,348],{"class":321,"line":347},5,[319,349,350],{},"- Export handle and handleError from evlog\u002Fsveltekit in hooks.server.ts\n",[319,352,354],{"class":321,"line":353},6,[319,355,356],{},"- Access the logger via event.locals.log or useLogger() in routes and services\n",[319,358,360],{"class":321,"line":359},7,[319,361,362],{},"- Use log.set() to accumulate context, throw createError() for structured errors\n",[319,364,366],{"class":321,"line":365},8,[319,367,368],{},"- Wide events are auto-emitted when each request completes\n",[319,370,372],{"class":321,"line":371},9,[319,373,332],{"emptyLinePlaceholder":331},[319,375,377],{"class":321,"line":376},10,[319,378,379],{},"Docs: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Fsveltekit\n",[319,381,383],{"class":321,"line":382},11,[319,384,385],{},"Adapters: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\n",[387,388,20],"h2",{"id":389},"quick-start",[391,392,394],"h3",{"id":393},"_1-install","1. Install",[309,396,401],{"className":397,"code":398,"filename":399,"language":400,"meta":315,"style":315},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","bun add evlog\n","Terminal","bash",[286,402,403],{"__ignoreMap":315},[319,404,405,409,413],{"class":321,"line":322},[319,406,408],{"class":407},"sBMFI","bun",[319,410,412],{"class":411},"sfazB"," add",[319,414,415],{"class":411}," evlog\n",[391,417,419],{"id":418},"_2-add-the-vite-plugin","2. Add the Vite plugin",[309,421,426],{"className":422,"code":423,"filename":424,"language":425,"meta":315,"style":315},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { sveltekit } from '@sveltejs\u002Fkit\u002Fvite'\nimport evlog from 'evlog\u002Fvite'\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n  plugins: [\n    sveltekit(),\n    evlog({\n      service: 'my-api',\n    }),\n  ],\n})\n","vite.config.ts","typescript",[286,427,428,457,474,494,498,515,527,538,547,564,574,581],{"__ignoreMap":315},[319,429,430,434,438,442,445,448,451,454],{"class":321,"line":322},[319,431,433],{"class":432},"s7zQu","import",[319,435,437],{"class":436},"sMK4o"," {",[319,439,441],{"class":440},"sTEyZ"," sveltekit",[319,443,444],{"class":436}," }",[319,446,447],{"class":432}," from",[319,449,450],{"class":436}," '",[319,452,453],{"class":411},"@sveltejs\u002Fkit\u002Fvite",[319,455,456],{"class":436},"'\n",[319,458,459,461,464,467,469,472],{"class":321,"line":328},[319,460,433],{"class":432},[319,462,463],{"class":440}," evlog ",[319,465,466],{"class":432},"from",[319,468,450],{"class":436},[319,470,471],{"class":411},"evlog\u002Fvite",[319,473,456],{"class":436},[319,475,476,478,480,483,485,487,489,492],{"class":321,"line":335},[319,477,433],{"class":432},[319,479,437],{"class":436},[319,481,482],{"class":440}," defineConfig",[319,484,444],{"class":436},[319,486,447],{"class":432},[319,488,450],{"class":436},[319,490,491],{"class":411},"vite",[319,493,456],{"class":436},[319,495,496],{"class":321,"line":341},[319,497,332],{"emptyLinePlaceholder":331},[319,499,500,503,506,509,512],{"class":321,"line":347},[319,501,502],{"class":432},"export",[319,504,505],{"class":432}," default",[319,507,482],{"class":508},"s2Zo4",[319,510,511],{"class":440},"(",[319,513,514],{"class":436},"{\n",[319,516,517,521,524],{"class":321,"line":353},[319,518,520],{"class":519},"swJcz","  plugins",[319,522,523],{"class":436},":",[319,525,526],{"class":440}," [\n",[319,528,529,532,535],{"class":321,"line":359},[319,530,531],{"class":508},"    sveltekit",[319,533,534],{"class":440},"()",[319,536,537],{"class":436},",\n",[319,539,540,543,545],{"class":321,"line":365},[319,541,542],{"class":508},"    evlog",[319,544,511],{"class":440},[319,546,514],{"class":436},[319,548,549,552,554,556,559,562],{"class":321,"line":371},[319,550,551],{"class":519},"      service",[319,553,523],{"class":436},[319,555,450],{"class":436},[319,557,558],{"class":411},"my-api",[319,560,561],{"class":436},"'",[319,563,537],{"class":436},[319,565,566,569,572],{"class":321,"line":376},[319,567,568],{"class":436},"    }",[319,570,571],{"class":440},")",[319,573,537],{"class":436},[319,575,576,579],{"class":321,"line":382},[319,577,578],{"class":440},"  ]",[319,580,537],{"class":436},[319,582,584,587],{"class":321,"line":583},12,[319,585,586],{"class":436},"}",[319,588,589],{"class":440},")\n",[282,591,592,593,597],{},"See the ",[594,595,596],"a",{"href":102},"Vite Plugin docs"," for all options.",[391,599,601],{"id":600},"_3-create-hooks","3. Create hooks",[309,603,606],{"className":422,"code":604,"filename":605,"language":425,"meta":315,"style":315},"import { createEvlogHooks } from 'evlog\u002Fsveltekit'\n\nexport const { handle, handleError } = createEvlogHooks()\n","src\u002Fhooks.server.ts",[286,607,608,627,631],{"__ignoreMap":315},[319,609,610,612,614,617,619,621,623,625],{"class":321,"line":322},[319,611,433],{"class":432},[319,613,437],{"class":436},[319,615,616],{"class":440}," createEvlogHooks",[319,618,444],{"class":436},[319,620,447],{"class":432},[319,622,450],{"class":436},[319,624,288],{"class":411},[319,626,456],{"class":436},[319,628,629],{"class":321,"line":328},[319,630,332],{"emptyLinePlaceholder":331},[319,632,633,635,639,641,644,647,650,652,655,657],{"class":321,"line":335},[319,634,502],{"class":432},[319,636,638],{"class":637},"spNyl"," const",[319,640,437],{"class":436},[319,642,643],{"class":440}," handle",[319,645,646],{"class":436},",",[319,648,649],{"class":440}," handleError ",[319,651,586],{"class":436},[319,653,654],{"class":436}," =",[319,656,616],{"class":508},[319,658,659],{"class":440},"()\n",[391,661,663],{"id":662},"_4-type-your-locals","4. Type your locals",[309,665,668],{"className":422,"code":666,"filename":667,"language":425,"meta":315,"style":315},"import type { RequestLogger } from 'evlog'\n\ndeclare global {\n  namespace App {\n    interface Locals {\n      log: RequestLogger\n    }\n  }\n}\n\nexport {}\n","src\u002Fapp.d.ts",[286,669,670,693,697,707,718,728,738,743,748,753,757],{"__ignoreMap":315},[319,671,672,674,677,679,682,684,686,688,691],{"class":321,"line":322},[319,673,433],{"class":432},[319,675,676],{"class":432}," type",[319,678,437],{"class":436},[319,680,681],{"class":440}," RequestLogger",[319,683,444],{"class":436},[319,685,447],{"class":432},[319,687,450],{"class":436},[319,689,690],{"class":411},"evlog",[319,692,456],{"class":436},[319,694,695],{"class":321,"line":328},[319,696,332],{"emptyLinePlaceholder":331},[319,698,699,702,705],{"class":321,"line":335},[319,700,701],{"class":637},"declare",[319,703,704],{"class":440}," global ",[319,706,514],{"class":436},[319,708,709,712,715],{"class":321,"line":341},[319,710,711],{"class":637},"  namespace",[319,713,714],{"class":407}," App",[319,716,717],{"class":436}," {\n",[319,719,720,723,726],{"class":321,"line":347},[319,721,722],{"class":637},"    interface",[319,724,725],{"class":407}," Locals",[319,727,717],{"class":436},[319,729,730,733,735],{"class":321,"line":353},[319,731,732],{"class":519},"      log",[319,734,523],{"class":436},[319,736,737],{"class":407}," RequestLogger\n",[319,739,740],{"class":321,"line":359},[319,741,742],{"class":436},"    }\n",[319,744,745],{"class":321,"line":365},[319,746,747],{"class":436},"  }\n",[319,749,750],{"class":321,"line":371},[319,751,752],{"class":436},"}\n",[319,754,755],{"class":321,"line":376},[319,756,332],{"emptyLinePlaceholder":331},[319,758,759,761],{"class":321,"line":382},[319,760,502],{"class":432},[319,762,763],{"class":436}," {}\n",[387,765,46],{"id":766},"wide-events",[282,768,769],{},"Build up context progressively through your handler. One request = one wide event:",[309,771,774],{"className":422,"code":772,"filename":773,"language":425,"meta":315,"style":315},"import { json } from '@sveltejs\u002Fkit'\nimport type { RequestHandler } from '.\u002F$types'\n\nexport const GET: RequestHandler = async ({ locals, params }) => {\n  locals.log.set({ user: { id: params.id } })\n\n  const user = await db.findUser(params.id)\n  locals.log.set({ user: { name: user.name, plan: user.plan } })\n\n  const orders = await db.findOrders(params.id)\n  locals.log.set({ orders: { count: orders.length, totalRevenue: sum(orders) } })\n\n  return json({ user, orders })\n}\n","src\u002Froutes\u002Fapi\u002Fusers\u002F[id]\u002F+server.ts",[286,775,776,796,818,822,860,906,910,941,995,999,1027,1085,1089,1111],{"__ignoreMap":315},[319,777,778,780,782,785,787,789,791,794],{"class":321,"line":322},[319,779,433],{"class":432},[319,781,437],{"class":436},[319,783,784],{"class":440}," json",[319,786,444],{"class":436},[319,788,447],{"class":432},[319,790,450],{"class":436},[319,792,793],{"class":411},"@sveltejs\u002Fkit",[319,795,456],{"class":436},[319,797,798,800,802,804,807,809,811,813,816],{"class":321,"line":328},[319,799,433],{"class":432},[319,801,676],{"class":432},[319,803,437],{"class":436},[319,805,806],{"class":440}," RequestHandler",[319,808,444],{"class":436},[319,810,447],{"class":432},[319,812,450],{"class":436},[319,814,815],{"class":411},".\u002F$types",[319,817,456],{"class":436},[319,819,820],{"class":321,"line":335},[319,821,332],{"emptyLinePlaceholder":331},[319,823,824,826,828,831,833,835,837,840,843,847,849,852,855,858],{"class":321,"line":341},[319,825,502],{"class":432},[319,827,638],{"class":637},[319,829,830],{"class":440}," GET",[319,832,523],{"class":436},[319,834,806],{"class":407},[319,836,654],{"class":436},[319,838,839],{"class":637}," async",[319,841,842],{"class":436}," ({",[319,844,846],{"class":845},"sHdIc"," locals",[319,848,646],{"class":436},[319,850,851],{"class":845}," params",[319,853,854],{"class":436}," })",[319,856,857],{"class":637}," =>",[319,859,717],{"class":436},[319,861,862,865,868,871,873,876,878,881,884,886,888,891,893,895,897,900,902,904],{"class":321,"line":347},[319,863,864],{"class":440},"  locals",[319,866,867],{"class":436},".",[319,869,870],{"class":440},"log",[319,872,867],{"class":436},[319,874,875],{"class":508},"set",[319,877,511],{"class":519},[319,879,880],{"class":436},"{",[319,882,883],{"class":519}," user",[319,885,523],{"class":436},[319,887,437],{"class":436},[319,889,890],{"class":519}," id",[319,892,523],{"class":436},[319,894,851],{"class":440},[319,896,867],{"class":436},[319,898,899],{"class":440},"id",[319,901,444],{"class":436},[319,903,444],{"class":436},[319,905,589],{"class":519},[319,907,908],{"class":321,"line":353},[319,909,332],{"emptyLinePlaceholder":331},[319,911,912,915,917,919,922,925,927,930,932,935,937,939],{"class":321,"line":359},[319,913,914],{"class":637},"  const",[319,916,883],{"class":440},[319,918,654],{"class":436},[319,920,921],{"class":432}," await",[319,923,924],{"class":440}," db",[319,926,867],{"class":436},[319,928,929],{"class":508},"findUser",[319,931,511],{"class":519},[319,933,934],{"class":440},"params",[319,936,867],{"class":436},[319,938,899],{"class":440},[319,940,589],{"class":519},[319,942,943,945,947,949,951,953,955,957,959,961,963,966,968,970,972,975,977,980,982,984,986,989,991,993],{"class":321,"line":365},[319,944,864],{"class":440},[319,946,867],{"class":436},[319,948,870],{"class":440},[319,950,867],{"class":436},[319,952,875],{"class":508},[319,954,511],{"class":519},[319,956,880],{"class":436},[319,958,883],{"class":519},[319,960,523],{"class":436},[319,962,437],{"class":436},[319,964,965],{"class":519}," name",[319,967,523],{"class":436},[319,969,883],{"class":440},[319,971,867],{"class":436},[319,973,974],{"class":440},"name",[319,976,646],{"class":436},[319,978,979],{"class":519}," plan",[319,981,523],{"class":436},[319,983,883],{"class":440},[319,985,867],{"class":436},[319,987,988],{"class":440},"plan",[319,990,444],{"class":436},[319,992,444],{"class":436},[319,994,589],{"class":519},[319,996,997],{"class":321,"line":371},[319,998,332],{"emptyLinePlaceholder":331},[319,1000,1001,1003,1006,1008,1010,1012,1014,1017,1019,1021,1023,1025],{"class":321,"line":376},[319,1002,914],{"class":637},[319,1004,1005],{"class":440}," orders",[319,1007,654],{"class":436},[319,1009,921],{"class":432},[319,1011,924],{"class":440},[319,1013,867],{"class":436},[319,1015,1016],{"class":508},"findOrders",[319,1018,511],{"class":519},[319,1020,934],{"class":440},[319,1022,867],{"class":436},[319,1024,899],{"class":440},[319,1026,589],{"class":519},[319,1028,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047,1049,1052,1054,1056,1058,1061,1063,1066,1068,1071,1073,1076,1079,1081,1083],{"class":321,"line":382},[319,1030,864],{"class":440},[319,1032,867],{"class":436},[319,1034,870],{"class":440},[319,1036,867],{"class":436},[319,1038,875],{"class":508},[319,1040,511],{"class":519},[319,1042,880],{"class":436},[319,1044,1005],{"class":519},[319,1046,523],{"class":436},[319,1048,437],{"class":436},[319,1050,1051],{"class":519}," count",[319,1053,523],{"class":436},[319,1055,1005],{"class":440},[319,1057,867],{"class":436},[319,1059,1060],{"class":440},"length",[319,1062,646],{"class":436},[319,1064,1065],{"class":519}," totalRevenue",[319,1067,523],{"class":436},[319,1069,1070],{"class":508}," sum",[319,1072,511],{"class":519},[319,1074,1075],{"class":440},"orders",[319,1077,1078],{"class":519},") ",[319,1080,586],{"class":436},[319,1082,444],{"class":436},[319,1084,589],{"class":519},[319,1086,1087],{"class":321,"line":583},[319,1088,332],{"emptyLinePlaceholder":331},[319,1090,1092,1095,1097,1099,1101,1103,1105,1107,1109],{"class":321,"line":1091},13,[319,1093,1094],{"class":432},"  return",[319,1096,784],{"class":508},[319,1098,511],{"class":519},[319,1100,880],{"class":436},[319,1102,883],{"class":440},[319,1104,646],{"class":436},[319,1106,1005],{"class":440},[319,1108,444],{"class":436},[319,1110,589],{"class":519},[319,1112,1114],{"class":321,"line":1113},14,[319,1115,752],{"class":436},[282,1117,1118],{},"All fields are merged into a single wide event emitted when the request completes:",[309,1120,1123],{"className":397,"code":1121,"filename":1122,"language":400,"meta":315,"style":315},"14:58:15 INFO [my-api] GET \u002Fapi\u002Fusers\u002Fusr_123 200 in 12ms\n  ├─ orders: count=2 totalRevenue=6298\n  ├─ user: id=usr_123 name=Alice plan=pro\n  └─ requestId: 4a8ff3a8-...\n","Terminal output",[286,1124,1125,1136,1157,1173],{"__ignoreMap":315},[319,1126,1127,1130,1133],{"class":321,"line":322},[319,1128,1129],{"class":407},"14:58:15",[319,1131,1132],{"class":411}," INFO",[319,1134,1135],{"class":440}," [my-api] GET \u002Fapi\u002Fusers\u002Fusr_123 200 in 12ms\n",[319,1137,1138,1141,1144,1147,1151,1154],{"class":321,"line":328},[319,1139,1140],{"class":407},"  ├─",[319,1142,1143],{"class":411}," orders:",[319,1145,1146],{"class":411}," count=",[319,1148,1150],{"class":1149},"sbssI","2",[319,1152,1153],{"class":411}," totalRevenue=",[319,1155,1156],{"class":1149},"6298\n",[319,1158,1159,1161,1164,1167,1170],{"class":321,"line":335},[319,1160,1140],{"class":407},[319,1162,1163],{"class":411}," user:",[319,1165,1166],{"class":411}," id=usr_123",[319,1168,1169],{"class":411}," name=Alice",[319,1171,1172],{"class":411}," plan=pro\n",[319,1174,1175,1178,1181],{"class":321,"line":341},[319,1176,1177],{"class":407},"  └─",[319,1179,1180],{"class":411}," requestId:",[319,1182,1183],{"class":411}," 4a8ff3a8-...\n",[387,1185,303],{"id":1186},"uselogger",[282,1188,1189,1190,1192],{},"Use ",[286,1191,303],{}," to access the request-scoped logger from anywhere in the call stack without passing locals through your service layer:",[309,1194,1197],{"className":422,"code":1195,"filename":1196,"language":425,"meta":315,"style":315},"import { useLogger } from 'evlog\u002Fsveltekit'\n\nexport async function findUser(id: string) {\n  const log = useLogger()\n  log.set({ user: { id } })\n\n  const user = await db.findUser(id)\n  log.set({ user: { name: user.name, plan: user.plan } })\n\n  return user\n}\n","src\u002Flib\u002Fservices\u002Fuser.ts",[286,1198,1199,1218,1222,1247,1260,1287,1291,1313,1359,1363,1370],{"__ignoreMap":315},[319,1200,1201,1203,1205,1208,1210,1212,1214,1216],{"class":321,"line":322},[319,1202,433],{"class":432},[319,1204,437],{"class":436},[319,1206,1207],{"class":440}," useLogger",[319,1209,444],{"class":436},[319,1211,447],{"class":432},[319,1213,450],{"class":436},[319,1215,288],{"class":411},[319,1217,456],{"class":436},[319,1219,1220],{"class":321,"line":328},[319,1221,332],{"emptyLinePlaceholder":331},[319,1223,1224,1226,1228,1231,1234,1236,1238,1240,1243,1245],{"class":321,"line":335},[319,1225,502],{"class":432},[319,1227,839],{"class":637},[319,1229,1230],{"class":637}," function",[319,1232,1233],{"class":508}," findUser",[319,1235,511],{"class":436},[319,1237,899],{"class":845},[319,1239,523],{"class":436},[319,1241,1242],{"class":407}," string",[319,1244,571],{"class":436},[319,1246,717],{"class":436},[319,1248,1249,1251,1254,1256,1258],{"class":321,"line":341},[319,1250,914],{"class":637},[319,1252,1253],{"class":440}," log",[319,1255,654],{"class":436},[319,1257,1207],{"class":508},[319,1259,659],{"class":519},[319,1261,1262,1265,1267,1269,1271,1273,1275,1277,1279,1281,1283,1285],{"class":321,"line":347},[319,1263,1264],{"class":440},"  log",[319,1266,867],{"class":436},[319,1268,875],{"class":508},[319,1270,511],{"class":519},[319,1272,880],{"class":436},[319,1274,883],{"class":519},[319,1276,523],{"class":436},[319,1278,437],{"class":436},[319,1280,890],{"class":440},[319,1282,444],{"class":436},[319,1284,444],{"class":436},[319,1286,589],{"class":519},[319,1288,1289],{"class":321,"line":353},[319,1290,332],{"emptyLinePlaceholder":331},[319,1292,1293,1295,1297,1299,1301,1303,1305,1307,1309,1311],{"class":321,"line":359},[319,1294,914],{"class":637},[319,1296,883],{"class":440},[319,1298,654],{"class":436},[319,1300,921],{"class":432},[319,1302,924],{"class":440},[319,1304,867],{"class":436},[319,1306,929],{"class":508},[319,1308,511],{"class":519},[319,1310,899],{"class":440},[319,1312,589],{"class":519},[319,1314,1315,1317,1319,1321,1323,1325,1327,1329,1331,1333,1335,1337,1339,1341,1343,1345,1347,1349,1351,1353,1355,1357],{"class":321,"line":365},[319,1316,1264],{"class":440},[319,1318,867],{"class":436},[319,1320,875],{"class":508},[319,1322,511],{"class":519},[319,1324,880],{"class":436},[319,1326,883],{"class":519},[319,1328,523],{"class":436},[319,1330,437],{"class":436},[319,1332,965],{"class":519},[319,1334,523],{"class":436},[319,1336,883],{"class":440},[319,1338,867],{"class":436},[319,1340,974],{"class":440},[319,1342,646],{"class":436},[319,1344,979],{"class":519},[319,1346,523],{"class":436},[319,1348,883],{"class":440},[319,1350,867],{"class":436},[319,1352,988],{"class":440},[319,1354,444],{"class":436},[319,1356,444],{"class":436},[319,1358,589],{"class":519},[319,1360,1361],{"class":321,"line":371},[319,1362,332],{"emptyLinePlaceholder":331},[319,1364,1365,1367],{"class":321,"line":376},[319,1366,1094],{"class":432},[319,1368,1369],{"class":440}," user\n",[319,1371,1372],{"class":321,"line":382},[319,1373,752],{"class":436},[309,1375,1377],{"className":422,"code":1376,"filename":773,"language":425,"meta":315,"style":315},"import { json } from '@sveltejs\u002Fkit'\nimport { findUser } from '$lib\u002Fservices\u002Fuser'\nimport type { RequestHandler } from '.\u002F$types'\n\nexport const GET: RequestHandler = async ({ params }) => {\n  const user = await findUser(params.id)\n  return json(user)\n}\n",[286,1378,1379,1397,1416,1436,1440,1466,1488,1501],{"__ignoreMap":315},[319,1380,1381,1383,1385,1387,1389,1391,1393,1395],{"class":321,"line":322},[319,1382,433],{"class":432},[319,1384,437],{"class":436},[319,1386,784],{"class":440},[319,1388,444],{"class":436},[319,1390,447],{"class":432},[319,1392,450],{"class":436},[319,1394,793],{"class":411},[319,1396,456],{"class":436},[319,1398,1399,1401,1403,1405,1407,1409,1411,1414],{"class":321,"line":328},[319,1400,433],{"class":432},[319,1402,437],{"class":436},[319,1404,1233],{"class":440},[319,1406,444],{"class":436},[319,1408,447],{"class":432},[319,1410,450],{"class":436},[319,1412,1413],{"class":411},"$lib\u002Fservices\u002Fuser",[319,1415,456],{"class":436},[319,1417,1418,1420,1422,1424,1426,1428,1430,1432,1434],{"class":321,"line":335},[319,1419,433],{"class":432},[319,1421,676],{"class":432},[319,1423,437],{"class":436},[319,1425,806],{"class":440},[319,1427,444],{"class":436},[319,1429,447],{"class":432},[319,1431,450],{"class":436},[319,1433,815],{"class":411},[319,1435,456],{"class":436},[319,1437,1438],{"class":321,"line":341},[319,1439,332],{"emptyLinePlaceholder":331},[319,1441,1442,1444,1446,1448,1450,1452,1454,1456,1458,1460,1462,1464],{"class":321,"line":347},[319,1443,502],{"class":432},[319,1445,638],{"class":637},[319,1447,830],{"class":440},[319,1449,523],{"class":436},[319,1451,806],{"class":407},[319,1453,654],{"class":436},[319,1455,839],{"class":637},[319,1457,842],{"class":436},[319,1459,851],{"class":845},[319,1461,854],{"class":436},[319,1463,857],{"class":637},[319,1465,717],{"class":436},[319,1467,1468,1470,1472,1474,1476,1478,1480,1482,1484,1486],{"class":321,"line":353},[319,1469,914],{"class":637},[319,1471,883],{"class":440},[319,1473,654],{"class":436},[319,1475,921],{"class":432},[319,1477,1233],{"class":508},[319,1479,511],{"class":519},[319,1481,934],{"class":440},[319,1483,867],{"class":436},[319,1485,899],{"class":440},[319,1487,589],{"class":519},[319,1489,1490,1492,1494,1496,1499],{"class":321,"line":359},[319,1491,1094],{"class":432},[319,1493,784],{"class":508},[319,1495,511],{"class":519},[319,1497,1498],{"class":440},"user",[319,1500,589],{"class":519},[319,1502,1503],{"class":321,"line":365},[319,1504,752],{"class":436},[282,1506,1507,1508,293,1510,1512,1513,1515,1516,1519],{},"Both ",[286,1509,300],{},[286,1511,303],{}," return the same logger instance. ",[286,1514,303],{}," uses ",[286,1517,1518],{},"AsyncLocalStorage"," to propagate the logger across async boundaries.",[387,1521,1523],{"id":1522},"error-handling","Error Handling",[282,1525,1189,1526,1529,1530,1533,1534,1537,1538,1541,1542,1544],{},[286,1527,1528],{},"createError"," for structured errors with ",[286,1531,1532],{},"why",", ",[286,1535,1536],{},"fix",", and ",[286,1539,1540],{},"link"," fields. The ",[286,1543,296],{}," hook captures thrown errors automatically:",[309,1546,1549],{"className":422,"code":1547,"filename":1548,"language":425,"meta":315,"style":315},"import { json } from '@sveltejs\u002Fkit'\nimport { createError } from 'evlog'\nimport type { RequestHandler } from '.\u002F$types'\n\nexport const POST: RequestHandler = async ({ locals, request }) => {\n  const { cartId } = await request.json()\n  locals.log.set({ cart: { id: cartId } })\n\n  throw createError({\n    message: 'Payment failed',\n    status: 402,\n    why: 'Card declined by issuer',\n    fix: 'Try a different payment method',\n    link: 'https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined',\n  })\n}\n","src\u002Froutes\u002Fapi\u002Fcheckout\u002F+server.ts",[286,1550,1551,1569,1588,1608,1612,1644,1668,1703,1707,1718,1734,1746,1762,1778,1794,1802],{"__ignoreMap":315},[319,1552,1553,1555,1557,1559,1561,1563,1565,1567],{"class":321,"line":322},[319,1554,433],{"class":432},[319,1556,437],{"class":436},[319,1558,784],{"class":440},[319,1560,444],{"class":436},[319,1562,447],{"class":432},[319,1564,450],{"class":436},[319,1566,793],{"class":411},[319,1568,456],{"class":436},[319,1570,1571,1573,1575,1578,1580,1582,1584,1586],{"class":321,"line":328},[319,1572,433],{"class":432},[319,1574,437],{"class":436},[319,1576,1577],{"class":440}," createError",[319,1579,444],{"class":436},[319,1581,447],{"class":432},[319,1583,450],{"class":436},[319,1585,690],{"class":411},[319,1587,456],{"class":436},[319,1589,1590,1592,1594,1596,1598,1600,1602,1604,1606],{"class":321,"line":335},[319,1591,433],{"class":432},[319,1593,676],{"class":432},[319,1595,437],{"class":436},[319,1597,806],{"class":440},[319,1599,444],{"class":436},[319,1601,447],{"class":432},[319,1603,450],{"class":436},[319,1605,815],{"class":411},[319,1607,456],{"class":436},[319,1609,1610],{"class":321,"line":341},[319,1611,332],{"emptyLinePlaceholder":331},[319,1613,1614,1616,1618,1621,1623,1625,1627,1629,1631,1633,1635,1638,1640,1642],{"class":321,"line":347},[319,1615,502],{"class":432},[319,1617,638],{"class":637},[319,1619,1620],{"class":440}," POST",[319,1622,523],{"class":436},[319,1624,806],{"class":407},[319,1626,654],{"class":436},[319,1628,839],{"class":637},[319,1630,842],{"class":436},[319,1632,846],{"class":845},[319,1634,646],{"class":436},[319,1636,1637],{"class":845}," request",[319,1639,854],{"class":436},[319,1641,857],{"class":637},[319,1643,717],{"class":436},[319,1645,1646,1648,1650,1653,1655,1657,1659,1661,1663,1666],{"class":321,"line":353},[319,1647,914],{"class":637},[319,1649,437],{"class":436},[319,1651,1652],{"class":440}," cartId",[319,1654,444],{"class":436},[319,1656,654],{"class":436},[319,1658,921],{"class":432},[319,1660,1637],{"class":440},[319,1662,867],{"class":436},[319,1664,1665],{"class":508},"json",[319,1667,659],{"class":519},[319,1669,1670,1672,1674,1676,1678,1680,1682,1684,1687,1689,1691,1693,1695,1697,1699,1701],{"class":321,"line":359},[319,1671,864],{"class":440},[319,1673,867],{"class":436},[319,1675,870],{"class":440},[319,1677,867],{"class":436},[319,1679,875],{"class":508},[319,1681,511],{"class":519},[319,1683,880],{"class":436},[319,1685,1686],{"class":519}," cart",[319,1688,523],{"class":436},[319,1690,437],{"class":436},[319,1692,890],{"class":519},[319,1694,523],{"class":436},[319,1696,1652],{"class":440},[319,1698,444],{"class":436},[319,1700,444],{"class":436},[319,1702,589],{"class":519},[319,1704,1705],{"class":321,"line":365},[319,1706,332],{"emptyLinePlaceholder":331},[319,1708,1709,1712,1714,1716],{"class":321,"line":371},[319,1710,1711],{"class":432},"  throw",[319,1713,1577],{"class":508},[319,1715,511],{"class":519},[319,1717,514],{"class":436},[319,1719,1720,1723,1725,1727,1730,1732],{"class":321,"line":376},[319,1721,1722],{"class":519},"    message",[319,1724,523],{"class":436},[319,1726,450],{"class":436},[319,1728,1729],{"class":411},"Payment failed",[319,1731,561],{"class":436},[319,1733,537],{"class":436},[319,1735,1736,1739,1741,1744],{"class":321,"line":382},[319,1737,1738],{"class":519},"    status",[319,1740,523],{"class":436},[319,1742,1743],{"class":1149}," 402",[319,1745,537],{"class":436},[319,1747,1748,1751,1753,1755,1758,1760],{"class":321,"line":583},[319,1749,1750],{"class":519},"    why",[319,1752,523],{"class":436},[319,1754,450],{"class":436},[319,1756,1757],{"class":411},"Card declined by issuer",[319,1759,561],{"class":436},[319,1761,537],{"class":436},[319,1763,1764,1767,1769,1771,1774,1776],{"class":321,"line":1091},[319,1765,1766],{"class":519},"    fix",[319,1768,523],{"class":436},[319,1770,450],{"class":436},[319,1772,1773],{"class":411},"Try a different payment method",[319,1775,561],{"class":436},[319,1777,537],{"class":436},[319,1779,1780,1783,1785,1787,1790,1792],{"class":321,"line":1113},[319,1781,1782],{"class":519},"    link",[319,1784,523],{"class":436},[319,1786,450],{"class":436},[319,1788,1789],{"class":411},"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined",[319,1791,561],{"class":436},[319,1793,537],{"class":436},[319,1795,1797,1800],{"class":321,"line":1796},15,[319,1798,1799],{"class":436},"  }",[319,1801,589],{"class":519},[319,1803,1805],{"class":321,"line":1804},16,[319,1806,752],{"class":436},[282,1808,1809],{},"The error is captured and logged with both the custom context and structured error fields:",[309,1811,1813],{"className":397,"code":1812,"filename":1122,"language":400,"meta":315,"style":315},"14:58:20 ERROR [my-api] POST \u002Fapi\u002Fcheckout 402 in 3ms\n  ├─ error: name=EvlogError message=Payment failed status=402\n  ├─ cart: id=cart_456\n  └─ requestId: 880a50ac-...\n",[286,1814,1815,1826,1848,1858],{"__ignoreMap":315},[319,1816,1817,1820,1823],{"class":321,"line":322},[319,1818,1819],{"class":407},"14:58:20",[319,1821,1822],{"class":411}," ERROR",[319,1824,1825],{"class":440}," [my-api] POST \u002Fapi\u002Fcheckout 402 in 3ms\n",[319,1827,1828,1830,1833,1836,1839,1842,1845],{"class":321,"line":328},[319,1829,1140],{"class":407},[319,1831,1832],{"class":411}," error:",[319,1834,1835],{"class":411}," name=EvlogError",[319,1837,1838],{"class":411}," message=Payment",[319,1840,1841],{"class":411}," failed",[319,1843,1844],{"class":411}," status=",[319,1846,1847],{"class":1149},"402\n",[319,1849,1850,1852,1855],{"class":321,"line":335},[319,1851,1140],{"class":407},[319,1853,1854],{"class":411}," cart:",[319,1856,1857],{"class":411}," id=cart_456\n",[319,1859,1860,1862,1864],{"class":321,"line":341},[319,1861,1177],{"class":407},[319,1863,1180],{"class":411},[319,1865,1866],{"class":411}," 880a50ac-...\n",[387,1868,76],{"id":1869},"configuration",[282,1871,592,1872,1875,1876,1879],{},[594,1873,1874],{"href":77},"Configuration reference"," for all available options (",[286,1877,1878],{},"initLogger",", middleware options, sampling, silent mode, etc.).",[387,1881,1883],{"id":1882},"drain-enrichers","Drain & Enrichers",[282,1885,1886],{},"Configure drain adapters and enrichers directly in the hooks options:",[309,1888,1890],{"className":422,"code":1889,"filename":605,"language":425,"meta":315,"style":315},"import { createEvlogHooks } from 'evlog\u002Fsveltekit'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createUserAgentEnricher } from 'evlog\u002Fenrichers'\n\nconst userAgent = createUserAgentEnricher()\n\nexport const { handle, handleError } = createEvlogHooks({\n  drain: createAxiomDrain(),\n  enrich: (ctx) => {\n    userAgent(ctx)\n    ctx.event.region = process.env.FLY_REGION\n  },\n})\n",[286,1891,1892,1910,1930,1950,1954,1969,1973,1997,2010,2029,2040,2070,2075],{"__ignoreMap":315},[319,1893,1894,1896,1898,1900,1902,1904,1906,1908],{"class":321,"line":322},[319,1895,433],{"class":432},[319,1897,437],{"class":436},[319,1899,616],{"class":440},[319,1901,444],{"class":436},[319,1903,447],{"class":432},[319,1905,450],{"class":436},[319,1907,288],{"class":411},[319,1909,456],{"class":436},[319,1911,1912,1914,1916,1919,1921,1923,1925,1928],{"class":321,"line":328},[319,1913,433],{"class":432},[319,1915,437],{"class":436},[319,1917,1918],{"class":440}," createAxiomDrain",[319,1920,444],{"class":436},[319,1922,447],{"class":432},[319,1924,450],{"class":436},[319,1926,1927],{"class":411},"evlog\u002Faxiom",[319,1929,456],{"class":436},[319,1931,1932,1934,1936,1939,1941,1943,1945,1948],{"class":321,"line":335},[319,1933,433],{"class":432},[319,1935,437],{"class":436},[319,1937,1938],{"class":440}," createUserAgentEnricher",[319,1940,444],{"class":436},[319,1942,447],{"class":432},[319,1944,450],{"class":436},[319,1946,1947],{"class":411},"evlog\u002Fenrichers",[319,1949,456],{"class":436},[319,1951,1952],{"class":321,"line":341},[319,1953,332],{"emptyLinePlaceholder":331},[319,1955,1956,1959,1962,1965,1967],{"class":321,"line":347},[319,1957,1958],{"class":637},"const",[319,1960,1961],{"class":440}," userAgent ",[319,1963,1964],{"class":436},"=",[319,1966,1938],{"class":508},[319,1968,659],{"class":440},[319,1970,1971],{"class":321,"line":353},[319,1972,332],{"emptyLinePlaceholder":331},[319,1974,1975,1977,1979,1981,1983,1985,1987,1989,1991,1993,1995],{"class":321,"line":359},[319,1976,502],{"class":432},[319,1978,638],{"class":637},[319,1980,437],{"class":436},[319,1982,643],{"class":440},[319,1984,646],{"class":436},[319,1986,649],{"class":440},[319,1988,586],{"class":436},[319,1990,654],{"class":436},[319,1992,616],{"class":508},[319,1994,511],{"class":440},[319,1996,514],{"class":436},[319,1998,1999,2002,2004,2006,2008],{"class":321,"line":365},[319,2000,2001],{"class":519},"  drain",[319,2003,523],{"class":436},[319,2005,1918],{"class":508},[319,2007,534],{"class":440},[319,2009,537],{"class":436},[319,2011,2012,2015,2017,2020,2023,2025,2027],{"class":321,"line":371},[319,2013,2014],{"class":508},"  enrich",[319,2016,523],{"class":436},[319,2018,2019],{"class":436}," (",[319,2021,2022],{"class":845},"ctx",[319,2024,571],{"class":436},[319,2026,857],{"class":637},[319,2028,717],{"class":436},[319,2030,2031,2034,2036,2038],{"class":321,"line":376},[319,2032,2033],{"class":508},"    userAgent",[319,2035,511],{"class":519},[319,2037,2022],{"class":440},[319,2039,589],{"class":519},[319,2041,2042,2045,2047,2050,2052,2055,2057,2060,2062,2065,2067],{"class":321,"line":382},[319,2043,2044],{"class":440},"    ctx",[319,2046,867],{"class":436},[319,2048,2049],{"class":440},"event",[319,2051,867],{"class":436},[319,2053,2054],{"class":440},"region",[319,2056,654],{"class":436},[319,2058,2059],{"class":440}," process",[319,2061,867],{"class":436},[319,2063,2064],{"class":440},"env",[319,2066,867],{"class":436},[319,2068,2069],{"class":440},"FLY_REGION\n",[319,2071,2072],{"class":321,"line":583},[319,2073,2074],{"class":436},"  },\n",[319,2076,2077,2079],{"class":321,"line":1091},[319,2078,586],{"class":436},[319,2080,589],{"class":440},[391,2082,2084],{"id":2083},"pipeline-batching-retry","Pipeline (Batching & Retry)",[282,2086,2087,2088,2091],{},"For production, wrap your adapter with ",[286,2089,2090],{},"createDrainPipeline"," to batch events and retry on failure:",[309,2093,2095],{"className":422,"code":2094,"filename":605,"language":425,"meta":315,"style":315},"import type { DrainContext } from 'evlog'\nimport { createEvlogHooks } from 'evlog\u002Fsveltekit'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({\n  batch: { size: 50, intervalMs: 5000 },\n  retry: { maxAttempts: 3 },\n})\nconst drain = pipeline(createAxiomDrain())\n\nexport const { handle, handleError } = createEvlogHooks({ drain })\n",[286,2096,2097,2118,2136,2154,2174,2178,2202,2232,2251,2257,2277,2281],{"__ignoreMap":315},[319,2098,2099,2101,2103,2105,2108,2110,2112,2114,2116],{"class":321,"line":322},[319,2100,433],{"class":432},[319,2102,676],{"class":432},[319,2104,437],{"class":436},[319,2106,2107],{"class":440}," DrainContext",[319,2109,444],{"class":436},[319,2111,447],{"class":432},[319,2113,450],{"class":436},[319,2115,690],{"class":411},[319,2117,456],{"class":436},[319,2119,2120,2122,2124,2126,2128,2130,2132,2134],{"class":321,"line":328},[319,2121,433],{"class":432},[319,2123,437],{"class":436},[319,2125,616],{"class":440},[319,2127,444],{"class":436},[319,2129,447],{"class":432},[319,2131,450],{"class":436},[319,2133,288],{"class":411},[319,2135,456],{"class":436},[319,2137,2138,2140,2142,2144,2146,2148,2150,2152],{"class":321,"line":335},[319,2139,433],{"class":432},[319,2141,437],{"class":436},[319,2143,1918],{"class":440},[319,2145,444],{"class":436},[319,2147,447],{"class":432},[319,2149,450],{"class":436},[319,2151,1927],{"class":411},[319,2153,456],{"class":436},[319,2155,2156,2158,2160,2163,2165,2167,2169,2172],{"class":321,"line":341},[319,2157,433],{"class":432},[319,2159,437],{"class":436},[319,2161,2162],{"class":440}," createDrainPipeline",[319,2164,444],{"class":436},[319,2166,447],{"class":432},[319,2168,450],{"class":436},[319,2170,2171],{"class":411},"evlog\u002Fpipeline",[319,2173,456],{"class":436},[319,2175,2176],{"class":321,"line":347},[319,2177,332],{"emptyLinePlaceholder":331},[319,2179,2180,2182,2185,2187,2189,2192,2195,2198,2200],{"class":321,"line":353},[319,2181,1958],{"class":637},[319,2183,2184],{"class":440}," pipeline ",[319,2186,1964],{"class":436},[319,2188,2162],{"class":508},[319,2190,2191],{"class":436},"\u003C",[319,2193,2194],{"class":407},"DrainContext",[319,2196,2197],{"class":436},">",[319,2199,511],{"class":440},[319,2201,514],{"class":436},[319,2203,2204,2207,2209,2211,2214,2216,2219,2221,2224,2226,2229],{"class":321,"line":359},[319,2205,2206],{"class":519},"  batch",[319,2208,523],{"class":436},[319,2210,437],{"class":436},[319,2212,2213],{"class":519}," size",[319,2215,523],{"class":436},[319,2217,2218],{"class":1149}," 50",[319,2220,646],{"class":436},[319,2222,2223],{"class":519}," intervalMs",[319,2225,523],{"class":436},[319,2227,2228],{"class":1149}," 5000",[319,2230,2231],{"class":436}," },\n",[319,2233,2234,2237,2239,2241,2244,2246,2249],{"class":321,"line":365},[319,2235,2236],{"class":519},"  retry",[319,2238,523],{"class":436},[319,2240,437],{"class":436},[319,2242,2243],{"class":519}," maxAttempts",[319,2245,523],{"class":436},[319,2247,2248],{"class":1149}," 3",[319,2250,2231],{"class":436},[319,2252,2253,2255],{"class":321,"line":371},[319,2254,586],{"class":436},[319,2256,589],{"class":440},[319,2258,2259,2261,2264,2266,2269,2271,2274],{"class":321,"line":376},[319,2260,1958],{"class":637},[319,2262,2263],{"class":440}," drain ",[319,2265,1964],{"class":436},[319,2267,2268],{"class":508}," pipeline",[319,2270,511],{"class":440},[319,2272,2273],{"class":508},"createAxiomDrain",[319,2275,2276],{"class":440},"())\n",[319,2278,2279],{"class":321,"line":382},[319,2280,332],{"emptyLinePlaceholder":331},[319,2282,2283,2285,2287,2289,2291,2293,2295,2297,2299,2301,2303,2305,2307,2309],{"class":321,"line":583},[319,2284,502],{"class":432},[319,2286,638],{"class":637},[319,2288,437],{"class":436},[319,2290,643],{"class":440},[319,2292,646],{"class":436},[319,2294,649],{"class":440},[319,2296,586],{"class":436},[319,2298,654],{"class":436},[319,2300,616],{"class":508},[319,2302,511],{"class":440},[319,2304,880],{"class":436},[319,2306,2263],{"class":440},[319,2308,586],{"class":436},[319,2310,589],{"class":440},[2312,2313,2315,2316,2319,2320,597],"callout",{"color":2314,"icon":13},"info","Call ",[286,2317,2318],{},"drain.flush()"," on server shutdown to ensure all buffered events are sent. See the ",[594,2321,2322],{"href":198},"Pipeline docs",[387,2324,2326],{"id":2325},"tail-sampling","Tail Sampling",[282,2328,1189,2329,2332],{},[286,2330,2331],{},"keep"," to force-retain specific events regardless of head sampling:",[309,2334,2336],{"className":422,"code":2335,"filename":605,"language":425,"meta":315,"style":315},"export const { handle, handleError } = createEvlogHooks({\n  drain: createAxiomDrain(),\n  keep: (ctx) => {\n    if (ctx.duration && ctx.duration > 2000) ctx.shouldKeep = true\n  },\n})\n",[286,2337,2338,2362,2374,2391,2436,2440],{"__ignoreMap":315},[319,2339,2340,2342,2344,2346,2348,2350,2352,2354,2356,2358,2360],{"class":321,"line":322},[319,2341,502],{"class":432},[319,2343,638],{"class":637},[319,2345,437],{"class":436},[319,2347,643],{"class":440},[319,2349,646],{"class":436},[319,2351,649],{"class":440},[319,2353,586],{"class":436},[319,2355,654],{"class":436},[319,2357,616],{"class":508},[319,2359,511],{"class":440},[319,2361,514],{"class":436},[319,2363,2364,2366,2368,2370,2372],{"class":321,"line":328},[319,2365,2001],{"class":519},[319,2367,523],{"class":436},[319,2369,1918],{"class":508},[319,2371,534],{"class":440},[319,2373,537],{"class":436},[319,2375,2376,2379,2381,2383,2385,2387,2389],{"class":321,"line":335},[319,2377,2378],{"class":508},"  keep",[319,2380,523],{"class":436},[319,2382,2019],{"class":436},[319,2384,2022],{"class":845},[319,2386,571],{"class":436},[319,2388,857],{"class":637},[319,2390,717],{"class":436},[319,2392,2393,2396,2398,2400,2402,2405,2408,2411,2413,2415,2418,2421,2423,2425,2427,2430,2432],{"class":321,"line":341},[319,2394,2395],{"class":432},"    if",[319,2397,2019],{"class":519},[319,2399,2022],{"class":440},[319,2401,867],{"class":436},[319,2403,2404],{"class":440},"duration",[319,2406,2407],{"class":436}," &&",[319,2409,2410],{"class":440}," ctx",[319,2412,867],{"class":436},[319,2414,2404],{"class":440},[319,2416,2417],{"class":436}," >",[319,2419,2420],{"class":1149}," 2000",[319,2422,1078],{"class":519},[319,2424,2022],{"class":440},[319,2426,867],{"class":436},[319,2428,2429],{"class":440},"shouldKeep",[319,2431,654],{"class":436},[319,2433,2435],{"class":2434},"sfNiH"," true\n",[319,2437,2438],{"class":321,"line":347},[319,2439,2074],{"class":436},[319,2441,2442,2444],{"class":321,"line":353},[319,2443,586],{"class":436},[319,2445,589],{"class":440},[387,2447,2449],{"id":2448},"route-filtering","Route Filtering",[282,2451,2452,2453,293,2456,2459],{},"Control which routes are logged with ",[286,2454,2455],{},"include",[286,2457,2458],{},"exclude"," patterns:",[309,2461,2463],{"className":422,"code":2462,"filename":605,"language":425,"meta":315,"style":315},"export const { handle, handleError } = createEvlogHooks({\n  include: ['\u002Fapi\u002F**'],\n  exclude: ['\u002F_internal\u002F**', '\u002Fhealth'],\n  routes: {\n    '\u002Fapi\u002Fauth\u002F**': { service: 'auth-service' },\n    '\u002Fapi\u002Fpayment\u002F**': { service: 'payment-service' },\n  },\n})\n",[286,2464,2465,2489,2511,2540,2549,2577,2603,2607],{"__ignoreMap":315},[319,2466,2467,2469,2471,2473,2475,2477,2479,2481,2483,2485,2487],{"class":321,"line":322},[319,2468,502],{"class":432},[319,2470,638],{"class":637},[319,2472,437],{"class":436},[319,2474,643],{"class":440},[319,2476,646],{"class":436},[319,2478,649],{"class":440},[319,2480,586],{"class":436},[319,2482,654],{"class":436},[319,2484,616],{"class":508},[319,2486,511],{"class":440},[319,2488,514],{"class":436},[319,2490,2491,2494,2496,2499,2501,2504,2506,2509],{"class":321,"line":328},[319,2492,2493],{"class":519},"  include",[319,2495,523],{"class":436},[319,2497,2498],{"class":440}," [",[319,2500,561],{"class":436},[319,2502,2503],{"class":411},"\u002Fapi\u002F**",[319,2505,561],{"class":436},[319,2507,2508],{"class":440},"]",[319,2510,537],{"class":436},[319,2512,2513,2516,2518,2520,2522,2525,2527,2529,2531,2534,2536,2538],{"class":321,"line":335},[319,2514,2515],{"class":519},"  exclude",[319,2517,523],{"class":436},[319,2519,2498],{"class":440},[319,2521,561],{"class":436},[319,2523,2524],{"class":411},"\u002F_internal\u002F**",[319,2526,561],{"class":436},[319,2528,646],{"class":436},[319,2530,450],{"class":436},[319,2532,2533],{"class":411},"\u002Fhealth",[319,2535,561],{"class":436},[319,2537,2508],{"class":440},[319,2539,537],{"class":436},[319,2541,2542,2545,2547],{"class":321,"line":341},[319,2543,2544],{"class":519},"  routes",[319,2546,523],{"class":436},[319,2548,717],{"class":436},[319,2550,2551,2554,2557,2559,2561,2563,2566,2568,2570,2573,2575],{"class":321,"line":347},[319,2552,2553],{"class":436},"    '",[319,2555,2556],{"class":519},"\u002Fapi\u002Fauth\u002F**",[319,2558,561],{"class":436},[319,2560,523],{"class":436},[319,2562,437],{"class":436},[319,2564,2565],{"class":519}," service",[319,2567,523],{"class":436},[319,2569,450],{"class":436},[319,2571,2572],{"class":411},"auth-service",[319,2574,561],{"class":436},[319,2576,2231],{"class":436},[319,2578,2579,2581,2584,2586,2588,2590,2592,2594,2596,2599,2601],{"class":321,"line":353},[319,2580,2553],{"class":436},[319,2582,2583],{"class":519},"\u002Fapi\u002Fpayment\u002F**",[319,2585,561],{"class":436},[319,2587,523],{"class":436},[319,2589,437],{"class":436},[319,2591,2565],{"class":519},[319,2593,523],{"class":436},[319,2595,450],{"class":436},[319,2597,2598],{"class":411},"payment-service",[319,2600,561],{"class":436},[319,2602,2231],{"class":436},[319,2604,2605],{"class":321,"line":359},[319,2606,2074],{"class":436},[319,2608,2609,2611],{"class":321,"line":365},[319,2610,586],{"class":436},[319,2612,589],{"class":440},[387,2614,2616],{"id":2615},"run-locally","Run Locally",[309,2618,2620],{"className":397,"code":2619,"filename":399,"language":400,"meta":315,"style":315},"git clone https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog.git\ncd evlog\nbun install\nbun run example:sveltekit\n",[286,2621,2622,2633,2640,2647],{"__ignoreMap":315},[319,2623,2624,2627,2630],{"class":321,"line":322},[319,2625,2626],{"class":407},"git",[319,2628,2629],{"class":411}," clone",[319,2631,2632],{"class":411}," https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog.git\n",[319,2634,2635,2638],{"class":321,"line":328},[319,2636,2637],{"class":508},"cd",[319,2639,415],{"class":411},[319,2641,2642,2644],{"class":321,"line":335},[319,2643,408],{"class":407},[319,2645,2646],{"class":411}," install\n",[319,2648,2649,2651,2654],{"class":321,"line":341},[319,2650,408],{"class":407},[319,2652,2653],{"class":411}," run",[319,2655,2656],{"class":411}," example:sveltekit\n",[282,2658,2659,2660,2665],{},"Open ",[594,2661,2662],{"href":2662,"rel":2663},"http:\u002F\u002Flocalhost:5173",[2664],"nofollow"," to explore the interactive test UI.",[2667,2668,2669],"card-group",{},[2670,2671,2675],"card",{"icon":2672,"title":2673,"to":2674},"i-simple-icons-github","Source Code","https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Fsveltekit","Browse the complete SvelteKit example source on GitHub.",[387,2677,2679],{"id":2678},"next-steps","Next Steps",[282,2681,2682,2683,2686],{},"Deepen your ",[2684,2685,125],"strong",{}," integration:",[2688,2689,2690,2696,2701,2706],"ul",{},[2691,2692,2693,2695],"li",{},[594,2694,46],{"href":47},": Design comprehensive events with context layering",[2691,2697,2698,2700],{},[594,2699,188],{"href":193},": Send logs to Axiom, Sentry, PostHog, and more",[2691,2702,2703,2705],{},[594,2704,81],{"href":82},": Control log volume with head and tail sampling",[2691,2707,2708,2710,2711,1533,2713,1537,2715,2717],{},[594,2709,51],{"href":52},": Throw errors with ",[286,2712,1532],{},[286,2714,1536],{},[286,2716,1540],{}," fields",[2719,2720,2721],"style",{},"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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":315,"searchDepth":328,"depth":328,"links":2723},[2724,2730,2731,2732,2733,2734,2737,2738,2739,2740],{"id":389,"depth":328,"text":20,"children":2725},[2726,2727,2728,2729],{"id":393,"depth":335,"text":394},{"id":418,"depth":335,"text":419},{"id":600,"depth":335,"text":601},{"id":662,"depth":335,"text":663},{"id":766,"depth":328,"text":46},{"id":1186,"depth":328,"text":303},{"id":1522,"depth":328,"text":1523},{"id":1869,"depth":328,"text":76},{"id":1882,"depth":328,"text":1883,"children":2735},[2736],{"id":2083,"depth":335,"text":2084},{"id":2325,"depth":328,"text":2326},{"id":2448,"depth":328,"text":2449},{"id":2615,"depth":328,"text":2616},{"id":2678,"depth":328,"text":2679},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in SvelteKit applications.","md",[2744],{"label":2673,"icon":2672,"to":2674,"color":2745,"variant":2746},"neutral","subtle",{},{"title":125,"icon":128},{"title":125,"description":2741},"VVmlT5gaGlQ_6B_b8j5kzls-yMvBjmBc6KBF7QGv2dc",[2752,2754],{"title":120,"path":121,"stem":122,"description":2753,"icon":123,"children":-1},"Wide events, structured errors, drain pipeline, tail sampling, route-based services, error handling, and client-side logging in Next.js applications.",{"title":130,"path":131,"stem":132,"description":2755,"icon":133,"children":-1},"Automatic wide events, structured errors, drain adapters, enrichers, and tail sampling in Nitro v2 and v3 applications.",1775288555448]