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