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