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