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