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