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