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