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