[{"data":1,"prerenderedAt":1885},["ShallowReactive",2],{"navigation_docs":3,"-core-concepts-configuration":277,"-core-concepts-configuration-surround":1880},[4,30,65,105,188,247,263],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Logging","\u002Flogging","2.logging",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":61,"path":62,"stem":63,"icon":64},"AI SDK Integration","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk","i-simple-icons-vercel",{"title":66,"path":67,"stem":68,"children":69,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[70,75,80,85,90,95,100],{"title":71,"path":72,"stem":73,"icon":74},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":76,"path":77,"stem":78,"icon":79},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":81,"path":82,"stem":83,"icon":84},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":86,"path":87,"stem":88,"icon":89},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":91,"path":92,"stem":93,"icon":94},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices","i-lucide-shield-check",{"title":96,"path":97,"stem":98,"icon":99},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance","i-lucide-gauge",{"title":101,"path":102,"stem":103,"icon":104},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Frameworks","\u002Fframeworks","4.frameworks",[110,114,119,124,129,134,139,144,149,154,159,164,169,174,178,183],{"title":36,"path":111,"stem":112,"icon":113},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":115,"path":116,"stem":117,"icon":118},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":120,"path":121,"stem":122,"icon":123},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":125,"path":126,"stem":127,"icon":128},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":130,"path":131,"stem":132,"icon":133},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":135,"path":136,"stem":137,"icon":138},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":140,"path":141,"stem":142,"icon":143},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":145,"path":146,"stem":147,"icon":148},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":150,"path":151,"stem":152,"icon":153},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":155,"path":156,"stem":157,"icon":158},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":160,"path":161,"stem":162,"icon":163},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":165,"path":166,"stem":167,"icon":168},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":170,"path":171,"stem":172,"icon":173},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":175,"path":176,"stem":177,"icon":89},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":179,"path":180,"stem":181,"icon":182},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":184,"path":185,"stem":186,"icon":187},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F15.custom-integration","i-lucide-puzzle",{"title":189,"path":190,"stem":191,"children":192,"page":29},"Adapters","\u002Fadapters","5.adapters",[193,197,202,207,212,217,222,227,232,237,242],{"title":36,"path":194,"stem":195,"icon":196},"\u002Fadapters\u002Foverview","5.adapters\u002F1.overview","i-custom-plug",{"title":198,"path":199,"stem":200,"icon":201},"Pipeline","\u002Fadapters\u002Fpipeline","5.adapters\u002F10.pipeline","i-lucide-workflow",{"title":203,"path":204,"stem":205,"icon":206},"Browser","\u002Fadapters\u002Fbrowser","5.adapters\u002F11.browser","i-lucide-globe",{"title":208,"path":209,"stem":210,"icon":211},"Axiom","\u002Fadapters\u002Faxiom","5.adapters\u002F2.axiom","i-custom-axiom",{"title":213,"path":214,"stem":215,"icon":216},"OTLP","\u002Fadapters\u002Fotlp","5.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":218,"path":219,"stem":220,"icon":221},"PostHog","\u002Fadapters\u002Fposthog","5.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":223,"path":224,"stem":225,"icon":226},"Sentry","\u002Fadapters\u002Fsentry","5.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":228,"path":229,"stem":230,"icon":231},"Better Stack","\u002Fadapters\u002Fbetter-stack","5.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":233,"path":234,"stem":235,"icon":236},"File System","\u002Fadapters\u002Ffs","5.adapters\u002F7.fs","i-lucide-hard-drive",{"title":238,"path":239,"stem":240,"icon":241},"HyperDX","\u002Fadapters\u002Fhyperdx","5.adapters\u002F8.hyperdx","i-custom-hyperdx",{"title":243,"path":244,"stem":245,"icon":246},"Custom Adapters","\u002Fadapters\u002Fcustom","5.adapters\u002F9.custom","i-lucide-code",{"title":248,"path":249,"stem":250,"children":251,"page":29},"Enrichers","\u002Fenrichers","6.enrichers",[252,255,259],{"title":36,"path":253,"stem":254,"icon":28},"\u002Fenrichers\u002Foverview","6.enrichers\u002F1.overview",{"title":256,"path":257,"stem":258,"icon":187},"Built-in","\u002Fenrichers\u002Fbuilt-in","6.enrichers\u002F2.built-in",{"title":260,"path":261,"stem":262,"icon":246},"Custom","\u002Fenrichers\u002Fcustom","6.enrichers\u002F3.custom",{"title":264,"path":265,"stem":266,"children":267,"page":29},"NuxtHub","\u002Fnuxthub","7.nuxthub",[268,272],{"title":36,"path":269,"stem":270,"icon":271},"\u002Fnuxthub\u002Foverview","7.nuxthub\u002F1.overview","i-lucide-database",{"title":273,"path":274,"stem":275,"icon":276},"Retention","\u002Fnuxthub\u002Fretention","7.nuxthub\u002F2.retention","i-lucide-clock",{"id":278,"title":76,"body":279,"description":1868,"extension":1869,"links":1870,"meta":1876,"navigation":1877,"path":77,"seo":1878,"stem":78,"__hash__":1879},"docs\u002F3.core-concepts\u002F1.configuration.md",{"type":280,"value":281,"toc":1854},"minimark",[282,295,305,312,570,744,749,759,898,902,908,1008,1017,1021,1024,1404,1531,1554,1558,1567,1693,1697,1700,1703,1713,1808,1815,1818,1843,1850],[283,284,285,286,290,291,294],"p",{},"evlog has two configuration surfaces: ",[287,288,289],"strong",{},"global options"," set once at startup, and ",[287,292,293],{},"middleware options"," set per-framework integration. This page documents both.",[296,297,299,300,304],"h2",{"id":298},"global-options-initlogger","Global Options (",[301,302,303],"code",{},"initLogger",")",[283,306,307,308,311],{},"These options apply to all frameworks. Call ",[301,309,310],{},"initLogger()"," once at application startup for standalone frameworks (Hono, Express, Fastify, Elysia, NestJS, SvelteKit, Cloudflare Workers). For Nuxt and Nitro, these are set via module config and passed through automatically.",[313,314,320],"pre",{"className":315,"code":316,"filename":317,"language":318,"meta":319,"style":319},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { initLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  enabled: true,\n  env: { service: 'my-api', environment: 'production' },\n  pretty: false,\n  silent: false,\n  stringify: true,\n  sampling: { rates: { info: 10 }, keep: [{ status: 400 }] },\n  drain: createAxiomDrain(),\n})\n","src\u002Findex.ts","typescript","",[301,321,322,355,376,383,395,412,453,466,478,490,546,561],{"__ignoreMap":319},[323,324,327,331,335,339,342,345,348,352],"span",{"class":325,"line":326},"line",1,[323,328,330],{"class":329},"s7zQu","import",[323,332,334],{"class":333},"sMK4o"," {",[323,336,338],{"class":337},"sTEyZ"," initLogger",[323,340,341],{"class":333}," }",[323,343,344],{"class":329}," from",[323,346,347],{"class":333}," '",[323,349,351],{"class":350},"sfazB","evlog",[323,353,354],{"class":333},"'\n",[323,356,358,360,362,365,367,369,371,374],{"class":325,"line":357},2,[323,359,330],{"class":329},[323,361,334],{"class":333},[323,363,364],{"class":337}," createAxiomDrain",[323,366,341],{"class":333},[323,368,344],{"class":329},[323,370,347],{"class":333},[323,372,373],{"class":350},"evlog\u002Faxiom",[323,375,354],{"class":333},[323,377,379],{"class":325,"line":378},3,[323,380,382],{"emptyLinePlaceholder":381},true,"\n",[323,384,386,389,392],{"class":325,"line":385},4,[323,387,303],{"class":388},"s2Zo4",[323,390,391],{"class":337},"(",[323,393,394],{"class":333},"{\n",[323,396,398,402,405,409],{"class":325,"line":397},5,[323,399,401],{"class":400},"swJcz","  enabled",[323,403,404],{"class":333},":",[323,406,408],{"class":407},"sfNiH"," true",[323,410,411],{"class":333},",\n",[323,413,415,418,420,422,425,427,429,432,435,438,441,443,445,448,450],{"class":325,"line":414},6,[323,416,417],{"class":400},"  env",[323,419,404],{"class":333},[323,421,334],{"class":333},[323,423,424],{"class":400}," service",[323,426,404],{"class":333},[323,428,347],{"class":333},[323,430,431],{"class":350},"my-api",[323,433,434],{"class":333},"'",[323,436,437],{"class":333},",",[323,439,440],{"class":400}," environment",[323,442,404],{"class":333},[323,444,347],{"class":333},[323,446,447],{"class":350},"production",[323,449,434],{"class":333},[323,451,452],{"class":333}," },\n",[323,454,456,459,461,464],{"class":325,"line":455},7,[323,457,458],{"class":400},"  pretty",[323,460,404],{"class":333},[323,462,463],{"class":407}," false",[323,465,411],{"class":333},[323,467,469,472,474,476],{"class":325,"line":468},8,[323,470,471],{"class":400},"  silent",[323,473,404],{"class":333},[323,475,463],{"class":407},[323,477,411],{"class":333},[323,479,481,484,486,488],{"class":325,"line":480},9,[323,482,483],{"class":400},"  stringify",[323,485,404],{"class":333},[323,487,408],{"class":407},[323,489,411],{"class":333},[323,491,493,496,498,500,503,505,507,510,512,516,519,522,524,527,530,533,535,538,540,543],{"class":325,"line":492},10,[323,494,495],{"class":400},"  sampling",[323,497,404],{"class":333},[323,499,334],{"class":333},[323,501,502],{"class":400}," rates",[323,504,404],{"class":333},[323,506,334],{"class":333},[323,508,509],{"class":400}," info",[323,511,404],{"class":333},[323,513,515],{"class":514},"sbssI"," 10",[323,517,518],{"class":333}," },",[323,520,521],{"class":400}," keep",[323,523,404],{"class":333},[323,525,526],{"class":337}," [",[323,528,529],{"class":333},"{",[323,531,532],{"class":400}," status",[323,534,404],{"class":333},[323,536,537],{"class":514}," 400",[323,539,341],{"class":333},[323,541,542],{"class":337},"] ",[323,544,545],{"class":333},"},\n",[323,547,549,552,554,556,559],{"class":325,"line":548},11,[323,550,551],{"class":400},"  drain",[323,553,404],{"class":333},[323,555,364],{"class":388},[323,557,558],{"class":337},"()",[323,560,411],{"class":333},[323,562,564,567],{"class":325,"line":563},12,[323,565,566],{"class":333},"}",[323,568,569],{"class":337},")\n",[571,572,573,592],"table",{},[574,575,576],"thead",{},[577,578,579,583,586,589],"tr",{},[580,581,582],"th",{},"Option",[580,584,585],{},"Type",[580,587,588],{},"Default",[580,590,591],{},"Description",[593,594,595,620,638,660,678,702,725],"tbody",{},[577,596,597,603,608,613],{},[598,599,600],"td",{},[301,601,602],{},"enabled",[598,604,605],{},[301,606,607],{},"boolean",[598,609,610],{},[301,611,612],{},"true",[598,614,615,616,619],{},"Enable\u002Fdisable all logging globally. When ",[301,617,618],{},"false",", all operations become no-ops",[577,621,622,627,632,635],{},[598,623,624],{},[301,625,626],{},"env",[598,628,629],{},[301,630,631],{},"Partial\u003CEnvironmentContext>",[598,633,634],{},"Auto-detected",[598,636,637],{},"Environment context overrides (see below)",[577,639,640,645,649,654],{},[598,641,642],{},[301,643,644],{},"pretty",[598,646,647],{},[301,648,607],{},[598,650,651,653],{},[301,652,612],{}," in dev",[598,655,656,657],{},"Pretty print with tree formatting. Auto-detected based on ",[301,658,659],{},"NODE_ENV",[577,661,662,667,671,675],{},[598,663,664],{},[301,665,666],{},"silent",[598,668,669],{},[301,670,607],{},[598,672,673],{},[301,674,618],{},[598,676,677],{},"Suppress console output. Events are still built, sampled, and passed to drains",[577,679,680,685,689,693],{},[598,681,682],{},[301,683,684],{},"stringify",[598,686,687],{},[301,688,607],{},[598,690,691],{},[301,692,612],{},[598,694,695,696,698,699,701],{},"Emit JSON strings when ",[301,697,644],{}," is disabled. Set to ",[301,700,618],{}," for Cloudflare Workers",[577,703,704,709,714,719],{},[598,705,706],{},[301,707,708],{},"sampling",[598,710,711],{},[301,712,713],{},"SamplingConfig",[598,715,716],{},[301,717,718],{},"undefined",[598,720,721,722],{},"Head and tail sampling configuration. See ",[723,724,81],"a",{"href":82},[577,726,727,732,737,741],{},[598,728,729],{},[301,730,731],{},"drain",[598,733,734],{},[301,735,736],{},"(ctx: DrainContext) => void",[598,738,739],{},[301,740,718],{},[598,742,743],{},"Drain callback for sending events to external services",[745,746,748],"h3",{"id":747},"environment-context","Environment Context",[283,750,751,752,754,755,758],{},"The ",[301,753,626],{}," option controls the fields included in every log event. Most values are auto-detected from environment variables and ",[301,756,757],{},"package.json",".",[571,760,761,775],{},[574,762,763],{},[577,764,765,768,770,772],{},[580,766,767],{},"Field",[580,769,585],{},[580,771,588],{},[580,773,774],{},"Auto-detected from",[593,776,777,803,823,846,872],{},[577,778,779,784,789,794],{},[598,780,781],{},[301,782,783],{},"service",[598,785,786],{},[301,787,788],{},"string",[598,790,791],{},[301,792,793],{},"'app'",[598,795,796,799,800,802],{},[301,797,798],{},"SERVICE_NAME",", ",[301,801,757],{}," name",[577,804,805,810,814,819],{},[598,806,807],{},[301,808,809],{},"environment",[598,811,812],{},[301,813,788],{},[598,815,816],{},[301,817,818],{},"'development'",[598,820,821],{},[301,822,659],{},[577,824,825,830,834,838],{},[598,826,827],{},[301,828,829],{},"version",[598,831,832],{},[301,833,788],{},[598,835,836],{},[301,837,718],{},[598,839,840,799,843,845],{},[301,841,842],{},"APP_VERSION",[301,844,757],{}," version",[577,847,848,853,857,861],{},[598,849,850],{},[301,851,852],{},"commitHash",[598,854,855],{},[301,856,788],{},[598,858,859],{},[301,860,718],{},[598,862,863,799,866,799,869],{},[301,864,865],{},"COMMIT_SHA",[301,867,868],{},"GIT_COMMIT",[301,870,871],{},"VERCEL_GIT_COMMIT_SHA",[577,873,874,879,883,887],{},[598,875,876],{},[301,877,878],{},"region",[598,880,881],{},[301,882,788],{},[598,884,885],{},[301,886,718],{},[598,888,889,799,892,799,895],{},[301,890,891],{},"FLY_REGION",[301,893,894],{},"AWS_REGION",[301,896,897],{},"VERCEL_REGION",[745,899,901],{"id":900},"silent-mode","Silent Mode",[283,903,904,905,907],{},"Use ",[301,906,666],{}," when your deployment platform captures stdout as its primary log ingestion (GCP Cloud Run, AWS Lambda, Fly.io, Railway, etc.) and you want a drain adapter to control the output format.",[313,909,911],{"className":315,"code":910,"filename":317,"language":318,"meta":319,"style":319},"import { initLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  silent: process.env.NODE_ENV === 'production',\n  drain: createAxiomDrain(),\n})\n",[301,912,913,931,949,953,961,990,1002],{"__ignoreMap":319},[323,914,915,917,919,921,923,925,927,929],{"class":325,"line":326},[323,916,330],{"class":329},[323,918,334],{"class":333},[323,920,338],{"class":337},[323,922,341],{"class":333},[323,924,344],{"class":329},[323,926,347],{"class":333},[323,928,351],{"class":350},[323,930,354],{"class":333},[323,932,933,935,937,939,941,943,945,947],{"class":325,"line":357},[323,934,330],{"class":329},[323,936,334],{"class":333},[323,938,364],{"class":337},[323,940,341],{"class":333},[323,942,344],{"class":329},[323,944,347],{"class":333},[323,946,373],{"class":350},[323,948,354],{"class":333},[323,950,951],{"class":325,"line":378},[323,952,382],{"emptyLinePlaceholder":381},[323,954,955,957,959],{"class":325,"line":385},[323,956,303],{"class":388},[323,958,391],{"class":337},[323,960,394],{"class":333},[323,962,963,965,967,970,972,974,976,979,982,984,986,988],{"class":325,"line":397},[323,964,471],{"class":400},[323,966,404],{"class":333},[323,968,969],{"class":337}," process",[323,971,758],{"class":333},[323,973,626],{"class":337},[323,975,758],{"class":333},[323,977,978],{"class":337},"NODE_ENV ",[323,980,981],{"class":333},"===",[323,983,347],{"class":333},[323,985,447],{"class":350},[323,987,434],{"class":333},[323,989,411],{"class":333},[323,991,992,994,996,998,1000],{"class":325,"line":414},[323,993,551],{"class":400},[323,995,404],{"class":333},[323,997,364],{"class":388},[323,999,558],{"class":337},[323,1001,411],{"class":333},[323,1003,1004,1006],{"class":325,"line":455},[323,1005,566],{"class":333},[323,1007,569],{"class":337},[1009,1010,1013,1014,1016],"callout",{"color":1011,"icon":1012},"warning","i-lucide-alert-triangle","If ",[301,1015,666],{}," is enabled without a drain, events are built and sampled but never output anywhere. evlog will warn you about this at startup.",[296,1018,1020],{"id":1019},"middleware-options","Middleware Options",[283,1022,1023],{},"These options are passed to the framework middleware\u002Fplugin. They control per-request behavior: which routes to log, how to drain and enrich events, and custom tail sampling logic.",[1025,1026,1027,1245,1342],"code-group",{},[313,1028,1030],{"className":315,"code":1029,"filename":150,"language":318,"meta":319,"style":319},"app.use(evlog({\n  include: ['\u002Fapi\u002F**'],\n  exclude: ['\u002Fapi\u002Fhealth'],\n  routes: { '\u002Fapi\u002Fauth\u002F**': { service: 'auth' } },\n  drain: createAxiomDrain(),\n  enrich: (ctx) => { ctx.event.region = process.env.FLY_REGION },\n  keep: (ctx) => { if (ctx.duration > 2000) ctx.shouldKeep = true },\n}))\n",[301,1031,1032,1050,1071,1091,1126,1138,1187,1238],{"__ignoreMap":319},[323,1033,1034,1037,1039,1042,1044,1046,1048],{"class":325,"line":326},[323,1035,1036],{"class":337},"app",[323,1038,758],{"class":333},[323,1040,1041],{"class":388},"use",[323,1043,391],{"class":337},[323,1045,351],{"class":388},[323,1047,391],{"class":337},[323,1049,394],{"class":333},[323,1051,1052,1055,1057,1059,1061,1064,1066,1069],{"class":325,"line":357},[323,1053,1054],{"class":400},"  include",[323,1056,404],{"class":333},[323,1058,526],{"class":337},[323,1060,434],{"class":333},[323,1062,1063],{"class":350},"\u002Fapi\u002F**",[323,1065,434],{"class":333},[323,1067,1068],{"class":337},"]",[323,1070,411],{"class":333},[323,1072,1073,1076,1078,1080,1082,1085,1087,1089],{"class":325,"line":378},[323,1074,1075],{"class":400},"  exclude",[323,1077,404],{"class":333},[323,1079,526],{"class":337},[323,1081,434],{"class":333},[323,1083,1084],{"class":350},"\u002Fapi\u002Fhealth",[323,1086,434],{"class":333},[323,1088,1068],{"class":337},[323,1090,411],{"class":333},[323,1092,1093,1096,1098,1100,1102,1105,1107,1109,1111,1113,1115,1117,1120,1122,1124],{"class":325,"line":385},[323,1094,1095],{"class":400},"  routes",[323,1097,404],{"class":333},[323,1099,334],{"class":333},[323,1101,347],{"class":333},[323,1103,1104],{"class":400},"\u002Fapi\u002Fauth\u002F**",[323,1106,434],{"class":333},[323,1108,404],{"class":333},[323,1110,334],{"class":333},[323,1112,424],{"class":400},[323,1114,404],{"class":333},[323,1116,347],{"class":333},[323,1118,1119],{"class":350},"auth",[323,1121,434],{"class":333},[323,1123,341],{"class":333},[323,1125,452],{"class":333},[323,1127,1128,1130,1132,1134,1136],{"class":325,"line":397},[323,1129,551],{"class":400},[323,1131,404],{"class":333},[323,1133,364],{"class":388},[323,1135,558],{"class":337},[323,1137,411],{"class":333},[323,1139,1140,1143,1145,1148,1152,1154,1158,1160,1163,1165,1168,1170,1172,1175,1177,1179,1181,1183,1185],{"class":325,"line":414},[323,1141,1142],{"class":388},"  enrich",[323,1144,404],{"class":333},[323,1146,1147],{"class":333}," (",[323,1149,1151],{"class":1150},"sHdIc","ctx",[323,1153,304],{"class":333},[323,1155,1157],{"class":1156},"spNyl"," =>",[323,1159,334],{"class":333},[323,1161,1162],{"class":337}," ctx",[323,1164,758],{"class":333},[323,1166,1167],{"class":337},"event",[323,1169,758],{"class":333},[323,1171,878],{"class":337},[323,1173,1174],{"class":333}," =",[323,1176,969],{"class":337},[323,1178,758],{"class":333},[323,1180,626],{"class":337},[323,1182,758],{"class":333},[323,1184,891],{"class":337},[323,1186,452],{"class":333},[323,1188,1189,1192,1194,1196,1198,1200,1202,1204,1207,1209,1211,1213,1216,1219,1222,1225,1227,1229,1232,1234,1236],{"class":325,"line":455},[323,1190,1191],{"class":388},"  keep",[323,1193,404],{"class":333},[323,1195,1147],{"class":333},[323,1197,1151],{"class":1150},[323,1199,304],{"class":333},[323,1201,1157],{"class":1156},[323,1203,334],{"class":333},[323,1205,1206],{"class":329}," if",[323,1208,1147],{"class":400},[323,1210,1151],{"class":337},[323,1212,758],{"class":333},[323,1214,1215],{"class":337},"duration",[323,1217,1218],{"class":333}," >",[323,1220,1221],{"class":514}," 2000",[323,1223,1224],{"class":400},") ",[323,1226,1151],{"class":337},[323,1228,758],{"class":333},[323,1230,1231],{"class":337},"shouldKeep",[323,1233,1174],{"class":333},[323,1235,408],{"class":407},[323,1237,452],{"class":333},[323,1239,1240,1242],{"class":325,"line":468},[323,1241,566],{"class":333},[323,1243,1244],{"class":337},"))\n",[313,1246,1248],{"className":315,"code":1247,"filename":145,"language":318,"meta":319,"style":319},"app.use(evlog({\n  include: ['\u002Fapi\u002F**'],\n  drain: createAxiomDrain(),\n  enrich: (ctx) => { ctx.event.region = process.env.FLY_REGION },\n}))\n",[301,1249,1250,1266,1284,1296,1336],{"__ignoreMap":319},[323,1251,1252,1254,1256,1258,1260,1262,1264],{"class":325,"line":326},[323,1253,1036],{"class":337},[323,1255,758],{"class":333},[323,1257,1041],{"class":388},[323,1259,391],{"class":337},[323,1261,351],{"class":388},[323,1263,391],{"class":337},[323,1265,394],{"class":333},[323,1267,1268,1270,1272,1274,1276,1278,1280,1282],{"class":325,"line":357},[323,1269,1054],{"class":400},[323,1271,404],{"class":333},[323,1273,526],{"class":337},[323,1275,434],{"class":333},[323,1277,1063],{"class":350},[323,1279,434],{"class":333},[323,1281,1068],{"class":337},[323,1283,411],{"class":333},[323,1285,1286,1288,1290,1292,1294],{"class":325,"line":378},[323,1287,551],{"class":400},[323,1289,404],{"class":333},[323,1291,364],{"class":388},[323,1293,558],{"class":337},[323,1295,411],{"class":333},[323,1297,1298,1300,1302,1304,1306,1308,1310,1312,1314,1316,1318,1320,1322,1324,1326,1328,1330,1332,1334],{"class":325,"line":385},[323,1299,1142],{"class":388},[323,1301,404],{"class":333},[323,1303,1147],{"class":333},[323,1305,1151],{"class":1150},[323,1307,304],{"class":333},[323,1309,1157],{"class":1156},[323,1311,334],{"class":333},[323,1313,1162],{"class":337},[323,1315,758],{"class":333},[323,1317,1167],{"class":337},[323,1319,758],{"class":333},[323,1321,878],{"class":337},[323,1323,1174],{"class":333},[323,1325,969],{"class":337},[323,1327,758],{"class":333},[323,1329,626],{"class":337},[323,1331,758],{"class":333},[323,1333,891],{"class":337},[323,1335,452],{"class":333},[323,1337,1338,1340],{"class":325,"line":397},[323,1339,566],{"class":333},[323,1341,1244],{"class":337},[313,1343,1345],{"className":315,"code":1344,"filename":155,"language":318,"meta":319,"style":319},"await app.register(evlog, {\n  include: ['\u002Fapi\u002F**'],\n  drain: createAxiomDrain(),\n})\n",[301,1346,1347,1368,1386,1398],{"__ignoreMap":319},[323,1348,1349,1352,1355,1357,1360,1363,1365],{"class":325,"line":326},[323,1350,1351],{"class":329},"await",[323,1353,1354],{"class":337}," app",[323,1356,758],{"class":333},[323,1358,1359],{"class":388},"register",[323,1361,1362],{"class":337},"(evlog",[323,1364,437],{"class":333},[323,1366,1367],{"class":333}," {\n",[323,1369,1370,1372,1374,1376,1378,1380,1382,1384],{"class":325,"line":357},[323,1371,1054],{"class":400},[323,1373,404],{"class":333},[323,1375,526],{"class":337},[323,1377,434],{"class":333},[323,1379,1063],{"class":350},[323,1381,434],{"class":333},[323,1383,1068],{"class":337},[323,1385,411],{"class":333},[323,1387,1388,1390,1392,1394,1396],{"class":325,"line":378},[323,1389,551],{"class":400},[323,1391,404],{"class":333},[323,1393,364],{"class":388},[323,1395,558],{"class":337},[323,1397,411],{"class":333},[323,1399,1400,1402],{"class":325,"line":385},[323,1401,566],{"class":333},[323,1403,569],{"class":337},[571,1405,1406,1418],{},[574,1407,1408],{},[577,1409,1410,1412,1414,1416],{},[580,1411,582],{},[580,1413,585],{},[580,1415,588],{},[580,1417,591],{},[593,1419,1420,1439,1457,1476,1493,1512],{},[577,1421,1422,1427,1432,1436],{},[598,1423,1424],{},[301,1425,1426],{},"include",[598,1428,1429],{},[301,1430,1431],{},"string[]",[598,1433,1434],{},[301,1435,718],{},[598,1437,1438],{},"Route glob patterns to log. If not set, all routes are logged",[577,1440,1441,1446,1450,1454],{},[598,1442,1443],{},[301,1444,1445],{},"exclude",[598,1447,1448],{},[301,1449,1431],{},[598,1451,1452],{},[301,1453,718],{},[598,1455,1456],{},"Route patterns to exclude. Exclusions take precedence over inclusions",[577,1458,1459,1464,1469,1473],{},[598,1460,1461],{},[301,1462,1463],{},"routes",[598,1465,1466],{},[301,1467,1468],{},"Record\u003Cstring, { service: string }>",[598,1470,1471],{},[301,1472,718],{},[598,1474,1475],{},"Route-specific service name overrides",[577,1477,1478,1482,1486,1490],{},[598,1479,1480],{},[301,1481,731],{},[598,1483,1484],{},[301,1485,736],{},[598,1487,1488],{},[301,1489,718],{},[598,1491,1492],{},"Drain callback called with every emitted event",[577,1494,1495,1500,1505,1509],{},[598,1496,1497],{},[301,1498,1499],{},"enrich",[598,1501,1502],{},[301,1503,1504],{},"(ctx: EnrichContext) => void",[598,1506,1507],{},[301,1508,718],{},[598,1510,1511],{},"Enrich callback called after emit, before drain",[577,1513,1514,1519,1524,1528],{},[598,1515,1516],{},[301,1517,1518],{},"keep",[598,1520,1521],{},[301,1522,1523],{},"(ctx: TailSamplingContext) => void",[598,1525,1526],{},[301,1527,718],{},[598,1529,1530],{},"Custom tail sampling callback",[1009,1532,1534,1537,1538,799,1541,799,1544,1547,1548,1550,1551,1553],{"color":1533,"icon":13},"info",[287,1535,1536],{},"Nuxt and Nitro"," use module config and Nitro hooks (",[301,1539,1540],{},"evlog:drain",[301,1542,1543],{},"evlog:enrich",[301,1545,1546],{},"evlog:emit:keep",") instead of middleware options. See the ",[723,1549,115],{"href":116}," and ",[723,1552,130],{"href":131}," pages.",[745,1555,1557],{"id":1556},"middleware-drain-vs-global-drain","Middleware drain vs global drain",[283,1559,1560,1561,1563,1564,1566],{},"When a middleware ",[301,1562,731],{}," is set, it takes precedence over the global drain from ",[301,1565,310],{},". If no middleware drain is set, the global drain is used as fallback, with the benefit of receiving the full enriched event with request context (method, path, headers).",[313,1568,1570],{"className":315,"code":1569,"filename":317,"language":318,"meta":319,"style":319},"import { initLogger } from 'evlog'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\ninitLogger({\n  env: { service: 'my-api' },\n  drain: createAxiomDrain(), \u002F\u002F fallback: used by singleton log API AND middleware (if no middleware drain)\n})\n\napp.use(evlog({\n  \u002F\u002F no drain here - falls back to globalDrain from initLogger, with full request context\n}))\n",[301,1571,1572,1590,1608,1612,1620,1640,1656,1662,1666,1682,1687],{"__ignoreMap":319},[323,1573,1574,1576,1578,1580,1582,1584,1586,1588],{"class":325,"line":326},[323,1575,330],{"class":329},[323,1577,334],{"class":333},[323,1579,338],{"class":337},[323,1581,341],{"class":333},[323,1583,344],{"class":329},[323,1585,347],{"class":333},[323,1587,351],{"class":350},[323,1589,354],{"class":333},[323,1591,1592,1594,1596,1598,1600,1602,1604,1606],{"class":325,"line":357},[323,1593,330],{"class":329},[323,1595,334],{"class":333},[323,1597,364],{"class":337},[323,1599,341],{"class":333},[323,1601,344],{"class":329},[323,1603,347],{"class":333},[323,1605,373],{"class":350},[323,1607,354],{"class":333},[323,1609,1610],{"class":325,"line":378},[323,1611,382],{"emptyLinePlaceholder":381},[323,1613,1614,1616,1618],{"class":325,"line":385},[323,1615,303],{"class":388},[323,1617,391],{"class":337},[323,1619,394],{"class":333},[323,1621,1622,1624,1626,1628,1630,1632,1634,1636,1638],{"class":325,"line":397},[323,1623,417],{"class":400},[323,1625,404],{"class":333},[323,1627,334],{"class":333},[323,1629,424],{"class":400},[323,1631,404],{"class":333},[323,1633,347],{"class":333},[323,1635,431],{"class":350},[323,1637,434],{"class":333},[323,1639,452],{"class":333},[323,1641,1642,1644,1646,1648,1650,1652],{"class":325,"line":414},[323,1643,551],{"class":400},[323,1645,404],{"class":333},[323,1647,364],{"class":388},[323,1649,558],{"class":337},[323,1651,437],{"class":333},[323,1653,1655],{"class":1654},"sHwdD"," \u002F\u002F fallback: used by singleton log API AND middleware (if no middleware drain)\n",[323,1657,1658,1660],{"class":325,"line":455},[323,1659,566],{"class":333},[323,1661,569],{"class":337},[323,1663,1664],{"class":325,"line":468},[323,1665,382],{"emptyLinePlaceholder":381},[323,1667,1668,1670,1672,1674,1676,1678,1680],{"class":325,"line":480},[323,1669,1036],{"class":337},[323,1671,758],{"class":333},[323,1673,1041],{"class":388},[323,1675,391],{"class":337},[323,1677,351],{"class":388},[323,1679,391],{"class":337},[323,1681,394],{"class":333},[323,1683,1684],{"class":325,"line":492},[323,1685,1686],{"class":1654},"  \u002F\u002F no drain here - falls back to globalDrain from initLogger, with full request context\n",[323,1688,1689,1691],{"class":325,"line":548},[323,1690,566],{"class":333},[323,1692,1244],{"class":337},[296,1694,1696],{"id":1695},"framework-specific-options","Framework-Specific Options",[283,1698,1699],{},"Some frameworks have additional options beyond the shared config:",[745,1701,115],{"id":1702},"nuxt",[283,1704,1705,1706,1709,1710,1712],{},"The Nuxt module accepts all global options and middleware options in ",[301,1707,1708],{},"nuxt.config.ts"," under the ",[301,1711,351],{}," key, plus:",[571,1714,1715,1727],{},[574,1716,1717],{},[577,1718,1719,1721,1723,1725],{},[580,1720,582],{},[580,1722,585],{},[580,1724,588],{},[580,1726,591],{},[593,1728,1729,1747,1765,1784],{},[577,1730,1731,1736,1740,1744],{},[598,1732,1733],{},[301,1734,1735],{},"console",[598,1737,1738],{},[301,1739,607],{},[598,1741,1742],{},[301,1743,612],{},[598,1745,1746],{},"Enable\u002Fdisable browser console output (client-side only)",[577,1748,1749,1754,1758,1762],{},[598,1750,1751],{},[301,1752,1753],{},"transport.enabled",[598,1755,1756],{},[301,1757,607],{},[598,1759,1760],{},[301,1761,618],{},[598,1763,1764],{},"Send client logs to the server via API endpoint",[577,1766,1767,1772,1776,1781],{},[598,1768,1769],{},[301,1770,1771],{},"transport.endpoint",[598,1773,1774],{},[301,1775,788],{},[598,1777,1778],{},[301,1779,1780],{},"'\u002Fapi\u002F_evlog\u002Fingest'",[598,1782,1783],{},"Custom transport endpoint",[577,1785,1786,1791,1796,1801],{},[598,1787,1788],{},[301,1789,1790],{},"transport.credentials",[598,1792,1793],{},[301,1794,1795],{},"RequestCredentials",[598,1797,1798],{},[301,1799,1800],{},"'same-origin'",[598,1802,1803,1804,1807],{},"Fetch credentials mode (",[301,1805,1806],{},"'include'"," for cross-origin endpoints)",[283,1809,1810,1811,758],{},"See the full ",[723,1812,1814],{"href":1813},"\u002Fframeworks\u002Fnuxt#configuration","Nuxt configuration",[745,1816,130],{"id":1817},"nitro",[283,1819,1820,1821,799,1823,799,1825,799,1827,799,1829,799,1831,799,1833,1835,1836,1838,1839,1842],{},"The Nitro module accepts ",[301,1822,602],{},[301,1824,626],{},[301,1826,644],{},[301,1828,666],{},[301,1830,708],{},[301,1832,1426],{},[301,1834,1445],{},", and ",[301,1837,1463],{}," in ",[301,1840,1841],{},"nitro.config.ts",". Drain and enrichment are done via Nitro hooks.",[283,1844,1845,1846,758],{},"See ",[723,1847,1849],{"href":1848},"\u002Fframeworks\u002Fnitro#drain--enrichers","Nitro drain & enrichers",[1851,1852,1853],"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .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 .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}",{"title":319,"searchDepth":357,"depth":357,"links":1855},[1856,1861,1864],{"id":298,"depth":357,"text":1857,"children":1858},"Global Options (initLogger)",[1859,1860],{"id":747,"depth":378,"text":748},{"id":900,"depth":378,"text":901},{"id":1019,"depth":357,"text":1020,"children":1862},[1863],{"id":1556,"depth":378,"text":1557},{"id":1695,"depth":357,"text":1696,"children":1865},[1866,1867],{"id":1702,"depth":378,"text":115},{"id":1817,"depth":378,"text":130},"Complete reference for all evlog configuration options including global logger settings, middleware options, environment context, and framework-specific overrides.","md",[1871,1874],{"label":81,"icon":84,"to":82,"color":1872,"variant":1873},"neutral","subtle",{"label":1875,"icon":271,"to":194,"color":1872,"variant":1873},"Drain Adapters",{},{"icon":79},{"title":76,"description":1868},"MRaUipb90M9N8vHgy2JfzFc22Yuuz0ULougAs66K8Ew",[1881,1883],{"title":71,"path":72,"stem":73,"description":1882,"icon":74,"children":-1},"Understand the full lifecycle of an evlog event, from creation to drain. Covers all three modes (simple logging, wide events, request logging), sampling, enrichment, and delivery.",{"title":81,"path":82,"stem":83,"description":1884,"icon":84,"children":-1},"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.",1775317219688]