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