[{"data":1,"prerenderedAt":1577},["ShallowReactive",2],{"navigation_docs":3,"-logging-overview":392,"-logging-overview-surround":1572},[4,35,159,201,289,376],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"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",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Adapters","\u002Fadapters","6.adapters",[294,297,337,352],{"title":41,"path":295,"stem":296,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":298,"path":299,"stem":300,"children":301,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[302,307,312,317,322,327,332],{"title":303,"path":304,"stem":305,"icon":306},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":308,"path":309,"stem":310,"icon":311},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":313,"path":314,"stem":315,"icon":316},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":318,"path":319,"stem":320,"icon":321},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":323,"path":324,"stem":325,"icon":326},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":328,"path":329,"stem":330,"icon":331},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":333,"path":334,"stem":335,"icon":336},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":338,"path":339,"stem":340,"children":341,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[342,347],{"title":343,"path":344,"stem":345,"icon":346},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":348,"path":349,"stem":350,"icon":351},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":353,"path":354,"stem":355,"children":356,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[357,362,367,371],{"title":358,"path":359,"stem":360,"icon":361},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":363,"path":364,"stem":365,"icon":366},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":368,"path":369,"stem":370,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":372,"path":373,"stem":374,"icon":375},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":377,"path":378,"stem":379,"children":380,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[381,384,388],{"title":41,"path":382,"stem":383,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":385,"path":386,"stem":387,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":389,"path":390,"stem":391,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":393,"title":394,"body":395,"description":1562,"extension":1563,"links":1564,"meta":1568,"navigation":1569,"path":42,"seo":1570,"stem":43,"__hash__":1571},"docs\u002F2.logging\u002F0.overview.md","Logging Overview",{"type":396,"value":397,"toc":1547},"minimark",[398,402,407,419,424,458,462,471,474,616,627,630,896,914,918,925,1081,1099,1103,1218,1222,1445,1454,1458,1461,1514,1518,1543],[399,400,401],"p",{},"evlog provides three logging APIs, each designed for a different context. You can use all three in the same project.",[403,404,406],"callout",{"color":405,"icon":13},"info","All three modes coexist in the same logger. Pick per call — there's no upgrade path, no advanced mode, no toggle to flip. Same drains, same redaction, same types underneath.",[403,408,410,411,415,416,418],{"color":409,"icon":366},"neutral","Not running an HTTP framework? See ",[412,413,414],"a",{"href":272},"Standalone TypeScript"," and ",[412,417,266],{"href":267},".",[420,421,423],"h2",{"id":422},"the-three-modes","The Three Modes",[425,426,427,450,453],"card-group",{},[428,429,430,431,435,436,439,440,439,443,439,446,449],"card",{"color":409,"icon":49,"title":46,"to":47},"A fully-featured general-purpose logger. Replaces ",[432,433,434],"code",{},"console.log",", consola, pino, or winston with ",[432,437,438],{},"log.info",", ",[432,441,442],{},"log.error",[432,444,445],{},"log.warn",[432,447,448],{},"log.debug"," — same level filtering, drain pipeline, redaction, and pretty\u002FJSON output.",[428,451,452],{"color":409,"icon":54,"title":51,"to":52},"Accumulate context over a unit of work (a script, job, queue task, or request) then emit a single comprehensive event.",[428,454,457],{"color":409,"icon":455,"title":456,"to":207},"i-lucide-git-branch","Request Logging","Auto-managed wide events scoped to HTTP requests. Framework middleware creates the logger and emits it for you.",[420,459,461],{"id":460},"quick-comparison","Quick Comparison",[463,464,466,467,470],"h3",{"id":465},"simple-logging-log","Simple Logging (",[432,468,469],{},"log",")",[399,472,473],{},"One event per call. No accumulation, no lifecycle management.",[475,476,482],"pre",{"className":477,"code":478,"filename":479,"language":480,"meta":481,"style":481},"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","",[432,483,484,517,524,558],{"__ignoreMap":481},[485,486,489,493,497,501,504,507,510,514],"span",{"class":487,"line":488},"line",1,[485,490,492],{"class":491},"s7zQu","import",[485,494,496],{"class":495},"sMK4o"," {",[485,498,500],{"class":499},"sTEyZ"," log",[485,502,503],{"class":495}," }",[485,505,506],{"class":491}," from",[485,508,509],{"class":495}," '",[485,511,513],{"class":512},"sfazB","evlog",[485,515,516],{"class":495},"'\n",[485,518,520],{"class":487,"line":519},2,[485,521,523],{"emptyLinePlaceholder":522},true,"\n",[485,525,527,529,531,534,537,540,543,545,548,550,553,555],{"class":487,"line":526},3,[485,528,469],{"class":499},[485,530,418],{"class":495},[485,532,405],{"class":533},"s2Zo4",[485,535,536],{"class":499},"(",[485,538,539],{"class":495},"'",[485,541,542],{"class":512},"auth",[485,544,539],{"class":495},[485,546,547],{"class":495},",",[485,549,509],{"class":495},[485,551,552],{"class":512},"User logged in",[485,554,539],{"class":495},[485,556,557],{"class":499},")\n",[485,559,561,563,565,568,570,573,577,580,582,585,587,589,592,594,596,599,601,603,606,608,612,614],{"class":487,"line":560},4,[485,562,469],{"class":499},[485,564,418],{"class":495},[485,566,567],{"class":533},"error",[485,569,536],{"class":499},[485,571,572],{"class":495},"{",[485,574,576],{"class":575},"swJcz"," action",[485,578,579],{"class":495},":",[485,581,509],{"class":495},[485,583,584],{"class":512},"payment",[485,586,539],{"class":495},[485,588,547],{"class":495},[485,590,591],{"class":575}," error",[485,593,579],{"class":495},[485,595,509],{"class":495},[485,597,598],{"class":512},"card_declined",[485,600,539],{"class":495},[485,602,547],{"class":495},[485,604,605],{"class":575}," userId",[485,607,579],{"class":495},[485,609,611],{"class":610},"sbssI"," 42",[485,613,503],{"class":495},[485,615,557],{"class":499},[463,617,619,620,623,624,470],{"id":618},"wide-events-createlogger-createrequestlogger","Wide Events (",[432,621,622],{},"createLogger"," \u002F ",[432,625,626],{},"createRequestLogger",[399,628,629],{},"One event per unit of work. Accumulate context progressively, emit when done.",[631,632,633,766],"code-group",{},[475,634,637],{"className":477,"code":635,"filename":636,"language":480,"meta":481,"style":481},"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",[432,638,639,658,662,710,753],{"__ignoreMap":481},[485,640,641,643,645,648,650,652,654,656],{"class":487,"line":488},[485,642,492],{"class":491},[485,644,496],{"class":495},[485,646,647],{"class":499}," createLogger",[485,649,503],{"class":495},[485,651,506],{"class":491},[485,653,509],{"class":495},[485,655,513],{"class":512},[485,657,516],{"class":495},[485,659,660],{"class":487,"line":519},[485,661,523],{"emptyLinePlaceholder":522},[485,663,664,668,671,674,676,678,680,683,685,687,690,692,694,697,699,701,704,706,708],{"class":487,"line":526},[485,665,667],{"class":666},"spNyl","const",[485,669,670],{"class":499}," log ",[485,672,673],{"class":495},"=",[485,675,647],{"class":533},[485,677,536],{"class":499},[485,679,572],{"class":495},[485,681,682],{"class":575}," jobId",[485,684,579],{"class":495},[485,686,509],{"class":495},[485,688,689],{"class":512},"sync-001",[485,691,539],{"class":495},[485,693,547],{"class":495},[485,695,696],{"class":575}," queue",[485,698,579],{"class":495},[485,700,509],{"class":495},[485,702,703],{"class":512},"emails",[485,705,539],{"class":495},[485,707,503],{"class":495},[485,709,557],{"class":499},[485,711,712,714,716,719,721,723,726,728,730,733,735,738,740,743,745,747,749,751],{"class":487,"line":560},[485,713,469],{"class":499},[485,715,418],{"class":495},[485,717,718],{"class":533},"set",[485,720,536],{"class":499},[485,722,572],{"class":495},[485,724,725],{"class":575}," batch",[485,727,579],{"class":495},[485,729,496],{"class":495},[485,731,732],{"class":575}," size",[485,734,579],{"class":495},[485,736,737],{"class":610}," 50",[485,739,547],{"class":495},[485,741,742],{"class":575}," processed",[485,744,579],{"class":495},[485,746,737],{"class":610},[485,748,503],{"class":495},[485,750,503],{"class":495},[485,752,557],{"class":499},[485,754,756,758,760,763],{"class":487,"line":755},5,[485,757,469],{"class":499},[485,759,418],{"class":495},[485,761,762],{"class":533},"emit",[485,764,765],{"class":499},"()\n",[475,767,770],{"className":477,"code":768,"filename":769,"language":480,"meta":481,"style":481},"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",[432,771,772,791,795,839,886],{"__ignoreMap":481},[485,773,774,776,778,781,783,785,787,789],{"class":487,"line":488},[485,775,492],{"class":491},[485,777,496],{"class":495},[485,779,780],{"class":499}," createRequestLogger",[485,782,503],{"class":495},[485,784,506],{"class":491},[485,786,509],{"class":495},[485,788,513],{"class":512},[485,790,516],{"class":495},[485,792,793],{"class":487,"line":519},[485,794,523],{"emptyLinePlaceholder":522},[485,796,797,799,801,803,805,807,809,812,814,816,819,821,823,826,828,830,833,835,837],{"class":487,"line":526},[485,798,667],{"class":666},[485,800,670],{"class":499},[485,802,673],{"class":495},[485,804,780],{"class":533},[485,806,536],{"class":499},[485,808,572],{"class":495},[485,810,811],{"class":575}," method",[485,813,579],{"class":495},[485,815,509],{"class":495},[485,817,818],{"class":512},"POST",[485,820,539],{"class":495},[485,822,547],{"class":495},[485,824,825],{"class":575}," path",[485,827,579],{"class":495},[485,829,509],{"class":495},[485,831,832],{"class":512},"\u002Fapi\u002Fcheckout",[485,834,539],{"class":495},[485,836,503],{"class":495},[485,838,557],{"class":499},[485,840,841,843,845,847,849,851,854,856,858,861,863,866,868,871,873,875,878,880,882,884],{"class":487,"line":560},[485,842,469],{"class":499},[485,844,418],{"class":495},[485,846,718],{"class":533},[485,848,536],{"class":499},[485,850,572],{"class":495},[485,852,853],{"class":575}," user",[485,855,579],{"class":495},[485,857,496],{"class":495},[485,859,860],{"class":575}," id",[485,862,579],{"class":495},[485,864,865],{"class":610}," 1",[485,867,547],{"class":495},[485,869,870],{"class":575}," plan",[485,872,579],{"class":495},[485,874,509],{"class":495},[485,876,877],{"class":512},"pro",[485,879,539],{"class":495},[485,881,503],{"class":495},[485,883,503],{"class":495},[485,885,557],{"class":499},[485,887,888,890,892,894],{"class":487,"line":755},[485,889,469],{"class":499},[485,891,418],{"class":495},[485,893,762],{"class":533},[485,895,765],{"class":499},[399,897,898,900,901,903,904,439,907,910,911,418],{},[432,899,626],{}," is a thin wrapper around ",[432,902,622],{}," that pre-populates ",[432,905,906],{},"method",[432,908,909],{},"path",", and ",[432,912,913],{},"requestId",[463,915,917],{"id":916},"request-logging-framework-middleware","Request Logging (framework middleware)",[399,919,920,921,924],{},"Framework integrations create a wide event logger automatically on each request. ",[432,922,923],{},"useLogger(event)"," retrieves the logger that's already attached to the request context:",[475,926,929],{"className":477,"code":927,"filename":928,"language":480,"meta":481,"style":481},"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",[432,930,931,950,954,985,1003,1046,1066,1073],{"__ignoreMap":481},[485,932,933,935,937,940,942,944,946,948],{"class":487,"line":488},[485,934,492],{"class":491},[485,936,496],{"class":495},[485,938,939],{"class":499}," useLogger",[485,941,503],{"class":495},[485,943,506],{"class":491},[485,945,509],{"class":495},[485,947,513],{"class":512},[485,949,516],{"class":495},[485,951,952],{"class":487,"line":519},[485,953,523],{"emptyLinePlaceholder":522},[485,955,956,959,962,965,967,970,973,977,979,982],{"class":487,"line":526},[485,957,958],{"class":491},"export",[485,960,961],{"class":491}," default",[485,963,964],{"class":533}," defineEventHandler",[485,966,536],{"class":499},[485,968,969],{"class":666},"async",[485,971,972],{"class":495}," (",[485,974,976],{"class":975},"sHdIc","event",[485,978,470],{"class":495},[485,980,981],{"class":666}," =>",[485,983,984],{"class":495}," {\n",[485,986,987,990,992,995,997,999,1001],{"class":487,"line":560},[485,988,989],{"class":666},"  const",[485,991,500],{"class":499},[485,993,994],{"class":495}," =",[485,996,939],{"class":533},[485,998,536],{"class":575},[485,1000,976],{"class":499},[485,1002,557],{"class":575},[485,1004,1005,1008,1010,1012,1014,1016,1018,1020,1022,1024,1026,1028,1030,1032,1034,1036,1038,1040,1042,1044],{"class":487,"line":755},[485,1006,1007],{"class":499},"  log",[485,1009,418],{"class":495},[485,1011,718],{"class":533},[485,1013,536],{"class":575},[485,1015,572],{"class":495},[485,1017,853],{"class":575},[485,1019,579],{"class":495},[485,1021,496],{"class":495},[485,1023,860],{"class":575},[485,1025,579],{"class":495},[485,1027,865],{"class":610},[485,1029,547],{"class":495},[485,1031,870],{"class":575},[485,1033,579],{"class":495},[485,1035,509],{"class":495},[485,1037,877],{"class":512},[485,1039,539],{"class":495},[485,1041,503],{"class":495},[485,1043,503],{"class":495},[485,1045,557],{"class":575},[485,1047,1049,1052,1054,1057,1059,1063],{"class":487,"line":1048},6,[485,1050,1051],{"class":491},"  return",[485,1053,496],{"class":495},[485,1055,1056],{"class":575}," success",[485,1058,579],{"class":495},[485,1060,1062],{"class":1061},"sfNiH"," true",[485,1064,1065],{"class":495}," }\n",[485,1067,1069],{"class":487,"line":1068},7,[485,1070,1072],{"class":1071},"sHwdD","  \u002F\u002F auto-emitted on response end\n",[485,1074,1076,1079],{"class":487,"line":1075},8,[485,1077,1078],{"class":495},"}",[485,1080,557],{"class":499},[403,1082,1083,1085,1086,439,1089,439,1092,1095,1096,1098],{"color":405,"icon":13},[432,1084,923],{}," 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 (",[432,1087,1088],{},"useLogger",[432,1090,1091],{},"req.log",[432,1093,1094],{},"c.get('log')",", etc.). In Nuxt, ",[432,1097,1088],{}," is auto-imported.",[420,1100,1102],{"id":1101},"when-to-use-what","When to Use What",[1104,1105,1106,1128],"table",{},[1107,1108,1109],"thead",{},[1110,1111,1112,1115,1119,1125],"tr",{},[1113,1114],"th",{},[1113,1116,1117],{},[432,1118,469],{},[1113,1120,1121,623,1123],{},[432,1122,622],{},[432,1124,626],{},[1113,1126,1127],{},"Framework middleware",[1129,1130,1131,1149,1169,1188,1203],"tbody",{},[1110,1132,1133,1140,1143,1146],{},[1134,1135,1136],"td",{},[1137,1138,1139],"strong",{},"Use case",[1134,1141,1142],{},"Quick one-off events",[1134,1144,1145],{},"Scripts, jobs, workers, queues, HTTP without a framework",[1134,1147,1148],{},"API routes with a framework integration",[1110,1150,1151,1156,1159,1165],{},[1134,1152,1153],{},[1137,1154,1155],{},"Context",[1134,1157,1158],{},"Single call",[1134,1160,1161,1162],{},"Accumulate with ",[432,1163,1164],{},"set()",[1134,1166,1161,1167],{},[432,1168,1164],{},[1110,1170,1171,1176,1179,1185],{},[1134,1172,1173],{},[1137,1174,1175],{},"Emit",[1134,1177,1178],{},"Immediate",[1134,1180,1181,1182],{},"Manual ",[432,1183,1184],{},"emit()",[1134,1186,1187],{},"Automatic on response end",[1110,1189,1190,1194,1197,1200],{},[1134,1191,1192],{},[1137,1193,165],{},[1134,1195,1196],{},"None",[1134,1198,1199],{},"You manage it",[1134,1201,1202],{},"Framework manages it",[1110,1204,1205,1210,1213,1215],{},[1134,1206,1207],{},[1137,1208,1209],{},"Output",[1134,1211,1212],{},"Console + drain",[1134,1214,1212],{},[1134,1216,1217],{},"Console + drain + enrich",[463,1219,1221],{"id":1220},"by-context","By context",[1104,1223,1224,1236],{},[1107,1225,1226],{},[1110,1227,1228,1230,1233],{},[1113,1229,1155],{},[1113,1231,1232],{},"Best fit",[1113,1234,1235],{},"Why",[1129,1237,1238,1256,1271,1292,1313,1331,1355,1373,1389,1409,1424],{},[1110,1239,1240,1245,1253],{},[1134,1241,1242],{},[1137,1243,1244],{},"HTTP route in Nuxt \u002F Next \u002F Hono \u002F Express \u002F …",[1134,1246,1247,1249,1250],{},[432,1248,923],{}," via ",[412,1251,1252],{"href":207},"framework integration",[1134,1254,1255],{},"One wide event per request, auto-emitted on response end",[1110,1257,1258,1263,1268],{},[1134,1259,1260],{},[1137,1261,1262],{},"HTTP handler without a framework",[1134,1264,1265],{},[432,1266,1267],{},"createRequestLogger({ method, path })",[1134,1269,1270],{},"Same shape as framework middleware, manual emit",[1110,1272,1273,1278,1289],{},[1134,1274,1275],{},[1137,1276,1277],{},"CLI tool \u002F one-shot script",[1134,1279,1280,1283,1284,1286,1287],{},[432,1281,1282],{},"log.*"," for steps + ",[432,1285,622],{}," for the run summary — see ",[412,1288,271],{"href":272},[1134,1290,1291],{},"Pretty in dev, structured in CI, one summary event for the whole run",[1110,1293,1294,1299,1310],{},[1134,1295,1296],{},[1137,1297,1298],{},"Published library",[1134,1300,1301,1303,1304,1307,1308],{},[432,1302,622],{}," only — never ",[432,1305,1306],{},"initLogger"," — see ",[412,1309,271],{"href":272},[1134,1311,1312],{},"Don't pollute the host app's global config or force a drain on consumers",[1110,1314,1315,1320,1328],{},[1134,1316,1317],{},[1137,1318,1319],{},"Background job \u002F queue worker \u002F cron",[1134,1321,1322,1325,1326],{},[432,1323,1324],{},"createLogger({ jobId, queue })"," per invocation — see ",[412,1327,271],{"href":272},[1134,1329,1330],{},"One wide event per job run, perfect for retry analysis",[1110,1332,1333,1338,1348],{},[1134,1334,1335],{},[1137,1336,1337],{},"Cloudflare Worker \u002F edge function",[1134,1339,1340,1343,1344,1307,1346],{},[432,1341,1342],{},"createWorkersLogger(req)"," or ",[432,1345,626],{},[412,1347,266],{"href":267},[1134,1349,1350,1351,1354],{},"Per-request event, no ",[432,1352,1353],{},"process"," globals required",[1110,1356,1357,1361,1370],{},[1134,1358,1359],{},[1137,1360,280],{},[1134,1362,1363,1365,1366,1325,1368],{},[432,1364,1306],{}," once + ",[432,1367,622],{},[412,1369,280],{"href":281},[1134,1371,1372],{},"Cold-start init, per-event scope, drain flush in the handler",[1110,1374,1375,1380,1386],{},[1134,1376,1377],{},[1137,1378,1379],{},"Batch \u002F pipeline step",[1134,1381,1382,1385],{},[432,1383,1384],{},"createLogger({ step })"," per stage",[1134,1387,1388],{},"One event per stage with inputs and outputs side by side",[1110,1390,1391,1396,1406],{},[1134,1392,1393],{},[1137,1394,1395],{},"AI agent \u002F LLM call",[1134,1397,1398,1400,1401],{},[432,1399,622],{}," + ",[412,1402,1403],{"href":77},[432,1404,1405],{},"createAILogger",[1134,1407,1408],{},"Token usage, tool calls, streaming metrics on the same wide event",[1110,1410,1411,1416,1421],{},[1134,1412,1413],{},[1137,1414,1415],{},"Library function called inside a request",[1134,1417,1418,1420],{},[432,1419,923],{}," from caller, or accept a logger as argument",[1134,1422,1423],{},"Inherit the parent's request context, contribute to the same wide event",[1110,1425,1426,1431,1436],{},[1134,1427,1428],{},[1137,1429,1430],{},"Shared workspace package",[1134,1432,1433,1434],{},"Treat it like a library — see ",[412,1435,271],{"href":272},[1134,1437,1438,1439,1441,1442,1444],{},"Host app owns ",[432,1440,1306],{}," \u002F drain; packages use ",[432,1443,622],{}," or accept a logger",[403,1446,1448,1449,415,1451,1453],{"color":405,"icon":1447},"i-lucide-lightbulb","None of these is an \"upgrade\" of another. Use ",[432,1450,469],{},[432,1452,622],{}," in the same file when it makes sense — they share the global drain, redaction, and types.",[420,1455,1457],{"id":1456},"shared-features","Shared Features",[399,1459,1460],{},"All three modes share the same foundation:",[1462,1463,1464,1475,1481,1503,1508],"ul",{},[1465,1466,1467,1470,1471,1474],"li",{},[1137,1468,1469],{},"Pretty output"," in development, ",[1137,1472,1473],{},"JSON"," in production (default, no configuration needed)",[1465,1476,1477,1480],{},[1137,1478,1479],{},"Drain pipeline"," to send events to Axiom, Sentry, PostHog, and more",[1465,1482,1483,1486,1487,439,1490,910,1493,1496,1497,1502],{},[1137,1484,1485],{},"Structured errors"," with ",[432,1488,1489],{},"why",[432,1491,1492],{},"fix",[432,1494,1495],{},"link",", plus optional backend-only ",[1137,1498,1499],{},[432,1500,1501],{},"internal"," for logs",[1465,1504,1505,1507],{},[1137,1506,175],{}," to control log volume in production",[1465,1509,1510,1513],{},[1137,1511,1512],{},"Zero dependencies",", ~6 kB gzip",[420,1515,1517],{"id":1516},"next-steps","Next Steps",[1462,1519,1520,1528,1533,1538],{},[1465,1521,1522,1524,1525,1527],{},[412,1523,46],{"href":47},": The ",[432,1526,469],{}," API in detail",[1465,1529,1530,1532],{},[412,1531,51],{"href":52},": Accumulating context and emitting events",[1465,1534,1535,1537],{},[412,1536,56],{"href":57},": Errors with actionable context",[1465,1539,1540,1542],{},[412,1541,202],{"href":207},": Auto-managed request logging per framework",[1544,1545,1546],"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":481,"searchDepth":519,"depth":519,"links":1548},[1549,1550,1557,1560,1561],{"id":422,"depth":519,"text":423},{"id":460,"depth":519,"text":461,"children":1551},[1552,1554,1556],{"id":465,"depth":526,"text":1553},"Simple Logging (log)",{"id":618,"depth":526,"text":1555},"Wide Events (createLogger \u002F createRequestLogger)",{"id":916,"depth":526,"text":917},{"id":1101,"depth":519,"text":1102,"children":1558},[1559],{"id":1220,"depth":526,"text":1221},{"id":1456,"depth":519,"text":1457},{"id":1516,"depth":519,"text":1517},"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",[1565,1567],{"label":46,"icon":49,"to":47,"color":409,"variant":1566},"subtle",{"label":51,"icon":54,"to":52,"color":409,"variant":1566},{},{"title":41,"icon":44},{"title":394,"description":1562},"oN0tSYK7JDpdBRuwSFG4IWdX6tcKVs6aRhKxJc3YMhc",[1573,1575],{"title":30,"path":31,"stem":32,"description":1574,"icon":33,"children":-1},"Side-by-side comparison of evlog with pino, winston, and consola. Feature parity matrix, honest gaps, and migration snippets so you can switch with no surprises.",{"title":46,"path":47,"stem":48,"description":1576,"icon":49,"children":-1},"evlog's general-purpose logger. A drop-in for console.log, pino, or consola, with the same level filtering, drain pipeline, redaction, and pretty\u002FJSON output as wide events.",1778106394712]