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