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