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