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