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