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