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