[{"data":1,"prerenderedAt":1674},["ShallowReactive",2],{"navigation_docs":3,"-core-concepts-sampling":191,"-core-concepts-sampling-surround":1669},[4,30,65,115,132,146],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","/getting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","/getting-started/agent-skills","1.getting-started/4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Core Concepts","/core-concepts","2.core-concepts",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"Wide Events","/core-concepts/wide-events","2.core-concepts/1.wide-events","i-lucide-layers",{"title":41,"path":42,"stem":43,"icon":44},"Structured Errors","/core-concepts/structured-errors","2.core-concepts/2.structured-errors","i-lucide-shield-alert",{"title":46,"path":47,"stem":48,"icon":49},"Best Practices","/core-concepts/best-practices","2.core-concepts/3.best-practices","i-lucide-shield-check",{"title":51,"path":52,"stem":53,"icon":54},"Typed Fields","/core-concepts/typed-fields","2.core-concepts/4.typed-fields","i-simple-icons-typescript",{"title":56,"path":57,"stem":58,"icon":59},"Sampling","/core-concepts/sampling","2.core-concepts/5.sampling","i-lucide-filter",{"title":61,"path":62,"stem":63,"icon":64},"Client Logging","/core-concepts/client-logging","2.core-concepts/6.client-logging","i-lucide-monitor",{"title":66,"path":67,"stem":68,"children":69,"page":29},"Adapters","/adapters","3.adapters",[70,75,80,85,90,95,100,105,110],{"title":71,"path":72,"stem":73,"icon":74},"Overview","/adapters/overview","3.adapters/1.overview","i-custom-plug",{"title":76,"path":77,"stem":78,"icon":79},"Axiom","/adapters/axiom","3.adapters/2.axiom","i-custom-axiom",{"title":81,"path":82,"stem":83,"icon":84},"OTLP","/adapters/otlp","3.adapters/3.otlp","i-simple-icons-opentelemetry",{"title":86,"path":87,"stem":88,"icon":89},"PostHog","/adapters/posthog","3.adapters/4.posthog","i-simple-icons-posthog",{"title":91,"path":92,"stem":93,"icon":94},"Sentry","/adapters/sentry","3.adapters/5.sentry","i-simple-icons-sentry",{"title":96,"path":97,"stem":98,"icon":99},"Better Stack","/adapters/better-stack","3.adapters/6.better-stack","i-simple-icons-betterstack",{"title":101,"path":102,"stem":103,"icon":104},"Custom Adapters","/adapters/custom","3.adapters/7.custom","i-lucide-code",{"title":106,"path":107,"stem":108,"icon":109},"Pipeline","/adapters/pipeline","3.adapters/8.pipeline","i-lucide-workflow",{"title":111,"path":112,"stem":113,"icon":114},"Browser","/adapters/browser","3.adapters/9.browser","i-lucide-globe",{"title":116,"path":117,"stem":118,"children":119,"page":29},"Enrichers","/enrichers","4.enrichers",[120,123,128],{"title":71,"path":121,"stem":122,"icon":28},"/enrichers/overview","4.enrichers/1.overview",{"title":124,"path":125,"stem":126,"icon":127},"Built-in","/enrichers/built-in","4.enrichers/2.built-in","i-lucide-puzzle",{"title":129,"path":130,"stem":131,"icon":104},"Custom","/enrichers/custom","4.enrichers/3.custom",{"title":133,"path":134,"stem":135,"children":136,"page":29},"NuxtHub","/nuxthub","5.nuxthub",[137,141],{"title":71,"path":138,"stem":139,"icon":140},"/nuxthub/overview","5.nuxthub/1.overview","i-lucide-database",{"title":142,"path":143,"stem":144,"icon":145},"Retention","/nuxthub/retention","5.nuxthub/2.retention","i-lucide-clock",{"title":147,"path":148,"stem":149,"children":150,"page":29},"Examples","/examples","6.examples",[151,156,161,166,171,176,181,186],{"title":152,"path":153,"stem":154,"icon":155},"Next.js","/examples/nextjs","6.examples/1.nextjs","i-simple-icons-nextdotjs",{"title":157,"path":158,"stem":159,"icon":160},"SvelteKit","/examples/sveltekit","6.examples/2.sveltekit","i-simple-icons-svelte",{"title":162,"path":163,"stem":164,"icon":165},"TanStack Start","/examples/tanstack-start","6.examples/3.tanstack-start","i-custom-tanstack",{"title":167,"path":168,"stem":169,"icon":170},"NestJS","/examples/nestjs","6.examples/4.nestjs","i-simple-icons-nestjs",{"title":172,"path":173,"stem":174,"icon":175},"Express","/examples/express","6.examples/5.express","i-simple-icons-express",{"title":177,"path":178,"stem":179,"icon":180},"Hono","/examples/hono","6.examples/6.hono","i-simple-icons-hono",{"title":182,"path":183,"stem":184,"icon":185},"Fastify","/examples/fastify","6.examples/7.fastify","i-simple-icons-fastify",{"title":187,"path":188,"stem":189,"icon":190},"Elysia","/examples/elysia","6.examples/8.elysia","i-custom-elysia",{"id":192,"title":56,"body":193,"description":1658,"extension":1659,"links":1660,"meta":1665,"navigation":1666,"path":57,"seo":1667,"stem":58,"__hash__":1668},"docs/2.core-concepts/5.sampling.md",{"type":194,"value":195,"toc":1648},"minimark",[196,200,205,213,375,382,391,395,402,551,574,579,651,655,658,690,700,912,916,926,1261,1267,1372,1376,1379,1617,1626,1630,1644],[197,198,199],"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.",[201,202,204],"h2",{"id":203},"head-sampling","Head Sampling",[197,206,207,208,212],{},"Head sampling randomly keeps a percentage of logs per level. It runs ",[209,210,211],"strong",{},"before"," the request completes — a coin flip at emission time.",[214,215,221],"pre",{"className":216,"code":217,"filename":218,"language":219,"meta":220,"style":220},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  evlog: {\n    sampling: {\n      rates: {\n        info: 10,    // Keep 10% of info logs\n        warn: 50,    // Keep 50% of warnings\n        debug: 0,    // Drop all debug logs\n        error: 100,  // Always keep errors (default)\n      },\n    },\n  },\n})\n","nuxt.config.ts","typescript","",[222,223,224,248,261,271,281,300,316,332,348,354,360,366],"code",{"__ignoreMap":220},[225,226,229,233,236,240,244],"span",{"class":227,"line":228},"line",1,[225,230,232],{"class":231},"s7zQu","export",[225,234,235],{"class":231}," default",[225,237,239],{"class":238},"s2Zo4"," defineNuxtConfig",[225,241,243],{"class":242},"sTEyZ","(",[225,245,247],{"class":246},"sMK4o","{\n",[225,249,251,255,258],{"class":227,"line":250},2,[225,252,254],{"class":253},"swJcz","  evlog",[225,256,257],{"class":246},":",[225,259,260],{"class":246}," {\n",[225,262,264,267,269],{"class":227,"line":263},3,[225,265,266],{"class":253},"    sampling",[225,268,257],{"class":246},[225,270,260],{"class":246},[225,272,274,277,279],{"class":227,"line":273},4,[225,275,276],{"class":253},"      rates",[225,278,257],{"class":246},[225,280,260],{"class":246},[225,282,284,287,289,293,296],{"class":227,"line":283},5,[225,285,286],{"class":253},"        info",[225,288,257],{"class":246},[225,290,292],{"class":291},"sbssI"," 10",[225,294,295],{"class":246},",",[225,297,299],{"class":298},"sHwdD","    // Keep 10% of info logs\n",[225,301,303,306,308,311,313],{"class":227,"line":302},6,[225,304,305],{"class":253},"        warn",[225,307,257],{"class":246},[225,309,310],{"class":291}," 50",[225,312,295],{"class":246},[225,314,315],{"class":298},"    // Keep 50% of warnings\n",[225,317,319,322,324,327,329],{"class":227,"line":318},7,[225,320,321],{"class":253},"        debug",[225,323,257],{"class":246},[225,325,326],{"class":291}," 0",[225,328,295],{"class":246},[225,330,331],{"class":298},"    // Drop all debug logs\n",[225,333,335,338,340,343,345],{"class":227,"line":334},8,[225,336,337],{"class":253},"        error",[225,339,257],{"class":246},[225,341,342],{"class":291}," 100",[225,344,295],{"class":246},[225,346,347],{"class":298},"  // Always keep errors (default)\n",[225,349,351],{"class":227,"line":350},9,[225,352,353],{"class":246},"      },\n",[225,355,357],{"class":227,"line":356},10,[225,358,359],{"class":246},"    },\n",[225,361,363],{"class":227,"line":362},11,[225,364,365],{"class":246},"  },\n",[225,367,369,372],{"class":227,"line":368},12,[225,370,371],{"class":246},"}",[225,373,374],{"class":242},")\n",[197,376,377,378,381],{},"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 — you have to explicitly set ",[222,379,380],{},"error: 0"," to drop errors.",[383,384,386,387,390],"callout",{"color":385,"icon":13},"info","Head sampling is random. A ",[222,388,389],{},"10%"," rate means roughly 1 in 10 info logs are kept — not exactly 1 in 10.",[201,392,394],{"id":393},"tail-sampling","Tail Sampling",[197,396,397,398,401],{},"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 ",[209,399,400],{},"after"," the request completes and force-keeping logs that match specific conditions.",[214,403,405],{"className":216,"code":404,"filename":218,"language":219,"meta":220,"style":220},"export default defineNuxtConfig({\n  evlog: {\n    sampling: {\n      rates: {\n        info: 10,\n      },\n      keep: [\n        { status: 400 },              // HTTP status >= 400\n        { duration: 1000 },           // Request took >= 1s\n        { path: '/api/payments/**' }, // Critical path (glob)\n      ],\n    },\n  },\n})\n",[222,406,407,419,427,435,443,454,458,468,487,504,528,535,539,544],{"__ignoreMap":220},[225,408,409,411,413,415,417],{"class":227,"line":228},[225,410,232],{"class":231},[225,412,235],{"class":231},[225,414,239],{"class":238},[225,416,243],{"class":242},[225,418,247],{"class":246},[225,420,421,423,425],{"class":227,"line":250},[225,422,254],{"class":253},[225,424,257],{"class":246},[225,426,260],{"class":246},[225,428,429,431,433],{"class":227,"line":263},[225,430,266],{"class":253},[225,432,257],{"class":246},[225,434,260],{"class":246},[225,436,437,439,441],{"class":227,"line":273},[225,438,276],{"class":253},[225,440,257],{"class":246},[225,442,260],{"class":246},[225,444,445,447,449,451],{"class":227,"line":283},[225,446,286],{"class":253},[225,448,257],{"class":246},[225,450,292],{"class":291},[225,452,453],{"class":246},",\n",[225,455,456],{"class":227,"line":302},[225,457,353],{"class":246},[225,459,460,463,465],{"class":227,"line":318},[225,461,462],{"class":253},"      keep",[225,464,257],{"class":246},[225,466,467],{"class":242}," [\n",[225,469,470,473,476,478,481,484],{"class":227,"line":334},[225,471,472],{"class":246},"        {",[225,474,475],{"class":253}," status",[225,477,257],{"class":246},[225,479,480],{"class":291}," 400",[225,482,483],{"class":246}," },",[225,485,486],{"class":298},"              // HTTP status >= 400\n",[225,488,489,491,494,496,499,501],{"class":227,"line":350},[225,490,472],{"class":246},[225,492,493],{"class":253}," duration",[225,495,257],{"class":246},[225,497,498],{"class":291}," 1000",[225,500,483],{"class":246},[225,502,503],{"class":298},"           // Request took >= 1s\n",[225,505,506,508,511,513,516,520,523,525],{"class":227,"line":356},[225,507,472],{"class":246},[225,509,510],{"class":253}," path",[225,512,257],{"class":246},[225,514,515],{"class":246}," '",[225,517,519],{"class":518},"sfazB","/api/payments/**",[225,521,522],{"class":246},"'",[225,524,483],{"class":246},[225,526,527],{"class":298}," // Critical path (glob)\n",[225,529,530,533],{"class":227,"line":362},[225,531,532],{"class":242},"      ]",[225,534,453],{"class":246},[225,536,537],{"class":227,"line":368},[225,538,359],{"class":246},[225,540,542],{"class":227,"line":541},13,[225,543,365],{"class":246},[225,545,547,549],{"class":227,"line":546},14,[225,548,371],{"class":246},[225,550,374],{"class":242},[197,552,553,554,557,558,561,562,565,566,569,570,573],{},"Conditions use ",[209,555,556],{},">="," comparison for ",[222,559,560],{},"status"," and ",[222,563,564],{},"duration",", and glob matching for ",[222,567,568],{},"path",". If ",[209,571,572],{},"any"," condition matches, the log is kept regardless of head sampling (OR logic).",[575,576,578],"h3",{"id":577},"available-conditions","Available Conditions",[580,581,582,598],"table",{},[583,584,585],"thead",{},[586,587,588,592,595],"tr",{},[589,590,591],"th",{},"Condition",[589,593,594],{},"Type",[589,596,597],{},"Description",[599,600,601,620,633],"tbody",{},[586,602,603,608,613],{},[604,605,606],"td",{},[222,607,560],{},[604,609,610],{},[222,611,612],{},"number",[604,614,615,616,619],{},"Keep if HTTP status >= value (e.g., ",[222,617,618],{},"400"," catches all 4xx and 5xx)",[586,621,622,626,630],{},[604,623,624],{},[222,625,564],{},[604,627,628],{},[222,629,612],{},[604,631,632],{},"Keep if request duration >= value in milliseconds",[586,634,635,639,644],{},[604,636,637],{},[222,638,568],{},[604,640,641],{},[222,642,643],{},"string",[604,645,646,647,650],{},"Keep if request path matches glob pattern (e.g., ",[222,648,649],{},"'/api/critical/**'",")",[201,652,654],{"id":653},"how-they-work-together","How They Work Together",[197,656,657],{},"The two tiers complement each other:",[659,660,661,668,678,684],"ol",{},[662,663,664,667],"li",{},[209,665,666],{},"Request completes"," — evlog knows the status, duration, and path",[662,669,670,673,674,677],{},[209,671,672],{},"Tail sampling evaluates"," — if any ",[222,675,676],{},"keep"," condition matches, the log is force-kept",[662,679,680,683],{},[209,681,682],{},"Head sampling applies"," — only if tail sampling didn't force-keep, the random percentage check runs",[662,685,686,689],{},[209,687,688],{},"Log emits or drops"," — kept logs go through enrichment and draining as normal",[197,691,692,693,696,697,699],{},"This means a request to ",[222,694,695],{},"/api/payments/charge"," that returns a 500 in 2 seconds will always be logged, even if ",[222,698,385],{}," is set to 1%. The tail conditions rescue it.",[701,702,703,785],"code-group",{},[214,704,707],{"className":216,"code":705,"filename":706,"language":219,"meta":220,"style":220},"sampling: {\n  rates: { info: 10 },\n  keep: [\n    { status: 400 },\n    { duration: 1000 },\n  ],\n}\n","Configuration",[222,708,709,719,739,748,761,773,780],{"__ignoreMap":220},[225,710,711,715,717],{"class":227,"line":228},[225,712,714],{"class":713},"sBMFI","sampling",[225,716,257],{"class":246},[225,718,260],{"class":246},[225,720,721,724,726,729,732,734,736],{"class":227,"line":250},[225,722,723],{"class":713},"  rates",[225,725,257],{"class":246},[225,727,728],{"class":246}," {",[225,730,731],{"class":713}," info",[225,733,257],{"class":246},[225,735,292],{"class":291},[225,737,738],{"class":246}," },\n",[225,740,741,744,746],{"class":227,"line":263},[225,742,743],{"class":713},"  keep",[225,745,257],{"class":246},[225,747,467],{"class":253},[225,749,750,753,755,757,759],{"class":227,"line":273},[225,751,752],{"class":246},"    {",[225,754,475],{"class":253},[225,756,257],{"class":246},[225,758,480],{"class":291},[225,760,738],{"class":246},[225,762,763,765,767,769,771],{"class":227,"line":283},[225,764,752],{"class":246},[225,766,493],{"class":253},[225,768,257],{"class":246},[225,770,498],{"class":291},[225,772,738],{"class":246},[225,774,775,778],{"class":227,"line":302},[225,776,777],{"class":253},"  ]",[225,779,453],{"class":246},[225,781,782],{"class":227,"line":318},[225,783,784],{"class":246},"}\n",[214,786,791],{"className":787,"code":788,"filename":789,"language":790,"meta":220,"style":220},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POST /api/users     200  45ms   → 10% chance (head sampling)\nPOST /api/users     500  45ms   → always kept (status >= 400)\nGET  /api/products  200  2300ms → always kept (duration >= 1000)\nPOST /api/checkout  200  120ms  → 10% chance (head sampling)\n","What gets logged","bash",[222,792,793,823,855,887],{"__ignoreMap":220},[225,794,795,798,801,804,807,810,813,816,819,821],{"class":227,"line":228},[225,796,797],{"class":713},"POST",[225,799,800],{"class":518}," /api/users",[225,802,803],{"class":291},"     200",[225,805,806],{"class":518},"  45ms",[225,808,809],{"class":518},"   →",[225,811,812],{"class":518}," 10%",[225,814,815],{"class":518}," chance",[225,817,818],{"class":242}," (head ",[225,820,714],{"class":518},[225,822,374],{"class":242},[225,824,825,827,829,832,834,836,839,842,845,848,851,853],{"class":227,"line":250},[225,826,797],{"class":713},[225,828,800],{"class":518},[225,830,831],{"class":291},"     500",[225,833,806],{"class":518},[225,835,809],{"class":518},[225,837,838],{"class":518}," always",[225,840,841],{"class":518}," kept",[225,843,844],{"class":242}," (status ",[225,846,847],{"class":246},">",[225,849,850],{"class":518},"=",[225,852,480],{"class":291},[225,854,374],{"class":242},[225,856,857,860,863,866,869,872,874,876,879,881,883,885],{"class":227,"line":263},[225,858,859],{"class":713},"GET",[225,861,862],{"class":518},"  /api/products",[225,864,865],{"class":291},"  200",[225,867,868],{"class":518},"  2300ms",[225,870,871],{"class":518}," →",[225,873,838],{"class":518},[225,875,841],{"class":518},[225,877,878],{"class":242}," (duration ",[225,880,847],{"class":246},[225,882,850],{"class":518},[225,884,498],{"class":291},[225,886,374],{"class":242},[225,888,889,891,894,896,899,902,904,906,908,910],{"class":227,"line":273},[225,890,797],{"class":713},[225,892,893],{"class":518}," /api/checkout",[225,895,865],{"class":291},[225,897,898],{"class":518},"  120ms",[225,900,901],{"class":518},"  →",[225,903,812],{"class":518},[225,905,815],{"class":518},[225,907,818],{"class":242},[225,909,714],{"class":518},[225,911,374],{"class":242},[201,913,915],{"id":914},"custom-tail-sampling","Custom Tail Sampling",[197,917,918,919,922,923,925],{},"For conditions beyond status, duration, and path, use the ",[222,920,921],{},"evlog:emit:keep"," hook in Nuxt/Nitro or the ",[222,924,676],{}," callback in standalone frameworks.",[701,927,928,1082],{},[214,929,932],{"className":216,"code":930,"filename":931,"language":219,"meta":220,"style":220},"// server/plugins/sampling.ts\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:emit:keep', (ctx) => {\n    // Always keep logs for premium users\n    if (ctx.context.user?.plan === 'enterprise') {\n      ctx.shouldKeep = true\n    }\n  })\n})\n","Nuxt / Nitro",[222,933,934,939,964,1002,1007,1047,1064,1069,1076],{"__ignoreMap":220},[225,935,936],{"class":227,"line":228},[225,937,938],{"class":298},"// server/plugins/sampling.ts\n",[225,940,941,943,945,948,950,952,956,958,962],{"class":227,"line":250},[225,942,232],{"class":231},[225,944,235],{"class":231},[225,946,947],{"class":238}," defineNitroPlugin",[225,949,243],{"class":242},[225,951,243],{"class":246},[225,953,955],{"class":954},"sHdIc","nitroApp",[225,957,650],{"class":246},[225,959,961],{"class":960},"spNyl"," =>",[225,963,260],{"class":246},[225,965,966,969,972,975,977,980,982,984,986,988,990,993,996,998,1000],{"class":227,"line":263},[225,967,968],{"class":242},"  nitroApp",[225,970,971],{"class":246},".",[225,973,974],{"class":242},"hooks",[225,976,971],{"class":246},[225,978,979],{"class":238},"hook",[225,981,243],{"class":253},[225,983,522],{"class":246},[225,985,921],{"class":518},[225,987,522],{"class":246},[225,989,295],{"class":246},[225,991,992],{"class":246}," (",[225,994,995],{"class":954},"ctx",[225,997,650],{"class":246},[225,999,961],{"class":960},[225,1001,260],{"class":246},[225,1003,1004],{"class":227,"line":273},[225,1005,1006],{"class":298},"    // Always keep logs for premium users\n",[225,1008,1009,1012,1014,1016,1018,1021,1023,1026,1029,1032,1035,1037,1040,1042,1045],{"class":227,"line":283},[225,1010,1011],{"class":231},"    if",[225,1013,992],{"class":253},[225,1015,995],{"class":242},[225,1017,971],{"class":246},[225,1019,1020],{"class":242},"context",[225,1022,971],{"class":246},[225,1024,1025],{"class":242},"user",[225,1027,1028],{"class":246},"?.",[225,1030,1031],{"class":242},"plan",[225,1033,1034],{"class":246}," ===",[225,1036,515],{"class":246},[225,1038,1039],{"class":518},"enterprise",[225,1041,522],{"class":246},[225,1043,1044],{"class":253},") ",[225,1046,247],{"class":246},[225,1048,1049,1052,1054,1057,1060],{"class":227,"line":302},[225,1050,1051],{"class":242},"      ctx",[225,1053,971],{"class":246},[225,1055,1056],{"class":242},"shouldKeep",[225,1058,1059],{"class":246}," =",[225,1061,1063],{"class":1062},"sfNiH"," true\n",[225,1065,1066],{"class":227,"line":318},[225,1067,1068],{"class":246},"    }\n",[225,1070,1071,1074],{"class":227,"line":334},[225,1072,1073],{"class":246},"  }",[225,1075,374],{"class":253},[225,1077,1078,1080],{"class":227,"line":350},[225,1079,371],{"class":246},[225,1081,374],{"class":242},[214,1083,1086],{"className":216,"code":1084,"filename":1085,"language":219,"meta":220,"style":220},"import { withEvlog } from 'evlog/next' // or evlog/express, evlog/hono\n\nexport default withEvlog(handler, {\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","Next.js / Express / Hono",[222,1087,1088,1114,1120,1135,1144,1161,1187,1191,1203,1235,1247,1251,1255],{"__ignoreMap":220},[225,1089,1090,1093,1095,1098,1101,1104,1106,1109,1111],{"class":227,"line":228},[225,1091,1092],{"class":231},"import",[225,1094,728],{"class":246},[225,1096,1097],{"class":242}," withEvlog",[225,1099,1100],{"class":246}," }",[225,1102,1103],{"class":231}," from",[225,1105,515],{"class":246},[225,1107,1108],{"class":518},"evlog/next",[225,1110,522],{"class":246},[225,1112,1113],{"class":298}," // or evlog/express, evlog/hono\n",[225,1115,1116],{"class":227,"line":250},[225,1117,1119],{"emptyLinePlaceholder":1118},true,"\n",[225,1121,1122,1124,1126,1128,1131,1133],{"class":227,"line":263},[225,1123,232],{"class":231},[225,1125,235],{"class":231},[225,1127,1097],{"class":238},[225,1129,1130],{"class":242},"(handler",[225,1132,295],{"class":246},[225,1134,260],{"class":246},[225,1136,1137,1140,1142],{"class":227,"line":273},[225,1138,1139],{"class":253},"  sampling",[225,1141,257],{"class":246},[225,1143,260],{"class":246},[225,1145,1146,1149,1151,1153,1155,1157,1159],{"class":227,"line":283},[225,1147,1148],{"class":253},"    rates",[225,1150,257],{"class":246},[225,1152,728],{"class":246},[225,1154,731],{"class":253},[225,1156,257],{"class":246},[225,1158,292],{"class":291},[225,1160,738],{"class":246},[225,1162,1163,1166,1168,1171,1174,1176,1178,1180,1182,1185],{"class":227,"line":302},[225,1164,1165],{"class":253},"    keep",[225,1167,257],{"class":246},[225,1169,1170],{"class":242}," [",[225,1172,1173],{"class":246},"{",[225,1175,475],{"class":253},[225,1177,257],{"class":246},[225,1179,480],{"class":291},[225,1181,1100],{"class":246},[225,1183,1184],{"class":242},"]",[225,1186,453],{"class":246},[225,1188,1189],{"class":227,"line":318},[225,1190,365],{"class":246},[225,1192,1193,1195,1197,1199,1201],{"class":227,"line":334},[225,1194,743],{"class":253},[225,1196,243],{"class":246},[225,1198,995],{"class":954},[225,1200,650],{"class":246},[225,1202,260],{"class":246},[225,1204,1205,1207,1209,1211,1213,1215,1217,1219,1221,1223,1225,1227,1229,1231,1233],{"class":227,"line":350},[225,1206,1011],{"class":231},[225,1208,992],{"class":253},[225,1210,995],{"class":242},[225,1212,971],{"class":246},[225,1214,1020],{"class":242},[225,1216,971],{"class":246},[225,1218,1025],{"class":242},[225,1220,1028],{"class":246},[225,1222,1031],{"class":242},[225,1224,1034],{"class":246},[225,1226,515],{"class":246},[225,1228,1039],{"class":518},[225,1230,522],{"class":246},[225,1232,1044],{"class":253},[225,1234,247],{"class":246},[225,1236,1237,1239,1241,1243,1245],{"class":227,"line":356},[225,1238,1051],{"class":242},[225,1240,971],{"class":246},[225,1242,1056],{"class":242},[225,1244,1059],{"class":246},[225,1246,1063],{"class":1062},[225,1248,1249],{"class":227,"line":362},[225,1250,1068],{"class":246},[225,1252,1253],{"class":227,"line":368},[225,1254,365],{"class":246},[225,1256,1257,1259],{"class":227,"line":541},[225,1258,371],{"class":246},[225,1260,374],{"class":242},[197,1262,1263,1264,1266],{},"The ",[222,1265,995],{}," object contains:",[580,1268,1269,1280],{},[583,1270,1271],{},[586,1272,1273,1276,1278],{},[589,1274,1275],{},"Field",[589,1277,594],{},[589,1279,597],{},[599,1281,1282,1296,1309,1323,1337,1354],{},[586,1283,1284,1288,1293],{},[604,1285,1286],{},[222,1287,560],{},[604,1289,1290],{},[222,1291,1292],{},"number | undefined",[604,1294,1295],{},"HTTP response status",[586,1297,1298,1302,1306],{},[604,1299,1300],{},[222,1301,564],{},[604,1303,1304],{},[222,1305,1292],{},[604,1307,1308],{},"Request duration in ms",[586,1310,1311,1315,1320],{},[604,1312,1313],{},[222,1314,568],{},[604,1316,1317],{},[222,1318,1319],{},"string | undefined",[604,1321,1322],{},"Request path",[586,1324,1325,1330,1334],{},[604,1326,1327],{},[222,1328,1329],{},"method",[604,1331,1332],{},[222,1333,1319],{},[604,1335,1336],{},"HTTP method",[586,1338,1339,1343,1348],{},[604,1340,1341],{},[222,1342,1020],{},[604,1344,1345],{},[222,1346,1347],{},"Record\u003Cstring, unknown>",[604,1349,1350,1351],{},"All fields set via ",[222,1352,1353],{},"log.set()",[586,1355,1356,1360,1365],{},[604,1357,1358],{},[222,1359,1056],{},[604,1361,1362],{},[222,1363,1364],{},"boolean",[604,1366,1367,1368,1371],{},"Set to ",[222,1369,1370],{},"true"," to force-keep",[201,1373,1375],{"id":1374},"production-example","Production Example",[197,1377,1378],{},"A typical production configuration that balances cost and visibility:",[214,1380,1382],{"className":216,"code":1381,"filename":218,"language":219,"meta":220,"style":220},"export default defineNuxtConfig({\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: '/api/payments/**' },\n          { path: '/api/auth/**' },\n        ],\n      },\n    },\n  },\n})\n",[222,1383,1384,1396,1404,1427,1431,1440,1449,1458,1467,1478,1489,1500,1511,1516,1525,1539,1552,1569,1587,1595,1600,1605,1610],{"__ignoreMap":220},[225,1385,1386,1388,1390,1392,1394],{"class":227,"line":228},[225,1387,232],{"class":231},[225,1389,235],{"class":231},[225,1391,239],{"class":238},[225,1393,243],{"class":242},[225,1395,247],{"class":246},[225,1397,1398,1400,1402],{"class":227,"line":250},[225,1399,254],{"class":253},[225,1401,257],{"class":246},[225,1403,260],{"class":246},[225,1405,1406,1409,1411,1413,1416,1418,1420,1423,1425],{"class":227,"line":263},[225,1407,1408],{"class":253},"    env",[225,1410,257],{"class":246},[225,1412,728],{"class":246},[225,1414,1415],{"class":253}," service",[225,1417,257],{"class":246},[225,1419,515],{"class":246},[225,1421,1422],{"class":518},"my-app",[225,1424,522],{"class":246},[225,1426,738],{"class":246},[225,1428,1429],{"class":227,"line":273},[225,1430,365],{"class":246},[225,1432,1433,1436,1438],{"class":227,"line":283},[225,1434,1435],{"class":253},"  $production",[225,1437,257],{"class":246},[225,1439,260],{"class":246},[225,1441,1442,1445,1447],{"class":227,"line":302},[225,1443,1444],{"class":253},"    evlog",[225,1446,257],{"class":246},[225,1448,260],{"class":246},[225,1450,1451,1454,1456],{"class":227,"line":318},[225,1452,1453],{"class":253},"      sampling",[225,1455,257],{"class":246},[225,1457,260],{"class":246},[225,1459,1460,1463,1465],{"class":227,"line":334},[225,1461,1462],{"class":253},"        rates",[225,1464,257],{"class":246},[225,1466,260],{"class":246},[225,1468,1469,1472,1474,1476],{"class":227,"line":350},[225,1470,1471],{"class":253},"          info",[225,1473,257],{"class":246},[225,1475,292],{"class":291},[225,1477,453],{"class":246},[225,1479,1480,1483,1485,1487],{"class":227,"line":356},[225,1481,1482],{"class":253},"          warn",[225,1484,257],{"class":246},[225,1486,310],{"class":291},[225,1488,453],{"class":246},[225,1490,1491,1494,1496,1498],{"class":227,"line":362},[225,1492,1493],{"class":253},"          debug",[225,1495,257],{"class":246},[225,1497,326],{"class":291},[225,1499,453],{"class":246},[225,1501,1502,1505,1507,1509],{"class":227,"line":368},[225,1503,1504],{"class":253},"          error",[225,1506,257],{"class":246},[225,1508,342],{"class":291},[225,1510,453],{"class":246},[225,1512,1513],{"class":227,"line":541},[225,1514,1515],{"class":246},"        },\n",[225,1517,1518,1521,1523],{"class":227,"line":546},[225,1519,1520],{"class":253},"        keep",[225,1522,257],{"class":246},[225,1524,467],{"class":242},[225,1526,1528,1531,1533,1535,1537],{"class":227,"line":1527},15,[225,1529,1530],{"class":246},"          {",[225,1532,475],{"class":253},[225,1534,257],{"class":246},[225,1536,480],{"class":291},[225,1538,738],{"class":246},[225,1540,1542,1544,1546,1548,1550],{"class":227,"line":1541},16,[225,1543,1530],{"class":246},[225,1545,493],{"class":253},[225,1547,257],{"class":246},[225,1549,498],{"class":291},[225,1551,738],{"class":246},[225,1553,1555,1557,1559,1561,1563,1565,1567],{"class":227,"line":1554},17,[225,1556,1530],{"class":246},[225,1558,510],{"class":253},[225,1560,257],{"class":246},[225,1562,515],{"class":246},[225,1564,519],{"class":518},[225,1566,522],{"class":246},[225,1568,738],{"class":246},[225,1570,1572,1574,1576,1578,1580,1583,1585],{"class":227,"line":1571},18,[225,1573,1530],{"class":246},[225,1575,510],{"class":253},[225,1577,257],{"class":246},[225,1579,515],{"class":246},[225,1581,1582],{"class":518},"/api/auth/**",[225,1584,522],{"class":246},[225,1586,738],{"class":246},[225,1588,1590,1593],{"class":227,"line":1589},19,[225,1591,1592],{"class":242},"        ]",[225,1594,453],{"class":246},[225,1596,1598],{"class":227,"line":1597},20,[225,1599,353],{"class":246},[225,1601,1603],{"class":227,"line":1602},21,[225,1604,359],{"class":246},[225,1606,1608],{"class":227,"line":1607},22,[225,1609,365],{"class":246},[225,1611,1613,1615],{"class":227,"line":1612},23,[225,1614,371],{"class":246},[225,1616,374],{"class":242},[383,1618,1621,1622,1625],{"color":1619,"icon":1620},"warning","i-lucide-lightbulb","Use the ",[222,1623,1624],{},"$production"," override to keep full logging in development while sampling in production. In dev, all logs are emitted — sampling only applies when deployed.",[201,1627,1629],{"id":1628},"next-steps","Next Steps",[1631,1632,1633,1639],"ul",{},[662,1634,1635,1638],{},[1636,1637,46],"a",{"href":47}," — Security and production checklist",[662,1640,1641,1643],{},[1636,1642,36],{"href":37}," — Design effective wide events",[1645,1646,1647],"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 .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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":220,"searchDepth":250,"depth":250,"links":1649},[1650,1651,1654,1655,1656,1657],{"id":203,"depth":250,"text":204},{"id":393,"depth":250,"text":394,"children":1652},[1653],{"id":577,"depth":263,"text":578},{"id":653,"depth":250,"text":654},{"id":914,"depth":250,"text":915},{"id":1374,"depth":250,"text":1375},{"id":1628,"depth":250,"text":1629},"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",[1661,1664],{"label":46,"icon":49,"to":47,"color":1662,"variant":1663},"neutral","subtle",{"label":36,"icon":39,"to":37,"color":1662,"variant":1663},{},{"icon":59},{"title":56,"description":1658},"Jtf84quB6A4dsTaIiyNBB-Cf-o2nKH3jpZ32ufRRVKo",[1670,1672],{"title":51,"path":52,"stem":53,"description":1671,"icon":54,"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":61,"path":62,"stem":63,"description":1673,"icon":64,"children":-1},"Capture browser events with structured logging. Same API as the server, with automatic console styling, user identity context, and optional server transport.",1772901884345]