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