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