[{"data":1,"prerenderedAt":1592},["ShallowReactive",2],{"navigation_docs":3,"-logging-overview":407,"-logging-overview-surround":1587},[4,35,159,201,289,304,391],{"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},"Build on top","\u002Fbuild-on-top","5.build-on-top",[294,299],{"title":295,"path":296,"stem":297,"icon":298},"Identity headers","\u002Fbuild-on-top\u002Fidentity-headers","5.build-on-top\u002F1.identity-headers","i-lucide-fingerprint",{"title":300,"path":301,"stem":302,"icon":303},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F4.fs-reader","i-lucide-folder-search",{"title":305,"path":306,"stem":307,"children":308,"page":34},"Adapters","\u002Fadapters","6.adapters",[309,312,352,367],{"title":41,"path":310,"stem":311,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":313,"path":314,"stem":315,"children":316,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[317,322,327,332,337,342,347],{"title":318,"path":319,"stem":320,"icon":321},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":323,"path":324,"stem":325,"icon":326},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":328,"path":329,"stem":330,"icon":331},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":333,"path":334,"stem":335,"icon":336},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":338,"path":339,"stem":340,"icon":341},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":343,"path":344,"stem":345,"icon":346},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":348,"path":349,"stem":350,"icon":351},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":353,"path":354,"stem":355,"children":356,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[357,362],{"title":358,"path":359,"stem":360,"icon":361},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":363,"path":364,"stem":365,"icon":366},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":368,"path":369,"stem":370,"children":371,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[372,377,382,386],{"title":373,"path":374,"stem":375,"icon":376},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":378,"path":379,"stem":380,"icon":381},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":383,"path":384,"stem":385,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":387,"path":388,"stem":389,"icon":390},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":392,"path":393,"stem":394,"children":395,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[396,399,403],{"title":41,"path":397,"stem":398,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":400,"path":401,"stem":402,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":404,"path":405,"stem":406,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":408,"title":409,"body":410,"description":1577,"extension":1578,"links":1579,"meta":1583,"navigation":1584,"path":42,"seo":1585,"stem":43,"__hash__":1586},"docs\u002F2.logging\u002F0.overview.md","Logging Overview",{"type":411,"value":412,"toc":1562},"minimark",[413,417,422,434,439,473,477,486,489,631,642,645,911,929,933,940,1096,1114,1118,1233,1237,1460,1469,1473,1476,1529,1533,1558],[414,415,416],"p",{},"evlog provides three logging APIs, each designed for a different context. You can use all three in the same project.",[418,419,421],"callout",{"color":420,"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.",[418,423,425,426,430,431,433],{"color":424,"icon":381},"neutral","Not running an HTTP framework? See ",[427,428,429],"a",{"href":272},"Standalone TypeScript"," and ",[427,432,266],{"href":267},".",[435,436,438],"h2",{"id":437},"the-three-modes","The Three Modes",[440,441,442,465,468],"card-group",{},[443,444,445,446,450,451,454,455,454,458,454,461,464],"card",{"color":424,"icon":49,"title":46,"to":47},"A fully-featured general-purpose logger. Replaces ",[447,448,449],"code",{},"console.log",", consola, pino, or winston with ",[447,452,453],{},"log.info",", ",[447,456,457],{},"log.error",[447,459,460],{},"log.warn",[447,462,463],{},"log.debug"," — same level filtering, drain pipeline, redaction, and pretty\u002FJSON output.",[443,466,467],{"color":424,"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.",[443,469,472],{"color":424,"icon":470,"title":471,"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.",[435,474,476],{"id":475},"quick-comparison","Quick Comparison",[478,479,481,482,485],"h3",{"id":480},"simple-logging-log","Simple Logging (",[447,483,484],{},"log",")",[414,487,488],{},"One event per call. No accumulation, no lifecycle management.",[490,491,497],"pre",{"className":492,"code":493,"filename":494,"language":495,"meta":496,"style":496},"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","",[447,498,499,532,539,573],{"__ignoreMap":496},[500,501,504,508,512,516,519,522,525,529],"span",{"class":502,"line":503},"line",1,[500,505,507],{"class":506},"s7zQu","import",[500,509,511],{"class":510},"sMK4o"," {",[500,513,515],{"class":514},"sTEyZ"," log",[500,517,518],{"class":510}," }",[500,520,521],{"class":506}," from",[500,523,524],{"class":510}," '",[500,526,528],{"class":527},"sfazB","evlog",[500,530,531],{"class":510},"'\n",[500,533,535],{"class":502,"line":534},2,[500,536,538],{"emptyLinePlaceholder":537},true,"\n",[500,540,542,544,546,549,552,555,558,560,563,565,568,570],{"class":502,"line":541},3,[500,543,484],{"class":514},[500,545,433],{"class":510},[500,547,420],{"class":548},"s2Zo4",[500,550,551],{"class":514},"(",[500,553,554],{"class":510},"'",[500,556,557],{"class":527},"auth",[500,559,554],{"class":510},[500,561,562],{"class":510},",",[500,564,524],{"class":510},[500,566,567],{"class":527},"User logged in",[500,569,554],{"class":510},[500,571,572],{"class":514},")\n",[500,574,576,578,580,583,585,588,592,595,597,600,602,604,607,609,611,614,616,618,621,623,627,629],{"class":502,"line":575},4,[500,577,484],{"class":514},[500,579,433],{"class":510},[500,581,582],{"class":548},"error",[500,584,551],{"class":514},[500,586,587],{"class":510},"{",[500,589,591],{"class":590},"swJcz"," action",[500,593,594],{"class":510},":",[500,596,524],{"class":510},[500,598,599],{"class":527},"payment",[500,601,554],{"class":510},[500,603,562],{"class":510},[500,605,606],{"class":590}," error",[500,608,594],{"class":510},[500,610,524],{"class":510},[500,612,613],{"class":527},"card_declined",[500,615,554],{"class":510},[500,617,562],{"class":510},[500,619,620],{"class":590}," userId",[500,622,594],{"class":510},[500,624,626],{"class":625},"sbssI"," 42",[500,628,518],{"class":510},[500,630,572],{"class":514},[478,632,634,635,638,639,485],{"id":633},"wide-events-createlogger-createrequestlogger","Wide Events (",[447,636,637],{},"createLogger"," \u002F ",[447,640,641],{},"createRequestLogger",[414,643,644],{},"One event per unit of work. Accumulate context progressively, emit when done.",[646,647,648,781],"code-group",{},[490,649,652],{"className":492,"code":650,"filename":651,"language":495,"meta":496,"style":496},"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",[447,653,654,673,677,725,768],{"__ignoreMap":496},[500,655,656,658,660,663,665,667,669,671],{"class":502,"line":503},[500,657,507],{"class":506},[500,659,511],{"class":510},[500,661,662],{"class":514}," createLogger",[500,664,518],{"class":510},[500,666,521],{"class":506},[500,668,524],{"class":510},[500,670,528],{"class":527},[500,672,531],{"class":510},[500,674,675],{"class":502,"line":534},[500,676,538],{"emptyLinePlaceholder":537},[500,678,679,683,686,689,691,693,695,698,700,702,705,707,709,712,714,716,719,721,723],{"class":502,"line":541},[500,680,682],{"class":681},"spNyl","const",[500,684,685],{"class":514}," log ",[500,687,688],{"class":510},"=",[500,690,662],{"class":548},[500,692,551],{"class":514},[500,694,587],{"class":510},[500,696,697],{"class":590}," jobId",[500,699,594],{"class":510},[500,701,524],{"class":510},[500,703,704],{"class":527},"sync-001",[500,706,554],{"class":510},[500,708,562],{"class":510},[500,710,711],{"class":590}," queue",[500,713,594],{"class":510},[500,715,524],{"class":510},[500,717,718],{"class":527},"emails",[500,720,554],{"class":510},[500,722,518],{"class":510},[500,724,572],{"class":514},[500,726,727,729,731,734,736,738,741,743,745,748,750,753,755,758,760,762,764,766],{"class":502,"line":575},[500,728,484],{"class":514},[500,730,433],{"class":510},[500,732,733],{"class":548},"set",[500,735,551],{"class":514},[500,737,587],{"class":510},[500,739,740],{"class":590}," batch",[500,742,594],{"class":510},[500,744,511],{"class":510},[500,746,747],{"class":590}," size",[500,749,594],{"class":510},[500,751,752],{"class":625}," 50",[500,754,562],{"class":510},[500,756,757],{"class":590}," processed",[500,759,594],{"class":510},[500,761,752],{"class":625},[500,763,518],{"class":510},[500,765,518],{"class":510},[500,767,572],{"class":514},[500,769,771,773,775,778],{"class":502,"line":770},5,[500,772,484],{"class":514},[500,774,433],{"class":510},[500,776,777],{"class":548},"emit",[500,779,780],{"class":514},"()\n",[490,782,785],{"className":492,"code":783,"filename":784,"language":495,"meta":496,"style":496},"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",[447,786,787,806,810,854,901],{"__ignoreMap":496},[500,788,789,791,793,796,798,800,802,804],{"class":502,"line":503},[500,790,507],{"class":506},[500,792,511],{"class":510},[500,794,795],{"class":514}," createRequestLogger",[500,797,518],{"class":510},[500,799,521],{"class":506},[500,801,524],{"class":510},[500,803,528],{"class":527},[500,805,531],{"class":510},[500,807,808],{"class":502,"line":534},[500,809,538],{"emptyLinePlaceholder":537},[500,811,812,814,816,818,820,822,824,827,829,831,834,836,838,841,843,845,848,850,852],{"class":502,"line":541},[500,813,682],{"class":681},[500,815,685],{"class":514},[500,817,688],{"class":510},[500,819,795],{"class":548},[500,821,551],{"class":514},[500,823,587],{"class":510},[500,825,826],{"class":590}," method",[500,828,594],{"class":510},[500,830,524],{"class":510},[500,832,833],{"class":527},"POST",[500,835,554],{"class":510},[500,837,562],{"class":510},[500,839,840],{"class":590}," path",[500,842,594],{"class":510},[500,844,524],{"class":510},[500,846,847],{"class":527},"\u002Fapi\u002Fcheckout",[500,849,554],{"class":510},[500,851,518],{"class":510},[500,853,572],{"class":514},[500,855,856,858,860,862,864,866,869,871,873,876,878,881,883,886,888,890,893,895,897,899],{"class":502,"line":575},[500,857,484],{"class":514},[500,859,433],{"class":510},[500,861,733],{"class":548},[500,863,551],{"class":514},[500,865,587],{"class":510},[500,867,868],{"class":590}," user",[500,870,594],{"class":510},[500,872,511],{"class":510},[500,874,875],{"class":590}," id",[500,877,594],{"class":510},[500,879,880],{"class":625}," 1",[500,882,562],{"class":510},[500,884,885],{"class":590}," plan",[500,887,594],{"class":510},[500,889,524],{"class":510},[500,891,892],{"class":527},"pro",[500,894,554],{"class":510},[500,896,518],{"class":510},[500,898,518],{"class":510},[500,900,572],{"class":514},[500,902,903,905,907,909],{"class":502,"line":770},[500,904,484],{"class":514},[500,906,433],{"class":510},[500,908,777],{"class":548},[500,910,780],{"class":514},[414,912,913,915,916,918,919,454,922,925,926,433],{},[447,914,641],{}," is a thin wrapper around ",[447,917,637],{}," that pre-populates ",[447,920,921],{},"method",[447,923,924],{},"path",", and ",[447,927,928],{},"requestId",[478,930,932],{"id":931},"request-logging-framework-middleware","Request Logging (framework middleware)",[414,934,935,936,939],{},"Framework integrations create a wide event logger automatically on each request. ",[447,937,938],{},"useLogger(event)"," retrieves the logger that's already attached to the request context:",[490,941,944],{"className":492,"code":942,"filename":943,"language":495,"meta":496,"style":496},"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",[447,945,946,965,969,1000,1018,1061,1081,1088],{"__ignoreMap":496},[500,947,948,950,952,955,957,959,961,963],{"class":502,"line":503},[500,949,507],{"class":506},[500,951,511],{"class":510},[500,953,954],{"class":514}," useLogger",[500,956,518],{"class":510},[500,958,521],{"class":506},[500,960,524],{"class":510},[500,962,528],{"class":527},[500,964,531],{"class":510},[500,966,967],{"class":502,"line":534},[500,968,538],{"emptyLinePlaceholder":537},[500,970,971,974,977,980,982,985,988,992,994,997],{"class":502,"line":541},[500,972,973],{"class":506},"export",[500,975,976],{"class":506}," default",[500,978,979],{"class":548}," defineEventHandler",[500,981,551],{"class":514},[500,983,984],{"class":681},"async",[500,986,987],{"class":510}," (",[500,989,991],{"class":990},"sHdIc","event",[500,993,485],{"class":510},[500,995,996],{"class":681}," =>",[500,998,999],{"class":510}," {\n",[500,1001,1002,1005,1007,1010,1012,1014,1016],{"class":502,"line":575},[500,1003,1004],{"class":681},"  const",[500,1006,515],{"class":514},[500,1008,1009],{"class":510}," =",[500,1011,954],{"class":548},[500,1013,551],{"class":590},[500,1015,991],{"class":514},[500,1017,572],{"class":590},[500,1019,1020,1023,1025,1027,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051,1053,1055,1057,1059],{"class":502,"line":770},[500,1021,1022],{"class":514},"  log",[500,1024,433],{"class":510},[500,1026,733],{"class":548},[500,1028,551],{"class":590},[500,1030,587],{"class":510},[500,1032,868],{"class":590},[500,1034,594],{"class":510},[500,1036,511],{"class":510},[500,1038,875],{"class":590},[500,1040,594],{"class":510},[500,1042,880],{"class":625},[500,1044,562],{"class":510},[500,1046,885],{"class":590},[500,1048,594],{"class":510},[500,1050,524],{"class":510},[500,1052,892],{"class":527},[500,1054,554],{"class":510},[500,1056,518],{"class":510},[500,1058,518],{"class":510},[500,1060,572],{"class":590},[500,1062,1064,1067,1069,1072,1074,1078],{"class":502,"line":1063},6,[500,1065,1066],{"class":506},"  return",[500,1068,511],{"class":510},[500,1070,1071],{"class":590}," success",[500,1073,594],{"class":510},[500,1075,1077],{"class":1076},"sfNiH"," true",[500,1079,1080],{"class":510}," }\n",[500,1082,1084],{"class":502,"line":1083},7,[500,1085,1087],{"class":1086},"sHwdD","  \u002F\u002F auto-emitted on response end\n",[500,1089,1091,1094],{"class":502,"line":1090},8,[500,1092,1093],{"class":510},"}",[500,1095,572],{"class":514},[418,1097,1098,1100,1101,454,1104,454,1107,1110,1111,1113],{"color":420,"icon":13},[447,1099,938],{}," 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 (",[447,1102,1103],{},"useLogger",[447,1105,1106],{},"req.log",[447,1108,1109],{},"c.get('log')",", etc.). In Nuxt, ",[447,1112,1103],{}," is auto-imported.",[435,1115,1117],{"id":1116},"when-to-use-what","When to Use What",[1119,1120,1121,1143],"table",{},[1122,1123,1124],"thead",{},[1125,1126,1127,1130,1134,1140],"tr",{},[1128,1129],"th",{},[1128,1131,1132],{},[447,1133,484],{},[1128,1135,1136,638,1138],{},[447,1137,637],{},[447,1139,641],{},[1128,1141,1142],{},"Framework middleware",[1144,1145,1146,1164,1184,1203,1218],"tbody",{},[1125,1147,1148,1155,1158,1161],{},[1149,1150,1151],"td",{},[1152,1153,1154],"strong",{},"Use case",[1149,1156,1157],{},"Quick one-off events",[1149,1159,1160],{},"Scripts, jobs, workers, queues, HTTP without a framework",[1149,1162,1163],{},"API routes with a framework integration",[1125,1165,1166,1171,1174,1180],{},[1149,1167,1168],{},[1152,1169,1170],{},"Context",[1149,1172,1173],{},"Single call",[1149,1175,1176,1177],{},"Accumulate with ",[447,1178,1179],{},"set()",[1149,1181,1176,1182],{},[447,1183,1179],{},[1125,1185,1186,1191,1194,1200],{},[1149,1187,1188],{},[1152,1189,1190],{},"Emit",[1149,1192,1193],{},"Immediate",[1149,1195,1196,1197],{},"Manual ",[447,1198,1199],{},"emit()",[1149,1201,1202],{},"Automatic on response end",[1125,1204,1205,1209,1212,1215],{},[1149,1206,1207],{},[1152,1208,165],{},[1149,1210,1211],{},"None",[1149,1213,1214],{},"You manage it",[1149,1216,1217],{},"Framework manages it",[1125,1219,1220,1225,1228,1230],{},[1149,1221,1222],{},[1152,1223,1224],{},"Output",[1149,1226,1227],{},"Console + drain",[1149,1229,1227],{},[1149,1231,1232],{},"Console + drain + enrich",[478,1234,1236],{"id":1235},"by-context","By context",[1119,1238,1239,1251],{},[1122,1240,1241],{},[1125,1242,1243,1245,1248],{},[1128,1244,1170],{},[1128,1246,1247],{},"Best fit",[1128,1249,1250],{},"Why",[1144,1252,1253,1271,1286,1307,1328,1346,1370,1388,1404,1424,1439],{},[1125,1254,1255,1260,1268],{},[1149,1256,1257],{},[1152,1258,1259],{},"HTTP route in Nuxt \u002F Next \u002F Hono \u002F Express \u002F …",[1149,1261,1262,1264,1265],{},[447,1263,938],{}," via ",[427,1266,1267],{"href":207},"framework integration",[1149,1269,1270],{},"One wide event per request, auto-emitted on response end",[1125,1272,1273,1278,1283],{},[1149,1274,1275],{},[1152,1276,1277],{},"HTTP handler without a framework",[1149,1279,1280],{},[447,1281,1282],{},"createRequestLogger({ method, path })",[1149,1284,1285],{},"Same shape as framework middleware, manual emit",[1125,1287,1288,1293,1304],{},[1149,1289,1290],{},[1152,1291,1292],{},"CLI tool \u002F one-shot script",[1149,1294,1295,1298,1299,1301,1302],{},[447,1296,1297],{},"log.*"," for steps + ",[447,1300,637],{}," for the run summary — see ",[427,1303,271],{"href":272},[1149,1305,1306],{},"Pretty in dev, structured in CI, one summary event for the whole run",[1125,1308,1309,1314,1325],{},[1149,1310,1311],{},[1152,1312,1313],{},"Published library",[1149,1315,1316,1318,1319,1322,1323],{},[447,1317,637],{}," only — never ",[447,1320,1321],{},"initLogger"," — see ",[427,1324,271],{"href":272},[1149,1326,1327],{},"Don't pollute the host app's global config or force a drain on consumers",[1125,1329,1330,1335,1343],{},[1149,1331,1332],{},[1152,1333,1334],{},"Background job \u002F queue worker \u002F cron",[1149,1336,1337,1340,1341],{},[447,1338,1339],{},"createLogger({ jobId, queue })"," per invocation — see ",[427,1342,271],{"href":272},[1149,1344,1345],{},"One wide event per job run, perfect for retry analysis",[1125,1347,1348,1353,1363],{},[1149,1349,1350],{},[1152,1351,1352],{},"Cloudflare Worker \u002F edge function",[1149,1354,1355,1358,1359,1322,1361],{},[447,1356,1357],{},"createWorkersLogger(req)"," or ",[447,1360,641],{},[427,1362,266],{"href":267},[1149,1364,1365,1366,1369],{},"Per-request event, no ",[447,1367,1368],{},"process"," globals required",[1125,1371,1372,1376,1385],{},[1149,1373,1374],{},[1152,1375,280],{},[1149,1377,1378,1380,1381,1340,1383],{},[447,1379,1321],{}," once + ",[447,1382,637],{},[427,1384,280],{"href":281},[1149,1386,1387],{},"Cold-start init, per-event scope, drain flush in the handler",[1125,1389,1390,1395,1401],{},[1149,1391,1392],{},[1152,1393,1394],{},"Batch \u002F pipeline step",[1149,1396,1397,1400],{},[447,1398,1399],{},"createLogger({ step })"," per stage",[1149,1402,1403],{},"One event per stage with inputs and outputs side by side",[1125,1405,1406,1411,1421],{},[1149,1407,1408],{},[1152,1409,1410],{},"AI agent \u002F LLM call",[1149,1412,1413,1415,1416],{},[447,1414,637],{}," + ",[427,1417,1418],{"href":77},[447,1419,1420],{},"createAILogger",[1149,1422,1423],{},"Token usage, tool calls, streaming metrics on the same wide event",[1125,1425,1426,1431,1436],{},[1149,1427,1428],{},[1152,1429,1430],{},"Library function called inside a request",[1149,1432,1433,1435],{},[447,1434,938],{}," from caller, or accept a logger as argument",[1149,1437,1438],{},"Inherit the parent's request context, contribute to the same wide event",[1125,1440,1441,1446,1451],{},[1149,1442,1443],{},[1152,1444,1445],{},"Shared workspace package",[1149,1447,1448,1449],{},"Treat it like a library — see ",[427,1450,271],{"href":272},[1149,1452,1453,1454,1456,1457,1459],{},"Host app owns ",[447,1455,1321],{}," \u002F drain; packages use ",[447,1458,637],{}," or accept a logger",[418,1461,1463,1464,430,1466,1468],{"color":420,"icon":1462},"i-lucide-lightbulb","None of these is an \"upgrade\" of another. Use ",[447,1465,484],{},[447,1467,637],{}," in the same file when it makes sense — they share the global drain, redaction, and types.",[435,1470,1472],{"id":1471},"shared-features","Shared Features",[414,1474,1475],{},"All three modes share the same foundation:",[1477,1478,1479,1490,1496,1518,1523],"ul",{},[1480,1481,1482,1485,1486,1489],"li",{},[1152,1483,1484],{},"Pretty output"," in development, ",[1152,1487,1488],{},"JSON"," in production (default, no configuration needed)",[1480,1491,1492,1495],{},[1152,1493,1494],{},"Drain pipeline"," to send events to Axiom, Sentry, PostHog, and more",[1480,1497,1498,1501,1502,454,1505,925,1508,1511,1512,1517],{},[1152,1499,1500],{},"Structured errors"," with ",[447,1503,1504],{},"why",[447,1506,1507],{},"fix",[447,1509,1510],{},"link",", plus optional backend-only ",[1152,1513,1514],{},[447,1515,1516],{},"internal"," for logs",[1480,1519,1520,1522],{},[1152,1521,175],{}," to control log volume in production",[1480,1524,1525,1528],{},[1152,1526,1527],{},"Zero dependencies",", ~6 kB gzip",[435,1530,1532],{"id":1531},"next-steps","Next Steps",[1477,1534,1535,1543,1548,1553],{},[1480,1536,1537,1539,1540,1542],{},[427,1538,46],{"href":47},": The ",[447,1541,484],{}," API in detail",[1480,1544,1545,1547],{},[427,1546,51],{"href":52},": Accumulating context and emitting events",[1480,1549,1550,1552],{},[427,1551,56],{"href":57},": Errors with actionable context",[1480,1554,1555,1557],{},[427,1556,202],{"href":207},": Auto-managed request logging per framework",[1559,1560,1561],"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":496,"searchDepth":534,"depth":534,"links":1563},[1564,1565,1572,1575,1576],{"id":437,"depth":534,"text":438},{"id":475,"depth":534,"text":476,"children":1566},[1567,1569,1571],{"id":480,"depth":541,"text":1568},"Simple Logging (log)",{"id":633,"depth":541,"text":1570},"Wide Events (createLogger \u002F createRequestLogger)",{"id":931,"depth":541,"text":932},{"id":1116,"depth":534,"text":1117,"children":1573},[1574],{"id":1235,"depth":541,"text":1236},{"id":1471,"depth":534,"text":1472},{"id":1531,"depth":534,"text":1532},"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",[1580,1582],{"label":46,"icon":49,"to":47,"color":424,"variant":1581},"subtle",{"label":51,"icon":54,"to":52,"color":424,"variant":1581},{},{"title":41,"icon":44},{"title":409,"description":1577},"oN0tSYK7JDpdBRuwSFG4IWdX6tcKVs6aRhKxJc3YMhc",[1588,1590],{"title":30,"path":31,"stem":32,"description":1589,"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":1591,"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.",1778327124352]