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