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