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