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