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