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