[{"data":1,"prerenderedAt":1843},["ShallowReactive",2],{"navigation_docs":3,"-core-concepts-typed-fields":238,"-core-concepts-typed-fields-surround":1838},[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":136,"body":240,"description":1827,"extension":1828,"links":1829,"meta":1834,"navigation":1835,"path":137,"seo":1836,"stem":138,"__hash__":1837},"docs\u002F3.core-concepts\u002F4.typed-fields.md",{"type":241,"value":242,"toc":1816},"minimark",[243,264,269,275,738,741,745,760,824,833,837,843,912,915,919,934,1067,1070,1074,1084,1380,1384,1389,1392,1570,1676,1680,1683,1812],[244,245,246,247,251,252,255,256,259,260,263],"p",{},"By default, ",[248,249,250],"code",{},"useLogger"," accepts any fields, which is great for getting started. But as your codebase grows, inconsistencies creep in: one route logs ",[248,253,254],{},"user",", another logs ",[248,257,258],{},"account",", a third logs ",[248,261,262],{},"userId",". Typed fields solve this with opt-in compile-time safety.",[265,266,268],"h2",{"id":267},"basic-usage","Basic Usage",[244,270,271,272,274],{},"Define an interface for your fields and pass it as a generic to ",[248,273,250],{},":",[276,277,283],"pre",{"className":278,"code":279,"filename":280,"language":281,"meta":282,"style":282},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { useLogger } from 'evlog'\n\ninterface CheckoutFields {\n  user: { id: string; plan: string }\n  cart: { items: number; total: number }\n  action: string\n}\n\nexport default defineEventHandler(async (event) => {\n  const log = useLogger\u003CCheckoutFields>(event)\n\n  log.set({ user: { id: '123', plan: 'pro' } })  \u002F\u002F OK\n  log.set({ cart: { items: 3, total: 9999 } })    \u002F\u002F OK\n  log.set({ action: 'checkout' })                  \u002F\u002F OK\n\n  log.set({ account: '...' })                      \u002F\u002F TS error\n  log.set({ usr: { id: '123' } })                  \u002F\u002F TS error\n\n  return { success: true }\n})\n","server\u002Fapi\u002Fcheckout.post.ts","typescript","",[248,284,285,318,325,339,371,400,411,417,422,456,486,491,552,598,630,635,668,706,711,730],{"__ignoreMap":282},[286,287,290,294,298,302,305,308,311,315],"span",{"class":288,"line":289},"line",1,[286,291,293],{"class":292},"s7zQu","import",[286,295,297],{"class":296},"sMK4o"," {",[286,299,301],{"class":300},"sTEyZ"," useLogger",[286,303,304],{"class":296}," }",[286,306,307],{"class":292}," from",[286,309,310],{"class":296}," '",[286,312,314],{"class":313},"sfazB","evlog",[286,316,317],{"class":296},"'\n",[286,319,321],{"class":288,"line":320},2,[286,322,324],{"emptyLinePlaceholder":323},true,"\n",[286,326,328,332,336],{"class":288,"line":327},3,[286,329,331],{"class":330},"spNyl","interface",[286,333,335],{"class":334},"sBMFI"," CheckoutFields",[286,337,338],{"class":296}," {\n",[286,340,342,346,348,350,353,355,358,361,364,366,368],{"class":288,"line":341},4,[286,343,345],{"class":344},"swJcz","  user",[286,347,274],{"class":296},[286,349,297],{"class":296},[286,351,352],{"class":344}," id",[286,354,274],{"class":296},[286,356,357],{"class":334}," string",[286,359,360],{"class":296},";",[286,362,363],{"class":344}," plan",[286,365,274],{"class":296},[286,367,357],{"class":334},[286,369,370],{"class":296}," }\n",[286,372,374,377,379,381,384,386,389,391,394,396,398],{"class":288,"line":373},5,[286,375,376],{"class":344},"  cart",[286,378,274],{"class":296},[286,380,297],{"class":296},[286,382,383],{"class":344}," items",[286,385,274],{"class":296},[286,387,388],{"class":334}," number",[286,390,360],{"class":296},[286,392,393],{"class":344}," total",[286,395,274],{"class":296},[286,397,388],{"class":334},[286,399,370],{"class":296},[286,401,403,406,408],{"class":288,"line":402},6,[286,404,405],{"class":344},"  action",[286,407,274],{"class":296},[286,409,410],{"class":334}," string\n",[286,412,414],{"class":288,"line":413},7,[286,415,416],{"class":296},"}\n",[286,418,420],{"class":288,"line":419},8,[286,421,324],{"emptyLinePlaceholder":323},[286,423,425,428,431,435,438,441,444,448,451,454],{"class":288,"line":424},9,[286,426,427],{"class":292},"export",[286,429,430],{"class":292}," default",[286,432,434],{"class":433},"s2Zo4"," defineEventHandler",[286,436,437],{"class":300},"(",[286,439,440],{"class":330},"async",[286,442,443],{"class":296}," (",[286,445,447],{"class":446},"sHdIc","event",[286,449,450],{"class":296},")",[286,452,453],{"class":330}," =>",[286,455,338],{"class":296},[286,457,459,462,465,468,470,473,476,479,481,483],{"class":288,"line":458},10,[286,460,461],{"class":330},"  const",[286,463,464],{"class":300}," log",[286,466,467],{"class":296}," =",[286,469,301],{"class":433},[286,471,472],{"class":296},"\u003C",[286,474,475],{"class":334},"CheckoutFields",[286,477,478],{"class":296},">",[286,480,437],{"class":344},[286,482,447],{"class":300},[286,484,485],{"class":344},")\n",[286,487,489],{"class":288,"line":488},11,[286,490,324],{"emptyLinePlaceholder":323},[286,492,494,497,500,503,505,508,511,513,515,517,519,521,524,527,530,532,534,536,539,541,543,545,548],{"class":288,"line":493},12,[286,495,496],{"class":300},"  log",[286,498,499],{"class":296},".",[286,501,502],{"class":433},"set",[286,504,437],{"class":344},[286,506,507],{"class":296},"{",[286,509,510],{"class":344}," user",[286,512,274],{"class":296},[286,514,297],{"class":296},[286,516,352],{"class":344},[286,518,274],{"class":296},[286,520,310],{"class":296},[286,522,523],{"class":313},"123",[286,525,526],{"class":296},"'",[286,528,529],{"class":296},",",[286,531,363],{"class":344},[286,533,274],{"class":296},[286,535,310],{"class":296},[286,537,538],{"class":313},"pro",[286,540,526],{"class":296},[286,542,304],{"class":296},[286,544,304],{"class":296},[286,546,547],{"class":344},")  ",[286,549,551],{"class":550},"sHwdD","\u002F\u002F OK\n",[286,553,555,557,559,561,563,565,568,570,572,574,576,580,582,584,586,589,591,593,596],{"class":288,"line":554},13,[286,556,496],{"class":300},[286,558,499],{"class":296},[286,560,502],{"class":433},[286,562,437],{"class":344},[286,564,507],{"class":296},[286,566,567],{"class":344}," cart",[286,569,274],{"class":296},[286,571,297],{"class":296},[286,573,383],{"class":344},[286,575,274],{"class":296},[286,577,579],{"class":578},"sbssI"," 3",[286,581,529],{"class":296},[286,583,393],{"class":344},[286,585,274],{"class":296},[286,587,588],{"class":578}," 9999",[286,590,304],{"class":296},[286,592,304],{"class":296},[286,594,595],{"class":344},")    ",[286,597,551],{"class":550},[286,599,601,603,605,607,609,611,614,616,618,621,623,625,628],{"class":288,"line":600},14,[286,602,496],{"class":300},[286,604,499],{"class":296},[286,606,502],{"class":433},[286,608,437],{"class":344},[286,610,507],{"class":296},[286,612,613],{"class":344}," action",[286,615,274],{"class":296},[286,617,310],{"class":296},[286,619,620],{"class":313},"checkout",[286,622,526],{"class":296},[286,624,304],{"class":296},[286,626,627],{"class":344},")                  ",[286,629,551],{"class":550},[286,631,633],{"class":288,"line":632},15,[286,634,324],{"emptyLinePlaceholder":323},[286,636,638,640,642,644,646,648,651,653,655,658,660,662,665],{"class":288,"line":637},16,[286,639,496],{"class":300},[286,641,499],{"class":296},[286,643,502],{"class":433},[286,645,437],{"class":344},[286,647,507],{"class":296},[286,649,650],{"class":344}," account",[286,652,274],{"class":296},[286,654,310],{"class":296},[286,656,657],{"class":313},"...",[286,659,526],{"class":296},[286,661,304],{"class":296},[286,663,664],{"class":344},")                      ",[286,666,667],{"class":550},"\u002F\u002F TS error\n",[286,669,671,673,675,677,679,681,684,686,688,690,692,694,696,698,700,702,704],{"class":288,"line":670},17,[286,672,496],{"class":300},[286,674,499],{"class":296},[286,676,502],{"class":433},[286,678,437],{"class":344},[286,680,507],{"class":296},[286,682,683],{"class":344}," usr",[286,685,274],{"class":296},[286,687,297],{"class":296},[286,689,352],{"class":344},[286,691,274],{"class":296},[286,693,310],{"class":296},[286,695,523],{"class":313},[286,697,526],{"class":296},[286,699,304],{"class":296},[286,701,304],{"class":296},[286,703,627],{"class":344},[286,705,667],{"class":550},[286,707,709],{"class":288,"line":708},18,[286,710,324],{"emptyLinePlaceholder":323},[286,712,714,717,719,722,724,728],{"class":288,"line":713},19,[286,715,716],{"class":292},"  return",[286,718,297],{"class":296},[286,720,721],{"class":344}," success",[286,723,274],{"class":296},[286,725,727],{"class":726},"sfNiH"," true",[286,729,370],{"class":296},[286,731,733,736],{"class":288,"line":732},20,[286,734,735],{"class":296},"}",[286,737,485],{"class":300},[244,739,740],{},"TypeScript catches typos and unknown fields at compile time, before they reach production.",[265,742,744],{"id":743},"internal-fields","Internal Fields",[244,746,747,748,751,752,755,756,759],{},"evlog sets some fields internally (",[248,749,750],{},"status",", ",[248,753,754],{},"service","). These are always accepted regardless of your type, through the ",[248,757,758],{},"InternalFields"," type:",[276,761,763],{"className":278,"code":762,"language":281,"meta":282,"style":282},"log.set({ status: 200 })    \u002F\u002F OK - internal field\nlog.set({ service: 'api' }) \u002F\u002F OK - internal field\n",[248,764,765,793],{"__ignoreMap":282},[286,766,767,770,772,774,776,778,781,783,786,788,790],{"class":288,"line":289},[286,768,769],{"class":300},"log",[286,771,499],{"class":296},[286,773,502],{"class":433},[286,775,437],{"class":300},[286,777,507],{"class":296},[286,779,780],{"class":344}," status",[286,782,274],{"class":296},[286,784,785],{"class":578}," 200",[286,787,304],{"class":296},[286,789,595],{"class":300},[286,791,792],{"class":550},"\u002F\u002F OK - internal field\n",[286,794,795,797,799,801,803,805,808,810,812,815,817,819,822],{"class":288,"line":320},[286,796,769],{"class":300},[286,798,499],{"class":296},[286,800,502],{"class":433},[286,802,437],{"class":300},[286,804,507],{"class":296},[286,806,807],{"class":344}," service",[286,809,274],{"class":296},[286,811,310],{"class":296},[286,813,814],{"class":313},"api",[286,816,526],{"class":296},[286,818,304],{"class":296},[286,820,821],{"class":300},") ",[286,823,792],{"class":550},[244,825,826,827,829,830,832],{},"You don't need to include ",[248,828,750],{}," or ",[248,831,754],{}," in your interface.",[265,834,836],{"id":835},"untyped-usage","Untyped Usage",[244,838,839,840,842],{},"Without a generic, ",[248,841,250],{}," accepts any fields as usual:",[276,844,846],{"className":278,"code":845,"language":281,"meta":282,"style":282},"const log = useLogger(event)\nlog.set({ anything: true, nested: { deep: 'value' } }) \u002F\u002F OK\n",[248,847,848,864],{"__ignoreMap":282},[286,849,850,853,856,859,861],{"class":288,"line":289},[286,851,852],{"class":330},"const",[286,854,855],{"class":300}," log ",[286,857,858],{"class":296},"=",[286,860,301],{"class":433},[286,862,863],{"class":300},"(event)\n",[286,865,866,868,870,872,874,876,879,881,883,885,888,890,892,895,897,899,902,904,906,908,910],{"class":288,"line":320},[286,867,769],{"class":300},[286,869,499],{"class":296},[286,871,502],{"class":433},[286,873,437],{"class":300},[286,875,507],{"class":296},[286,877,878],{"class":344}," anything",[286,880,274],{"class":296},[286,882,727],{"class":726},[286,884,529],{"class":296},[286,886,887],{"class":344}," nested",[286,889,274],{"class":296},[286,891,297],{"class":296},[286,893,894],{"class":344}," deep",[286,896,274],{"class":296},[286,898,310],{"class":296},[286,900,901],{"class":313},"value",[286,903,526],{"class":296},[286,905,304],{"class":296},[286,907,304],{"class":296},[286,909,821],{"class":300},[286,911,551],{"class":550},[244,913,914],{},"Typed fields are fully opt-in.",[265,916,918],{"id":917},"nuxt-auto-import","Nuxt Auto-Import",[920,921,924,925,928,929,933],"callout",{"color":922,"icon":923},"warning","i-lucide-triangle-alert","When using typed fields with ",[248,926,927],{},"useLogger\u003CT>",", you ",[930,931,932],"strong",{},"must"," use an explicit import. The Nuxt auto-import does not support excess property checking for generics due to a TypeScript limitation.",[276,935,937],{"className":278,"code":936,"language":281,"meta":282,"style":282},"\u002F\u002F Works - explicit import preserves type checking\nimport { useLogger } from 'evlog'\nconst log = useLogger\u003CMyFields>(event)\nlog.set({ typo: 'oops' }) \u002F\u002F TS error\n\n\u002F\u002F Does NOT work - auto-import loses excess property checking\nconst log = useLogger\u003CMyFields>(event)\nlog.set({ typo: 'oops' }) \u002F\u002F No error (silently accepted)\n",[248,938,939,944,962,981,1011,1015,1020,1038],{"__ignoreMap":282},[286,940,941],{"class":288,"line":289},[286,942,943],{"class":550},"\u002F\u002F Works - explicit import preserves type checking\n",[286,945,946,948,950,952,954,956,958,960],{"class":288,"line":320},[286,947,293],{"class":292},[286,949,297],{"class":296},[286,951,301],{"class":300},[286,953,304],{"class":296},[286,955,307],{"class":292},[286,957,310],{"class":296},[286,959,314],{"class":313},[286,961,317],{"class":296},[286,963,964,966,968,970,972,974,977,979],{"class":288,"line":327},[286,965,852],{"class":330},[286,967,855],{"class":300},[286,969,858],{"class":296},[286,971,301],{"class":433},[286,973,472],{"class":296},[286,975,976],{"class":334},"MyFields",[286,978,478],{"class":296},[286,980,863],{"class":300},[286,982,983,985,987,989,991,993,996,998,1000,1003,1005,1007,1009],{"class":288,"line":341},[286,984,769],{"class":300},[286,986,499],{"class":296},[286,988,502],{"class":433},[286,990,437],{"class":300},[286,992,507],{"class":296},[286,994,995],{"class":344}," typo",[286,997,274],{"class":296},[286,999,310],{"class":296},[286,1001,1002],{"class":313},"oops",[286,1004,526],{"class":296},[286,1006,304],{"class":296},[286,1008,821],{"class":300},[286,1010,667],{"class":550},[286,1012,1013],{"class":288,"line":373},[286,1014,324],{"emptyLinePlaceholder":323},[286,1016,1017],{"class":288,"line":402},[286,1018,1019],{"class":550},"\u002F\u002F Does NOT work - auto-import loses excess property checking\n",[286,1021,1022,1024,1026,1028,1030,1032,1034,1036],{"class":288,"line":413},[286,1023,852],{"class":330},[286,1025,855],{"class":300},[286,1027,858],{"class":296},[286,1029,301],{"class":433},[286,1031,472],{"class":296},[286,1033,976],{"class":334},[286,1035,478],{"class":296},[286,1037,863],{"class":300},[286,1039,1040,1042,1044,1046,1048,1050,1052,1054,1056,1058,1060,1062,1064],{"class":288,"line":419},[286,1041,769],{"class":300},[286,1043,499],{"class":296},[286,1045,502],{"class":433},[286,1047,437],{"class":300},[286,1049,507],{"class":296},[286,1051,995],{"class":344},[286,1053,274],{"class":296},[286,1055,310],{"class":296},[286,1057,1002],{"class":313},[286,1059,526],{"class":296},[286,1061,304],{"class":296},[286,1063,821],{"class":300},[286,1065,1066],{"class":550},"\u002F\u002F No error (silently accepted)\n",[244,1068,1069],{},"The auto-import works perfectly for untyped usage. Only add the explicit import when you need typed fields.",[265,1071,1073],{"id":1072},"outside-nuxt","Outside Nuxt",[244,1075,1076,1077,1080,1081,274],{},"The same generic works with ",[248,1078,1079],{},"createRequestLogger"," and ",[248,1082,1083],{},"createWorkersLogger",[1085,1086,1087,1279],"code-group",{},[276,1088,1090],{"className":278,"code":1089,"filename":96,"language":281,"meta":282,"style":282},"import { createRequestLogger } from 'evlog'\n\ninterface MyFields {\n  action: string\n  userId: string\n}\n\nconst log = createRequestLogger\u003CMyFields>({\n  method: 'POST',\n  path: '\u002Fcheckout',\n})\n\nlog.set({ action: 'checkout', userId: '123' }) \u002F\u002F OK\nlog.set({ unknown: true })                      \u002F\u002F TS error\n",[248,1091,1092,1111,1115,1124,1132,1141,1145,1149,1170,1187,1203,1209,1213,1254],{"__ignoreMap":282},[286,1093,1094,1096,1098,1101,1103,1105,1107,1109],{"class":288,"line":289},[286,1095,293],{"class":292},[286,1097,297],{"class":296},[286,1099,1100],{"class":300}," createRequestLogger",[286,1102,304],{"class":296},[286,1104,307],{"class":292},[286,1106,310],{"class":296},[286,1108,314],{"class":313},[286,1110,317],{"class":296},[286,1112,1113],{"class":288,"line":320},[286,1114,324],{"emptyLinePlaceholder":323},[286,1116,1117,1119,1122],{"class":288,"line":327},[286,1118,331],{"class":330},[286,1120,1121],{"class":334}," MyFields",[286,1123,338],{"class":296},[286,1125,1126,1128,1130],{"class":288,"line":341},[286,1127,405],{"class":344},[286,1129,274],{"class":296},[286,1131,410],{"class":334},[286,1133,1134,1137,1139],{"class":288,"line":373},[286,1135,1136],{"class":344},"  userId",[286,1138,274],{"class":296},[286,1140,410],{"class":334},[286,1142,1143],{"class":288,"line":402},[286,1144,416],{"class":296},[286,1146,1147],{"class":288,"line":413},[286,1148,324],{"emptyLinePlaceholder":323},[286,1150,1151,1153,1155,1157,1159,1161,1163,1165,1167],{"class":288,"line":419},[286,1152,852],{"class":330},[286,1154,855],{"class":300},[286,1156,858],{"class":296},[286,1158,1100],{"class":433},[286,1160,472],{"class":296},[286,1162,976],{"class":334},[286,1164,478],{"class":296},[286,1166,437],{"class":300},[286,1168,1169],{"class":296},"{\n",[286,1171,1172,1175,1177,1179,1182,1184],{"class":288,"line":424},[286,1173,1174],{"class":344},"  method",[286,1176,274],{"class":296},[286,1178,310],{"class":296},[286,1180,1181],{"class":313},"POST",[286,1183,526],{"class":296},[286,1185,1186],{"class":296},",\n",[286,1188,1189,1192,1194,1196,1199,1201],{"class":288,"line":458},[286,1190,1191],{"class":344},"  path",[286,1193,274],{"class":296},[286,1195,310],{"class":296},[286,1197,1198],{"class":313},"\u002Fcheckout",[286,1200,526],{"class":296},[286,1202,1186],{"class":296},[286,1204,1205,1207],{"class":288,"line":488},[286,1206,735],{"class":296},[286,1208,485],{"class":300},[286,1210,1211],{"class":288,"line":493},[286,1212,324],{"emptyLinePlaceholder":323},[286,1214,1215,1217,1219,1221,1223,1225,1227,1229,1231,1233,1235,1237,1240,1242,1244,1246,1248,1250,1252],{"class":288,"line":554},[286,1216,769],{"class":300},[286,1218,499],{"class":296},[286,1220,502],{"class":433},[286,1222,437],{"class":300},[286,1224,507],{"class":296},[286,1226,613],{"class":344},[286,1228,274],{"class":296},[286,1230,310],{"class":296},[286,1232,620],{"class":313},[286,1234,526],{"class":296},[286,1236,529],{"class":296},[286,1238,1239],{"class":344}," userId",[286,1241,274],{"class":296},[286,1243,310],{"class":296},[286,1245,523],{"class":313},[286,1247,526],{"class":296},[286,1249,304],{"class":296},[286,1251,821],{"class":300},[286,1253,551],{"class":550},[286,1255,1256,1258,1260,1262,1264,1266,1269,1271,1273,1275,1277],{"class":288,"line":600},[286,1257,769],{"class":300},[286,1259,499],{"class":296},[286,1261,502],{"class":433},[286,1263,437],{"class":300},[286,1265,507],{"class":296},[286,1267,1268],{"class":344}," unknown",[286,1270,274],{"class":296},[286,1272,727],{"class":726},[286,1274,304],{"class":296},[286,1276,664],{"class":300},[286,1278,667],{"class":550},[276,1280,1282],{"className":278,"code":1281,"filename":91,"language":281,"meta":282,"style":282},"import { createWorkersLogger } from 'evlog\u002Fworkers'\n\ninterface MyFields {\n  action: string\n}\n\nconst log = createWorkersLogger\u003CMyFields>(request)\nlog.set({ action: 'process' }) \u002F\u002F OK\n",[248,1283,1284,1304,1308,1316,1324,1328,1332,1351],{"__ignoreMap":282},[286,1285,1286,1288,1290,1293,1295,1297,1299,1302],{"class":288,"line":289},[286,1287,293],{"class":292},[286,1289,297],{"class":296},[286,1291,1292],{"class":300}," createWorkersLogger",[286,1294,304],{"class":296},[286,1296,307],{"class":292},[286,1298,310],{"class":296},[286,1300,1301],{"class":313},"evlog\u002Fworkers",[286,1303,317],{"class":296},[286,1305,1306],{"class":288,"line":320},[286,1307,324],{"emptyLinePlaceholder":323},[286,1309,1310,1312,1314],{"class":288,"line":327},[286,1311,331],{"class":330},[286,1313,1121],{"class":334},[286,1315,338],{"class":296},[286,1317,1318,1320,1322],{"class":288,"line":341},[286,1319,405],{"class":344},[286,1321,274],{"class":296},[286,1323,410],{"class":334},[286,1325,1326],{"class":288,"line":373},[286,1327,416],{"class":296},[286,1329,1330],{"class":288,"line":402},[286,1331,324],{"emptyLinePlaceholder":323},[286,1333,1334,1336,1338,1340,1342,1344,1346,1348],{"class":288,"line":413},[286,1335,852],{"class":330},[286,1337,855],{"class":300},[286,1339,858],{"class":296},[286,1341,1292],{"class":433},[286,1343,472],{"class":296},[286,1345,976],{"class":334},[286,1347,478],{"class":296},[286,1349,1350],{"class":300},"(request)\n",[286,1352,1353,1355,1357,1359,1361,1363,1365,1367,1369,1372,1374,1376,1378],{"class":288,"line":419},[286,1354,769],{"class":300},[286,1356,499],{"class":296},[286,1358,502],{"class":433},[286,1360,437],{"class":300},[286,1362,507],{"class":296},[286,1364,613],{"class":344},[286,1366,274],{"class":296},[286,1368,310],{"class":296},[286,1370,1371],{"class":313},"process",[286,1373,526],{"class":296},[286,1375,304],{"class":296},[286,1377,821],{"class":300},[286,1379,551],{"class":550},[265,1381,1383],{"id":1382},"design-tips","Design Tips",[1385,1386,1388],"h3",{"id":1387},"one-interface-per-domain","One Interface Per Domain",[244,1390,1391],{},"Define field interfaces per domain area, not per route:",[276,1393,1396],{"className":278,"code":1394,"filename":1395,"language":281,"meta":282,"style":282},"export interface AuthFields {\n  user: { id: string; email: string; role: string }\n  action: string\n  mfaUsed: boolean\n}\n\nexport interface PaymentFields {\n  user: { id: string; plan: string }\n  order: { id: string; total: number; currency: string }\n  payment: { method: string; last4: string }\n}\n","server\u002Ftypes\u002Flog-fields.ts",[248,1397,1398,1410,1444,1452,1462,1466,1470,1481,1505,1539,1566],{"__ignoreMap":282},[286,1399,1400,1402,1405,1408],{"class":288,"line":289},[286,1401,427],{"class":292},[286,1403,1404],{"class":330}," interface",[286,1406,1407],{"class":334}," AuthFields",[286,1409,338],{"class":296},[286,1411,1412,1414,1416,1418,1420,1422,1424,1426,1429,1431,1433,1435,1438,1440,1442],{"class":288,"line":320},[286,1413,345],{"class":344},[286,1415,274],{"class":296},[286,1417,297],{"class":296},[286,1419,352],{"class":344},[286,1421,274],{"class":296},[286,1423,357],{"class":334},[286,1425,360],{"class":296},[286,1427,1428],{"class":344}," email",[286,1430,274],{"class":296},[286,1432,357],{"class":334},[286,1434,360],{"class":296},[286,1436,1437],{"class":344}," role",[286,1439,274],{"class":296},[286,1441,357],{"class":334},[286,1443,370],{"class":296},[286,1445,1446,1448,1450],{"class":288,"line":327},[286,1447,405],{"class":344},[286,1449,274],{"class":296},[286,1451,410],{"class":334},[286,1453,1454,1457,1459],{"class":288,"line":341},[286,1455,1456],{"class":344},"  mfaUsed",[286,1458,274],{"class":296},[286,1460,1461],{"class":334}," boolean\n",[286,1463,1464],{"class":288,"line":373},[286,1465,416],{"class":296},[286,1467,1468],{"class":288,"line":402},[286,1469,324],{"emptyLinePlaceholder":323},[286,1471,1472,1474,1476,1479],{"class":288,"line":413},[286,1473,427],{"class":292},[286,1475,1404],{"class":330},[286,1477,1478],{"class":334}," PaymentFields",[286,1480,338],{"class":296},[286,1482,1483,1485,1487,1489,1491,1493,1495,1497,1499,1501,1503],{"class":288,"line":419},[286,1484,345],{"class":344},[286,1486,274],{"class":296},[286,1488,297],{"class":296},[286,1490,352],{"class":344},[286,1492,274],{"class":296},[286,1494,357],{"class":334},[286,1496,360],{"class":296},[286,1498,363],{"class":344},[286,1500,274],{"class":296},[286,1502,357],{"class":334},[286,1504,370],{"class":296},[286,1506,1507,1510,1512,1514,1516,1518,1520,1522,1524,1526,1528,1530,1533,1535,1537],{"class":288,"line":424},[286,1508,1509],{"class":344},"  order",[286,1511,274],{"class":296},[286,1513,297],{"class":296},[286,1515,352],{"class":344},[286,1517,274],{"class":296},[286,1519,357],{"class":334},[286,1521,360],{"class":296},[286,1523,393],{"class":344},[286,1525,274],{"class":296},[286,1527,388],{"class":334},[286,1529,360],{"class":296},[286,1531,1532],{"class":344}," currency",[286,1534,274],{"class":296},[286,1536,357],{"class":334},[286,1538,370],{"class":296},[286,1540,1541,1544,1546,1548,1551,1553,1555,1557,1560,1562,1564],{"class":288,"line":458},[286,1542,1543],{"class":344},"  payment",[286,1545,274],{"class":296},[286,1547,297],{"class":296},[286,1549,1550],{"class":344}," method",[286,1552,274],{"class":296},[286,1554,357],{"class":334},[286,1556,360],{"class":296},[286,1558,1559],{"class":344}," last4",[286,1561,274],{"class":296},[286,1563,357],{"class":334},[286,1565,370],{"class":296},[286,1567,1568],{"class":288,"line":488},[286,1569,416],{"class":296},[276,1571,1574],{"className":278,"code":1572,"filename":1573,"language":281,"meta":282,"style":282},"import { useLogger } from 'evlog'\nimport type { AuthFields } from '~\u002Fserver\u002Ftypes\u002Flog-fields'\n\nexport default defineEventHandler(async (event) => {\n  const log = useLogger\u003CAuthFields>(event)\n  \u002F\u002F ...\n})\n","server\u002Fapi\u002Fauth\u002Flogin.post.ts",[248,1575,1576,1594,1616,1620,1642,1665,1670],{"__ignoreMap":282},[286,1577,1578,1580,1582,1584,1586,1588,1590,1592],{"class":288,"line":289},[286,1579,293],{"class":292},[286,1581,297],{"class":296},[286,1583,301],{"class":300},[286,1585,304],{"class":296},[286,1587,307],{"class":292},[286,1589,310],{"class":296},[286,1591,314],{"class":313},[286,1593,317],{"class":296},[286,1595,1596,1598,1601,1603,1605,1607,1609,1611,1614],{"class":288,"line":320},[286,1597,293],{"class":292},[286,1599,1600],{"class":292}," type",[286,1602,297],{"class":296},[286,1604,1407],{"class":300},[286,1606,304],{"class":296},[286,1608,307],{"class":292},[286,1610,310],{"class":296},[286,1612,1613],{"class":313},"~\u002Fserver\u002Ftypes\u002Flog-fields",[286,1615,317],{"class":296},[286,1617,1618],{"class":288,"line":327},[286,1619,324],{"emptyLinePlaceholder":323},[286,1621,1622,1624,1626,1628,1630,1632,1634,1636,1638,1640],{"class":288,"line":341},[286,1623,427],{"class":292},[286,1625,430],{"class":292},[286,1627,434],{"class":433},[286,1629,437],{"class":300},[286,1631,440],{"class":330},[286,1633,443],{"class":296},[286,1635,447],{"class":446},[286,1637,450],{"class":296},[286,1639,453],{"class":330},[286,1641,338],{"class":296},[286,1643,1644,1646,1648,1650,1652,1654,1657,1659,1661,1663],{"class":288,"line":373},[286,1645,461],{"class":330},[286,1647,464],{"class":300},[286,1649,467],{"class":296},[286,1651,301],{"class":433},[286,1653,472],{"class":296},[286,1655,1656],{"class":334},"AuthFields",[286,1658,478],{"class":296},[286,1660,437],{"class":344},[286,1662,447],{"class":300},[286,1664,485],{"class":344},[286,1666,1667],{"class":288,"line":402},[286,1668,1669],{"class":550},"  \u002F\u002F ...\n",[286,1671,1672,1674],{"class":288,"line":413},[286,1673,735],{"class":296},[286,1675,485],{"class":300},[1385,1677,1679],{"id":1678},"keep-interfaces-focused","Keep Interfaces Focused",[244,1681,1682],{},"Include only the fields your routes actually set. The interface doesn't need to mirror your entire data model:",[276,1684,1686],{"className":278,"code":1685,"language":281,"meta":282,"style":282},"\u002F\u002F Too broad - most routes won't set all these\ninterface EverythingFields {\n  user: FullUserProfile\n  order: CompleteOrder\n  payment: PaymentDetails\n  shipping: ShippingInfo\n}\n\n\u002F\u002F Focused - only what this route sets\ninterface CheckoutFields {\n  user: { id: string; plan: string }\n  cart: { items: number; total: number }\n}\n",[248,1687,1688,1693,1702,1711,1720,1729,1739,1743,1747,1752,1760,1784,1808],{"__ignoreMap":282},[286,1689,1690],{"class":288,"line":289},[286,1691,1692],{"class":550},"\u002F\u002F Too broad - most routes won't set all these\n",[286,1694,1695,1697,1700],{"class":288,"line":320},[286,1696,331],{"class":330},[286,1698,1699],{"class":334}," EverythingFields",[286,1701,338],{"class":296},[286,1703,1704,1706,1708],{"class":288,"line":327},[286,1705,345],{"class":344},[286,1707,274],{"class":296},[286,1709,1710],{"class":334}," FullUserProfile\n",[286,1712,1713,1715,1717],{"class":288,"line":341},[286,1714,1509],{"class":344},[286,1716,274],{"class":296},[286,1718,1719],{"class":334}," CompleteOrder\n",[286,1721,1722,1724,1726],{"class":288,"line":373},[286,1723,1543],{"class":344},[286,1725,274],{"class":296},[286,1727,1728],{"class":334}," PaymentDetails\n",[286,1730,1731,1734,1736],{"class":288,"line":402},[286,1732,1733],{"class":344},"  shipping",[286,1735,274],{"class":296},[286,1737,1738],{"class":334}," ShippingInfo\n",[286,1740,1741],{"class":288,"line":413},[286,1742,416],{"class":296},[286,1744,1745],{"class":288,"line":419},[286,1746,324],{"emptyLinePlaceholder":323},[286,1748,1749],{"class":288,"line":424},[286,1750,1751],{"class":550},"\u002F\u002F Focused - only what this route sets\n",[286,1753,1754,1756,1758],{"class":288,"line":458},[286,1755,331],{"class":330},[286,1757,335],{"class":334},[286,1759,338],{"class":296},[286,1761,1762,1764,1766,1768,1770,1772,1774,1776,1778,1780,1782],{"class":288,"line":488},[286,1763,345],{"class":344},[286,1765,274],{"class":296},[286,1767,297],{"class":296},[286,1769,352],{"class":344},[286,1771,274],{"class":296},[286,1773,357],{"class":334},[286,1775,360],{"class":296},[286,1777,363],{"class":344},[286,1779,274],{"class":296},[286,1781,357],{"class":334},[286,1783,370],{"class":296},[286,1785,1786,1788,1790,1792,1794,1796,1798,1800,1802,1804,1806],{"class":288,"line":493},[286,1787,376],{"class":344},[286,1789,274],{"class":296},[286,1791,297],{"class":296},[286,1793,383],{"class":344},[286,1795,274],{"class":296},[286,1797,388],{"class":334},[286,1799,360],{"class":296},[286,1801,393],{"class":344},[286,1803,274],{"class":296},[286,1805,388],{"class":334},[286,1807,370],{"class":296},[286,1809,1810],{"class":288,"line":554},[286,1811,416],{"class":296},[1813,1814,1815],"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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .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}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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);}",{"title":282,"searchDepth":320,"depth":320,"links":1817},[1818,1819,1820,1821,1822,1823],{"id":267,"depth":320,"text":268},{"id":743,"depth":320,"text":744},{"id":835,"depth":320,"text":836},{"id":917,"depth":320,"text":918},{"id":1072,"depth":320,"text":1073},{"id":1382,"depth":320,"text":1383,"children":1824},[1825,1826],{"id":1387,"depth":327,"text":1388},{"id":1678,"depth":327,"text":1679},"Add compile-time type safety to your wide events with TypeScript module augmentation. Prevent typos and ensure consistent field names across your codebase.","md",[1830,1833],{"label":121,"icon":124,"to":122,"color":1831,"variant":1832},"neutral","subtle",{"label":131,"icon":134,"to":132,"color":1831,"variant":1832},{},{"icon":99},{"title":136,"description":1827},"6w9yu11YnY03lExfN8n0pNOuhvneKwxf6varbgkGXt4",[1839,1841],{"title":131,"path":132,"stem":133,"description":1840,"icon":134,"children":-1},"Security guidelines, data sanitization, and production tips for evlog. Learn what not to log and how to protect sensitive data.",{"title":140,"path":141,"stem":142,"description":1842,"icon":143,"children":-1},"Control log volume with two-tier sampling. Head sampling drops noise by level, tail sampling rescues critical events based on outcome. Never miss errors, slow requests, or critical paths.",1773504120471]