[{"data":1,"prerenderedAt":1221},["ShallowReactive",2],{"navigation_docs":3,"-logging-overview":277,"-logging-overview-surround":1216},[4,30,65,105,188,247,263],{"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},"Logging","\u002Flogging","2.logging",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":61,"path":62,"stem":63,"icon":64},"AI SDK Integration","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk","i-simple-icons-vercel",{"title":66,"path":67,"stem":68,"children":69,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[70,75,80,85,90,95,100],{"title":71,"path":72,"stem":73,"icon":74},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":76,"path":77,"stem":78,"icon":79},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":81,"path":82,"stem":83,"icon":84},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":86,"path":87,"stem":88,"icon":89},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":91,"path":92,"stem":93,"icon":94},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices","i-lucide-shield-check",{"title":96,"path":97,"stem":98,"icon":99},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance","i-lucide-gauge",{"title":101,"path":102,"stem":103,"icon":104},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Frameworks","\u002Fframeworks","4.frameworks",[110,114,119,124,129,134,139,144,149,154,159,164,169,174,178,183],{"title":36,"path":111,"stem":112,"icon":113},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":115,"path":116,"stem":117,"icon":118},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":120,"path":121,"stem":122,"icon":123},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":125,"path":126,"stem":127,"icon":128},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":130,"path":131,"stem":132,"icon":133},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":135,"path":136,"stem":137,"icon":138},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":140,"path":141,"stem":142,"icon":143},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":145,"path":146,"stem":147,"icon":148},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":150,"path":151,"stem":152,"icon":153},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":155,"path":156,"stem":157,"icon":158},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":160,"path":161,"stem":162,"icon":163},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":165,"path":166,"stem":167,"icon":168},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":170,"path":171,"stem":172,"icon":173},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":175,"path":176,"stem":177,"icon":89},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":179,"path":180,"stem":181,"icon":182},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":184,"path":185,"stem":186,"icon":187},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F15.custom-integration","i-lucide-puzzle",{"title":189,"path":190,"stem":191,"children":192,"page":29},"Adapters","\u002Fadapters","5.adapters",[193,197,202,207,212,217,222,227,232,237,242],{"title":36,"path":194,"stem":195,"icon":196},"\u002Fadapters\u002Foverview","5.adapters\u002F1.overview","i-custom-plug",{"title":198,"path":199,"stem":200,"icon":201},"Pipeline","\u002Fadapters\u002Fpipeline","5.adapters\u002F10.pipeline","i-lucide-workflow",{"title":203,"path":204,"stem":205,"icon":206},"Browser","\u002Fadapters\u002Fbrowser","5.adapters\u002F11.browser","i-lucide-globe",{"title":208,"path":209,"stem":210,"icon":211},"Axiom","\u002Fadapters\u002Faxiom","5.adapters\u002F2.axiom","i-custom-axiom",{"title":213,"path":214,"stem":215,"icon":216},"OTLP","\u002Fadapters\u002Fotlp","5.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":218,"path":219,"stem":220,"icon":221},"PostHog","\u002Fadapters\u002Fposthog","5.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":223,"path":224,"stem":225,"icon":226},"Sentry","\u002Fadapters\u002Fsentry","5.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":228,"path":229,"stem":230,"icon":231},"Better Stack","\u002Fadapters\u002Fbetter-stack","5.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":233,"path":234,"stem":235,"icon":236},"File System","\u002Fadapters\u002Ffs","5.adapters\u002F7.fs","i-lucide-hard-drive",{"title":238,"path":239,"stem":240,"icon":241},"HyperDX","\u002Fadapters\u002Fhyperdx","5.adapters\u002F8.hyperdx","i-custom-hyperdx",{"title":243,"path":244,"stem":245,"icon":246},"Custom Adapters","\u002Fadapters\u002Fcustom","5.adapters\u002F9.custom","i-lucide-code",{"title":248,"path":249,"stem":250,"children":251,"page":29},"Enrichers","\u002Fenrichers","6.enrichers",[252,255,259],{"title":36,"path":253,"stem":254,"icon":28},"\u002Fenrichers\u002Foverview","6.enrichers\u002F1.overview",{"title":256,"path":257,"stem":258,"icon":187},"Built-in","\u002Fenrichers\u002Fbuilt-in","6.enrichers\u002F2.built-in",{"title":260,"path":261,"stem":262,"icon":246},"Custom","\u002Fenrichers\u002Fcustom","6.enrichers\u002F3.custom",{"title":264,"path":265,"stem":266,"children":267,"page":29},"NuxtHub","\u002Fnuxthub","7.nuxthub",[268,272],{"title":36,"path":269,"stem":270,"icon":271},"\u002Fnuxthub\u002Foverview","7.nuxthub\u002F1.overview","i-lucide-database",{"title":273,"path":274,"stem":275,"icon":276},"Retention","\u002Fnuxthub\u002Fretention","7.nuxthub\u002F2.retention","i-lucide-clock",{"id":278,"title":279,"body":280,"description":1206,"extension":1207,"links":1208,"meta":1212,"navigation":1213,"path":37,"seo":1214,"stem":38,"__hash__":1215},"docs\u002F2.logging\u002F0.overview.md","Logging Overview",{"type":281,"value":282,"toc":1193},"minimark",[283,287,292,327,331,340,343,486,497,500,766,784,788,795,951,970,974,1089,1105,1109,1112,1159,1163,1189],[284,285,286],"p",{},"evlog provides three logging APIs, each designed for a different context. You can use all three in the same project.",[288,289,291],"h2",{"id":290},"the-three-modes","The Three Modes",[293,294,295,319,322],"card-group",{},[296,297,299,300,304,305,308,309,308,312,308,315,318],"card",{"color":298,"icon":44,"title":41,"to":42},"neutral","Fire-and-forget structured logs. Replace ",[301,302,303],"code",{},"console.log",", consola, or pino with ",[301,306,307],{},"log.info",", ",[301,310,311],{},"log.error",[301,313,314],{},"log.warn",[301,316,317],{},"log.debug",".",[296,320,321],{"color":298,"icon":49,"title":46,"to":47},"Accumulate context over a unit of work (a script, job, queue task, or request) then emit a single comprehensive event.",[296,323,326],{"color":298,"icon":324,"title":325,"to":111},"i-lucide-git-branch","Request Logging","Auto-managed wide events scoped to HTTP requests. Framework middleware creates the logger and emits it for you.",[288,328,330],{"id":329},"quick-comparison","Quick Comparison",[332,333,335,336,339],"h3",{"id":334},"simple-logging-log","Simple Logging (",[301,337,338],{},"log",")",[284,341,342],{},"One event per call. No accumulation, no lifecycle management.",[344,345,351],"pre",{"className":346,"code":347,"filename":348,"language":349,"meta":350,"style":350},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { log } from 'evlog'\n\nlog.info('auth', 'User logged in')\nlog.error({ action: 'payment', error: 'card_declined', userId: 42 })\n","src\u002Findex.ts","typescript","",[301,352,353,386,393,428],{"__ignoreMap":350},[354,355,358,362,366,370,373,376,379,383],"span",{"class":356,"line":357},"line",1,[354,359,361],{"class":360},"s7zQu","import",[354,363,365],{"class":364},"sMK4o"," {",[354,367,369],{"class":368},"sTEyZ"," log",[354,371,372],{"class":364}," }",[354,374,375],{"class":360}," from",[354,377,378],{"class":364}," '",[354,380,382],{"class":381},"sfazB","evlog",[354,384,385],{"class":364},"'\n",[354,387,389],{"class":356,"line":388},2,[354,390,392],{"emptyLinePlaceholder":391},true,"\n",[354,394,396,398,400,404,407,410,413,415,418,420,423,425],{"class":356,"line":395},3,[354,397,338],{"class":368},[354,399,318],{"class":364},[354,401,403],{"class":402},"s2Zo4","info",[354,405,406],{"class":368},"(",[354,408,409],{"class":364},"'",[354,411,412],{"class":381},"auth",[354,414,409],{"class":364},[354,416,417],{"class":364},",",[354,419,378],{"class":364},[354,421,422],{"class":381},"User logged in",[354,424,409],{"class":364},[354,426,427],{"class":368},")\n",[354,429,431,433,435,438,440,443,447,450,452,455,457,459,462,464,466,469,471,473,476,478,482,484],{"class":356,"line":430},4,[354,432,338],{"class":368},[354,434,318],{"class":364},[354,436,437],{"class":402},"error",[354,439,406],{"class":368},[354,441,442],{"class":364},"{",[354,444,446],{"class":445},"swJcz"," action",[354,448,449],{"class":364},":",[354,451,378],{"class":364},[354,453,454],{"class":381},"payment",[354,456,409],{"class":364},[354,458,417],{"class":364},[354,460,461],{"class":445}," error",[354,463,449],{"class":364},[354,465,378],{"class":364},[354,467,468],{"class":381},"card_declined",[354,470,409],{"class":364},[354,472,417],{"class":364},[354,474,475],{"class":445}," userId",[354,477,449],{"class":364},[354,479,481],{"class":480},"sbssI"," 42",[354,483,372],{"class":364},[354,485,427],{"class":368},[332,487,489,490,493,494,339],{"id":488},"wide-events-createlogger-createrequestlogger","Wide Events (",[301,491,492],{},"createLogger"," \u002F ",[301,495,496],{},"createRequestLogger",[284,498,499],{},"One event per unit of work. Accumulate context progressively, emit when done.",[501,502,503,636],"code-group",{},[344,504,507],{"className":346,"code":505,"filename":506,"language":349,"meta":350,"style":350},"import { createLogger } from 'evlog'\n\nconst log = createLogger({ jobId: 'sync-001', queue: 'emails' })\nlog.set({ batch: { size: 50, processed: 50 } })\nlog.emit()\n","scripts\u002Fsync-job.ts",[301,508,509,528,532,580,623],{"__ignoreMap":350},[354,510,511,513,515,518,520,522,524,526],{"class":356,"line":357},[354,512,361],{"class":360},[354,514,365],{"class":364},[354,516,517],{"class":368}," createLogger",[354,519,372],{"class":364},[354,521,375],{"class":360},[354,523,378],{"class":364},[354,525,382],{"class":381},[354,527,385],{"class":364},[354,529,530],{"class":356,"line":388},[354,531,392],{"emptyLinePlaceholder":391},[354,533,534,538,541,544,546,548,550,553,555,557,560,562,564,567,569,571,574,576,578],{"class":356,"line":395},[354,535,537],{"class":536},"spNyl","const",[354,539,540],{"class":368}," log ",[354,542,543],{"class":364},"=",[354,545,517],{"class":402},[354,547,406],{"class":368},[354,549,442],{"class":364},[354,551,552],{"class":445}," jobId",[354,554,449],{"class":364},[354,556,378],{"class":364},[354,558,559],{"class":381},"sync-001",[354,561,409],{"class":364},[354,563,417],{"class":364},[354,565,566],{"class":445}," queue",[354,568,449],{"class":364},[354,570,378],{"class":364},[354,572,573],{"class":381},"emails",[354,575,409],{"class":364},[354,577,372],{"class":364},[354,579,427],{"class":368},[354,581,582,584,586,589,591,593,596,598,600,603,605,608,610,613,615,617,619,621],{"class":356,"line":430},[354,583,338],{"class":368},[354,585,318],{"class":364},[354,587,588],{"class":402},"set",[354,590,406],{"class":368},[354,592,442],{"class":364},[354,594,595],{"class":445}," batch",[354,597,449],{"class":364},[354,599,365],{"class":364},[354,601,602],{"class":445}," size",[354,604,449],{"class":364},[354,606,607],{"class":480}," 50",[354,609,417],{"class":364},[354,611,612],{"class":445}," processed",[354,614,449],{"class":364},[354,616,607],{"class":480},[354,618,372],{"class":364},[354,620,372],{"class":364},[354,622,427],{"class":368},[354,624,626,628,630,633],{"class":356,"line":625},5,[354,627,338],{"class":368},[354,629,318],{"class":364},[354,631,632],{"class":402},"emit",[354,634,635],{"class":368},"()\n",[344,637,640],{"className":346,"code":638,"filename":639,"language":349,"meta":350,"style":350},"import { createRequestLogger } from 'evlog'\n\nconst log = createRequestLogger({ method: 'POST', path: '\u002Fapi\u002Fcheckout' })\nlog.set({ user: { id: 1, plan: 'pro' } })\nlog.emit()\n","src\u002Fworker.ts",[301,641,642,661,665,709,756],{"__ignoreMap":350},[354,643,644,646,648,651,653,655,657,659],{"class":356,"line":357},[354,645,361],{"class":360},[354,647,365],{"class":364},[354,649,650],{"class":368}," createRequestLogger",[354,652,372],{"class":364},[354,654,375],{"class":360},[354,656,378],{"class":364},[354,658,382],{"class":381},[354,660,385],{"class":364},[354,662,663],{"class":356,"line":388},[354,664,392],{"emptyLinePlaceholder":391},[354,666,667,669,671,673,675,677,679,682,684,686,689,691,693,696,698,700,703,705,707],{"class":356,"line":395},[354,668,537],{"class":536},[354,670,540],{"class":368},[354,672,543],{"class":364},[354,674,650],{"class":402},[354,676,406],{"class":368},[354,678,442],{"class":364},[354,680,681],{"class":445}," method",[354,683,449],{"class":364},[354,685,378],{"class":364},[354,687,688],{"class":381},"POST",[354,690,409],{"class":364},[354,692,417],{"class":364},[354,694,695],{"class":445}," path",[354,697,449],{"class":364},[354,699,378],{"class":364},[354,701,702],{"class":381},"\u002Fapi\u002Fcheckout",[354,704,409],{"class":364},[354,706,372],{"class":364},[354,708,427],{"class":368},[354,710,711,713,715,717,719,721,724,726,728,731,733,736,738,741,743,745,748,750,752,754],{"class":356,"line":430},[354,712,338],{"class":368},[354,714,318],{"class":364},[354,716,588],{"class":402},[354,718,406],{"class":368},[354,720,442],{"class":364},[354,722,723],{"class":445}," user",[354,725,449],{"class":364},[354,727,365],{"class":364},[354,729,730],{"class":445}," id",[354,732,449],{"class":364},[354,734,735],{"class":480}," 1",[354,737,417],{"class":364},[354,739,740],{"class":445}," plan",[354,742,449],{"class":364},[354,744,378],{"class":364},[354,746,747],{"class":381},"pro",[354,749,409],{"class":364},[354,751,372],{"class":364},[354,753,372],{"class":364},[354,755,427],{"class":368},[354,757,758,760,762,764],{"class":356,"line":625},[354,759,338],{"class":368},[354,761,318],{"class":364},[354,763,632],{"class":402},[354,765,635],{"class":368},[284,767,768,770,771,773,774,308,777,780,781,318],{},[301,769,496],{}," is a thin wrapper around ",[301,772,492],{}," that pre-populates ",[301,775,776],{},"method",[301,778,779],{},"path",", and ",[301,782,783],{},"requestId",[332,785,787],{"id":786},"request-logging-framework-middleware","Request Logging (framework middleware)",[284,789,790,791,794],{},"Framework integrations create a wide event logger automatically on each request. ",[301,792,793],{},"useLogger(event)"," retrieves the logger that's already attached to the request context:",[344,796,799],{"className":346,"code":797,"filename":798,"language":349,"meta":350,"style":350},"import { useLogger } from 'evlog'\n\nexport default defineEventHandler(async (event) => {\n  const log = useLogger(event)\n  log.set({ user: { id: 1, plan: 'pro' } })\n  return { success: true }\n  \u002F\u002F auto-emitted on response end\n})\n","server\u002Fapi\u002Fcheckout.post.ts",[301,800,801,820,824,855,873,916,936,943],{"__ignoreMap":350},[354,802,803,805,807,810,812,814,816,818],{"class":356,"line":357},[354,804,361],{"class":360},[354,806,365],{"class":364},[354,808,809],{"class":368}," useLogger",[354,811,372],{"class":364},[354,813,375],{"class":360},[354,815,378],{"class":364},[354,817,382],{"class":381},[354,819,385],{"class":364},[354,821,822],{"class":356,"line":388},[354,823,392],{"emptyLinePlaceholder":391},[354,825,826,829,832,835,837,840,843,847,849,852],{"class":356,"line":395},[354,827,828],{"class":360},"export",[354,830,831],{"class":360}," default",[354,833,834],{"class":402}," defineEventHandler",[354,836,406],{"class":368},[354,838,839],{"class":536},"async",[354,841,842],{"class":364}," (",[354,844,846],{"class":845},"sHdIc","event",[354,848,339],{"class":364},[354,850,851],{"class":536}," =>",[354,853,854],{"class":364}," {\n",[354,856,857,860,862,865,867,869,871],{"class":356,"line":430},[354,858,859],{"class":536},"  const",[354,861,369],{"class":368},[354,863,864],{"class":364}," =",[354,866,809],{"class":402},[354,868,406],{"class":445},[354,870,846],{"class":368},[354,872,427],{"class":445},[354,874,875,878,880,882,884,886,888,890,892,894,896,898,900,902,904,906,908,910,912,914],{"class":356,"line":625},[354,876,877],{"class":368},"  log",[354,879,318],{"class":364},[354,881,588],{"class":402},[354,883,406],{"class":445},[354,885,442],{"class":364},[354,887,723],{"class":445},[354,889,449],{"class":364},[354,891,365],{"class":364},[354,893,730],{"class":445},[354,895,449],{"class":364},[354,897,735],{"class":480},[354,899,417],{"class":364},[354,901,740],{"class":445},[354,903,449],{"class":364},[354,905,378],{"class":364},[354,907,747],{"class":381},[354,909,409],{"class":364},[354,911,372],{"class":364},[354,913,372],{"class":364},[354,915,427],{"class":445},[354,917,919,922,924,927,929,933],{"class":356,"line":918},6,[354,920,921],{"class":360},"  return",[354,923,365],{"class":364},[354,925,926],{"class":445}," success",[354,928,449],{"class":364},[354,930,932],{"class":931},"sfNiH"," true",[354,934,935],{"class":364}," }\n",[354,937,939],{"class":356,"line":938},7,[354,940,942],{"class":941},"sHwdD","  \u002F\u002F auto-emitted on response end\n",[354,944,946,949],{"class":356,"line":945},8,[354,947,948],{"class":364},"}",[354,950,427],{"class":368},[952,953,954,956,957,308,960,308,963,966,967,969],"callout",{"color":403,"icon":13},[301,955,793],{}," doesn't create a logger, it retrieves the one the framework middleware already attached to the event. Each framework has its own way to access it (",[301,958,959],{},"useLogger",[301,961,962],{},"req.log",[301,964,965],{},"c.get('log')",", etc.). In Nuxt, ",[301,968,959],{}," is auto-imported.",[288,971,973],{"id":972},"when-to-use-what","When to Use What",[975,976,977,999],"table",{},[978,979,980],"thead",{},[981,982,983,986,990,996],"tr",{},[984,985],"th",{},[984,987,988],{},[301,989,338],{},[984,991,992,493,994],{},[301,993,492],{},[301,995,496],{},[984,997,998],{},"Framework middleware",[1000,1001,1002,1020,1040,1059,1074],"tbody",{},[981,1003,1004,1011,1014,1017],{},[1005,1006,1007],"td",{},[1008,1009,1010],"strong",{},"Use case",[1005,1012,1013],{},"Quick one-off events",[1005,1015,1016],{},"Scripts, jobs, workers, queues, HTTP without a framework",[1005,1018,1019],{},"API routes with a framework integration",[981,1021,1022,1027,1030,1036],{},[1005,1023,1024],{},[1008,1025,1026],{},"Context",[1005,1028,1029],{},"Single call",[1005,1031,1032,1033],{},"Accumulate with ",[301,1034,1035],{},"set()",[1005,1037,1032,1038],{},[301,1039,1035],{},[981,1041,1042,1047,1050,1056],{},[1005,1043,1044],{},[1008,1045,1046],{},"Emit",[1005,1048,1049],{},"Immediate",[1005,1051,1052,1053],{},"Manual ",[301,1054,1055],{},"emit()",[1005,1057,1058],{},"Automatic on response end",[981,1060,1061,1065,1068,1071],{},[1005,1062,1063],{},[1008,1064,71],{},[1005,1066,1067],{},"None",[1005,1069,1070],{},"You manage it",[1005,1072,1073],{},"Framework manages it",[981,1075,1076,1081,1084,1086],{},[1005,1077,1078],{},[1008,1079,1080],{},"Output",[1005,1082,1083],{},"Console + drain",[1005,1085,1083],{},[1005,1087,1088],{},"Console + drain + enrich",[952,1090,1092,1093,1095,1096,1098,1099,1101,1102,1104],{"color":403,"icon":1091},"i-lucide-lightbulb","Start with ",[301,1094,338],{}," for quick structured logging. When you need to accumulate context across an operation, switch to ",[301,1097,492],{}," (or ",[301,1100,496],{}," for HTTP contexts). When using a framework integration, the middleware handles everything, just call ",[301,1103,793],{}," to retrieve the logger.",[288,1106,1108],{"id":1107},"shared-features","Shared Features",[284,1110,1111],{},"All three modes share the same foundation:",[1113,1114,1115,1126,1132,1148,1153],"ul",{},[1116,1117,1118,1121,1122,1125],"li",{},[1008,1119,1120],{},"Pretty output"," in development, ",[1008,1123,1124],{},"JSON"," in production (default, no configuration needed)",[1116,1127,1128,1131],{},[1008,1129,1130],{},"Drain pipeline"," to send events to Axiom, Sentry, PostHog, and more",[1116,1133,1134,1137,1138,308,1141,780,1144,1147],{},[1008,1135,1136],{},"Structured errors"," with ",[301,1139,1140],{},"why",[301,1142,1143],{},"fix",[301,1145,1146],{},"link"," fields",[1116,1149,1150,1152],{},[1008,1151,81],{}," to control log volume in production",[1116,1154,1155,1158],{},[1008,1156,1157],{},"Zero dependencies",", ~5 kB gzip",[288,1160,1162],{"id":1161},"next-steps","Next Steps",[1113,1164,1165,1174,1179,1184],{},[1116,1166,1167,1170,1171,1173],{},[1168,1169,41],"a",{"href":42},": The ",[301,1172,338],{}," API in detail",[1116,1175,1176,1178],{},[1168,1177,46],{"href":47},": Accumulating context and emitting events",[1116,1180,1181,1183],{},[1168,1182,51],{"href":52},": Errors with actionable context",[1116,1185,1186,1188],{},[1168,1187,106],{"href":111},": Auto-managed request logging per framework",[1190,1191,1192],"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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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}",{"title":350,"searchDepth":388,"depth":388,"links":1194},[1195,1196,1203,1204,1205],{"id":290,"depth":388,"text":291},{"id":329,"depth":388,"text":330,"children":1197},[1198,1200,1202],{"id":334,"depth":395,"text":1199},"Simple Logging (log)",{"id":488,"depth":395,"text":1201},"Wide Events (createLogger \u002F createRequestLogger)",{"id":786,"depth":395,"text":787},{"id":972,"depth":388,"text":973},{"id":1107,"depth":388,"text":1108},{"id":1161,"depth":388,"text":1162},"evlog gives you three ways to log. Simple one-liners, wide events that accumulate context, and auto-managed request logging. Choose the right one for your use case.","md",[1209,1211],{"label":41,"icon":44,"to":42,"color":298,"variant":1210},"subtle",{"label":46,"icon":49,"to":47,"color":298,"variant":1210},{},{"title":36,"icon":39},{"title":279,"description":1206},"EC8GG_jwWVH75euHkdHUM8t_pKRn_WUI4TgKvm6ITk8",[1217,1219],{"title":25,"path":26,"stem":27,"description":1218,"icon":28,"children":-1},"AI-assisted code review and evlog adoption using Agent Skills. Let AI review your logging patterns and guide migration to wide events.",{"title":41,"path":42,"stem":43,"description":1220,"icon":44,"children":-1},"Structured logging for everyday use. Replace console.log with log.info, log.error, log.warn, and log.debug. Fire-and-forget events with pretty output in dev and JSON in production.",1775289477914]