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