[{"data":1,"prerenderedAt":1487},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-aws-lambda":402,"-frameworks-aws-lambda-surround":1482},[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":280,"body":404,"description":1475,"extension":1476,"links":1477,"meta":1478,"navigation":1479,"path":281,"seo":1480,"stem":282,"__hash__":1481},"docs\u002F4.frameworks\u002F16.aws-lambda.md",{"type":405,"value":406,"toc":1463},"minimark",[407,438,478,487,498,513,527,530,535,606,610,1119,1128,1135,1153,1278,1291,1295,1313,1419,1423,1459],[408,409,410,411,415,416,420,421,425,426,429,430,433,434,437],"p",{},"AWS Lambda has ",[412,413,414],"strong",{},"no HTTP middleware lifecycle"," like Nuxt or Express, so evlog behaves like ",[417,418,419],"a",{"href":272},"standalone TypeScript",": call ",[422,423,424],"code",{},"initLogger()"," once, create a logger ",[412,427,428],{},"per invocation"," (or per SQS message) with ",[422,431,432],{},"createLogger()",", then call ",[422,435,436],{},"log.emit()"," when work finishes.",[439,440,443,446,465],"prompt",{":actions":441,"description":442,"icon":283},"[\"copy\",\"cursor\",\"windsurf\"]","Set up evlog in my AWS Lambda function",[408,444,445],{},"Set up evlog in an AWS Lambda function (e.g. SQS consumer).",[447,448,449,453,456,459,462],"ul",{},[450,451,452],"li",{},"Install evlog: pnpm add evlog",[450,454,455],{},"Call initLogger({ env: { service: 'my-fn' } }) once at module load (cold start)",[450,457,458],{},"In the handler, create a new createLogger({ messageId, ... }) per invocation or per message",[450,460,461],{},"Use log.set() to accumulate context; call log.emit() when done",[450,463,464],{},"Avoid a single module-level logger instance reused across invocations (Lambda reuses runtimes)",[408,466,467,468,473,474],{},"Docs: ",[417,469,470],{"href":470,"rel":471},"https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Faws-lambda",[472],"nofollow","\nAdapters: ",[417,475,476],{"href":476,"rel":477},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters",[472],[479,480,482,483,486],"h2",{"id":481},"why-not-one-global-createlogger","Why not one global ",[422,484,485],{},"createLogger","?",[408,488,489,490,493,494,497],{},"Lambda ",[412,491,492],{},"execution environments are reused",": the same process can handle many invocations in sequence. Module-level variables persist, so ",[412,495,496],{},"one shared logger instance"," can leak fields from a previous invocation into the next.",[408,499,500,503,504,506,507,512],{},[412,501,502],{},"Do this:"," ",[422,505,424],{}," once at the top level (configuration only), and ",[412,508,509,511],{},[422,510,432],{}," inside the handler"," (or inside the loop over SQS records) for each unit of work.",[408,514,515,518,519,522,523,526],{},[412,516,517],{},"Dependency injection"," (passing ",[422,520,521],{},"log"," into functions) is optional—it helps tests and clarity—but what matters is ",[412,524,525],{},"one logger per invocation",", not whether you use DI.",[479,528,20],{"id":529},"quick-start",[531,532,534],"h3",{"id":533},"_1-install","1. Install",[536,537,538,563,577,591],"code-group",{},[539,540,546],"pre",{"className":541,"code":542,"filename":543,"language":544,"meta":545,"style":545},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add evlog\n","pnpm","bash","",[422,547,548],{"__ignoreMap":545},[549,550,553,556,560],"span",{"class":551,"line":552},"line",1,[549,554,543],{"class":555},"sBMFI",[549,557,559],{"class":558},"sfazB"," add",[549,561,562],{"class":558}," evlog\n",[539,564,567],{"className":541,"code":565,"filename":566,"language":544,"meta":545,"style":545},"bun add evlog\n","bun",[422,568,569],{"__ignoreMap":545},[549,570,571,573,575],{"class":551,"line":552},[549,572,566],{"class":555},[549,574,559],{"class":558},[549,576,562],{"class":558},[539,578,581],{"className":541,"code":579,"filename":580,"language":544,"meta":545,"style":545},"yarn add evlog\n","yarn",[422,582,583],{"__ignoreMap":545},[549,584,585,587,589],{"class":551,"line":552},[549,586,580],{"class":555},[549,588,559],{"class":558},[549,590,562],{"class":558},[539,592,595],{"className":541,"code":593,"filename":594,"language":544,"meta":545,"style":545},"npm install evlog\n","npm",[422,596,597],{"__ignoreMap":545},[549,598,599,601,604],{"class":551,"line":552},[549,600,594],{"class":555},[549,602,603],{"class":558}," install",[549,605,562],{"class":558},[531,607,609],{"id":608},"_2-initialize-once-log-per-invocation","2. Initialize once, log per invocation",[539,611,616],{"className":612,"code":613,"filename":614,"language":615,"meta":545,"style":545},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import type { SQSEvent } from 'aws-lambda'\nimport { initLogger, createLogger } from 'evlog'\n\ninitLogger({\n  env: { service: 'sqs-consumer', environment: process.env.NODE_ENV },\n})\n\nexport async function handler(event: SQSEvent) {\n  for (const record of event.Records) {\n    const log = createLogger({\n      messageId: record.messageId,\n      approximateReceiveCount: record.attributes?.ApproximateReceiveCount,\n    })\n\n    try {\n      log.set({ queue: { name: record.eventSourceARN } })\n      \u002F\u002F … parse record.body and process the message\n      log.set({ status: 'ok' })\n    } catch (error) {\n      log.error(error instanceof Error ? error : new Error(String(error)))\n      log.set({ status: 'error' })\n      throw error\n    } finally {\n      log.emit()\n    }\n  }\n}\n","src\u002Fhandler.ts","typescript",[422,617,618,650,677,684,697,746,755,760,792,823,841,859,882,890,895,903,944,951,980,997,1042,1069,1078,1088,1101,1107,1113],{"__ignoreMap":545},[549,619,620,624,627,631,635,638,641,644,647],{"class":551,"line":552},[549,621,623],{"class":622},"s7zQu","import",[549,625,626],{"class":622}," type",[549,628,630],{"class":629},"sMK4o"," {",[549,632,634],{"class":633},"sTEyZ"," SQSEvent",[549,636,637],{"class":629}," }",[549,639,640],{"class":622}," from",[549,642,643],{"class":629}," '",[549,645,646],{"class":558},"aws-lambda",[549,648,649],{"class":629},"'\n",[549,651,653,655,657,660,663,666,668,670,672,675],{"class":551,"line":652},2,[549,654,623],{"class":622},[549,656,630],{"class":629},[549,658,659],{"class":633}," initLogger",[549,661,662],{"class":629},",",[549,664,665],{"class":633}," createLogger",[549,667,637],{"class":629},[549,669,640],{"class":622},[549,671,643],{"class":629},[549,673,674],{"class":558},"evlog",[549,676,649],{"class":629},[549,678,680],{"class":551,"line":679},3,[549,681,683],{"emptyLinePlaceholder":682},true,"\n",[549,685,687,691,694],{"class":551,"line":686},4,[549,688,690],{"class":689},"s2Zo4","initLogger",[549,692,693],{"class":633},"(",[549,695,696],{"class":629},"{\n",[549,698,700,704,707,709,712,714,716,719,722,724,727,729,732,735,738,740,743],{"class":551,"line":699},5,[549,701,703],{"class":702},"swJcz","  env",[549,705,706],{"class":629},":",[549,708,630],{"class":629},[549,710,711],{"class":702}," service",[549,713,706],{"class":629},[549,715,643],{"class":629},[549,717,718],{"class":558},"sqs-consumer",[549,720,721],{"class":629},"'",[549,723,662],{"class":629},[549,725,726],{"class":702}," environment",[549,728,706],{"class":629},[549,730,731],{"class":633}," process",[549,733,734],{"class":629},".",[549,736,737],{"class":633},"env",[549,739,734],{"class":629},[549,741,742],{"class":633},"NODE_ENV ",[549,744,745],{"class":629},"},\n",[549,747,749,752],{"class":551,"line":748},6,[549,750,751],{"class":629},"}",[549,753,754],{"class":633},")\n",[549,756,758],{"class":551,"line":757},7,[549,759,683],{"emptyLinePlaceholder":682},[549,761,763,766,770,773,776,778,782,784,786,789],{"class":551,"line":762},8,[549,764,765],{"class":622},"export",[549,767,769],{"class":768},"spNyl"," async",[549,771,772],{"class":768}," function",[549,774,775],{"class":689}," handler",[549,777,693],{"class":629},[549,779,781],{"class":780},"sHdIc","event",[549,783,706],{"class":629},[549,785,634],{"class":555},[549,787,788],{"class":629},")",[549,790,791],{"class":629}," {\n",[549,793,795,798,801,804,807,810,813,815,818,821],{"class":551,"line":794},9,[549,796,797],{"class":622},"  for",[549,799,800],{"class":702}," (",[549,802,803],{"class":768},"const",[549,805,806],{"class":633}," record",[549,808,809],{"class":629}," of",[549,811,812],{"class":633}," event",[549,814,734],{"class":629},[549,816,817],{"class":633},"Records",[549,819,820],{"class":702},") ",[549,822,696],{"class":629},[549,824,826,829,832,835,837,839],{"class":551,"line":825},10,[549,827,828],{"class":768},"    const",[549,830,831],{"class":633}," log",[549,833,834],{"class":629}," =",[549,836,665],{"class":689},[549,838,693],{"class":702},[549,840,696],{"class":629},[549,842,844,847,849,851,853,856],{"class":551,"line":843},11,[549,845,846],{"class":702},"      messageId",[549,848,706],{"class":629},[549,850,806],{"class":633},[549,852,734],{"class":629},[549,854,855],{"class":633},"messageId",[549,857,858],{"class":629},",\n",[549,860,862,865,867,869,871,874,877,880],{"class":551,"line":861},12,[549,863,864],{"class":702},"      approximateReceiveCount",[549,866,706],{"class":629},[549,868,806],{"class":633},[549,870,734],{"class":629},[549,872,873],{"class":633},"attributes",[549,875,876],{"class":629},"?.",[549,878,879],{"class":633},"ApproximateReceiveCount",[549,881,858],{"class":629},[549,883,885,888],{"class":551,"line":884},13,[549,886,887],{"class":629},"    }",[549,889,754],{"class":702},[549,891,893],{"class":551,"line":892},14,[549,894,683],{"emptyLinePlaceholder":682},[549,896,898,901],{"class":551,"line":897},15,[549,899,900],{"class":622},"    try",[549,902,791],{"class":629},[549,904,906,909,911,914,916,919,922,924,926,929,931,933,935,938,940,942],{"class":551,"line":905},16,[549,907,908],{"class":633},"      log",[549,910,734],{"class":629},[549,912,913],{"class":689},"set",[549,915,693],{"class":702},[549,917,918],{"class":629},"{",[549,920,921],{"class":702}," queue",[549,923,706],{"class":629},[549,925,630],{"class":629},[549,927,928],{"class":702}," name",[549,930,706],{"class":629},[549,932,806],{"class":633},[549,934,734],{"class":629},[549,936,937],{"class":633},"eventSourceARN",[549,939,637],{"class":629},[549,941,637],{"class":629},[549,943,754],{"class":702},[549,945,947],{"class":551,"line":946},17,[549,948,950],{"class":949},"sHwdD","      \u002F\u002F … parse record.body and process the message\n",[549,952,954,956,958,960,962,964,967,969,971,974,976,978],{"class":551,"line":953},18,[549,955,908],{"class":633},[549,957,734],{"class":629},[549,959,913],{"class":689},[549,961,693],{"class":702},[549,963,918],{"class":629},[549,965,966],{"class":702}," status",[549,968,706],{"class":629},[549,970,643],{"class":629},[549,972,973],{"class":558},"ok",[549,975,721],{"class":629},[549,977,637],{"class":629},[549,979,754],{"class":702},[549,981,983,985,988,990,993,995],{"class":551,"line":982},19,[549,984,887],{"class":629},[549,986,987],{"class":622}," catch",[549,989,800],{"class":702},[549,991,992],{"class":633},"error",[549,994,820],{"class":702},[549,996,696],{"class":629},[549,998,1000,1002,1004,1006,1008,1010,1013,1016,1019,1022,1025,1028,1030,1032,1035,1037,1039],{"class":551,"line":999},20,[549,1001,908],{"class":633},[549,1003,734],{"class":629},[549,1005,992],{"class":689},[549,1007,693],{"class":702},[549,1009,992],{"class":633},[549,1011,1012],{"class":629}," instanceof",[549,1014,1015],{"class":555}," Error",[549,1017,1018],{"class":629}," ?",[549,1020,1021],{"class":633}," error",[549,1023,1024],{"class":629}," :",[549,1026,1027],{"class":629}," new",[549,1029,1015],{"class":689},[549,1031,693],{"class":702},[549,1033,1034],{"class":689},"String",[549,1036,693],{"class":702},[549,1038,992],{"class":633},[549,1040,1041],{"class":702},")))\n",[549,1043,1045,1047,1049,1051,1053,1055,1057,1059,1061,1063,1065,1067],{"class":551,"line":1044},21,[549,1046,908],{"class":633},[549,1048,734],{"class":629},[549,1050,913],{"class":689},[549,1052,693],{"class":702},[549,1054,918],{"class":629},[549,1056,966],{"class":702},[549,1058,706],{"class":629},[549,1060,643],{"class":629},[549,1062,992],{"class":558},[549,1064,721],{"class":629},[549,1066,637],{"class":629},[549,1068,754],{"class":702},[549,1070,1072,1075],{"class":551,"line":1071},22,[549,1073,1074],{"class":622},"      throw",[549,1076,1077],{"class":633}," error\n",[549,1079,1081,1083,1086],{"class":551,"line":1080},23,[549,1082,887],{"class":629},[549,1084,1085],{"class":622}," finally",[549,1087,791],{"class":629},[549,1089,1091,1093,1095,1098],{"class":551,"line":1090},24,[549,1092,908],{"class":633},[549,1094,734],{"class":629},[549,1096,1097],{"class":689},"emit",[549,1099,1100],{"class":702},"()\n",[549,1102,1104],{"class":551,"line":1103},25,[549,1105,1106],{"class":629},"    }\n",[549,1108,1110],{"class":551,"line":1109},26,[549,1111,1112],{"class":629},"  }\n",[549,1114,1116],{"class":551,"line":1115},27,[549,1117,1118],{"class":629},"}\n",[408,1120,1121,1122,503,1125,1127],{},"If you process the whole batch as one logical unit, use a ",[412,1123,1124],{},"single",[422,1126,432],{}," per handler invocation with batch metadata instead of one logger per record.",[479,1129,1131,1132],{"id":1130},"stdout-and-silent","Stdout and ",[422,1133,1134],{},"silent",[408,1136,1137,1138,1141,1142,1145,1146,1149,1150,734],{},"Many teams ingest Lambda logs from ",[412,1139,1140],{},"CloudWatch"," via stdout. If you use a ",[412,1143,1144],{},"drain adapter"," (OTLP, Datadog, Axiom, etc.) and want JSON or platform-specific formatting without duplicate console noise, set ",[422,1147,1148],{},"silent: true"," in production—see ",[417,1151,170],{"href":1152},"\u002Fcore-concepts\u002Fconfiguration#silent-mode",[539,1154,1156],{"className":612,"code":1155,"filename":614,"language":615,"meta":545,"style":545},"import { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { initLogger } from 'evlog'\n\ninitLogger({\n  env: { service: 'sqs-consumer' },\n  silent: process.env.NODE_ENV === 'production',\n  drain: createAxiomDrain(),\n})\n",[422,1157,1158,1178,1196,1200,1208,1229,1258,1272],{"__ignoreMap":545},[549,1159,1160,1162,1164,1167,1169,1171,1173,1176],{"class":551,"line":552},[549,1161,623],{"class":622},[549,1163,630],{"class":629},[549,1165,1166],{"class":633}," createAxiomDrain",[549,1168,637],{"class":629},[549,1170,640],{"class":622},[549,1172,643],{"class":629},[549,1174,1175],{"class":558},"evlog\u002Faxiom",[549,1177,649],{"class":629},[549,1179,1180,1182,1184,1186,1188,1190,1192,1194],{"class":551,"line":652},[549,1181,623],{"class":622},[549,1183,630],{"class":629},[549,1185,659],{"class":633},[549,1187,637],{"class":629},[549,1189,640],{"class":622},[549,1191,643],{"class":629},[549,1193,674],{"class":558},[549,1195,649],{"class":629},[549,1197,1198],{"class":551,"line":679},[549,1199,683],{"emptyLinePlaceholder":682},[549,1201,1202,1204,1206],{"class":551,"line":686},[549,1203,690],{"class":689},[549,1205,693],{"class":633},[549,1207,696],{"class":629},[549,1209,1210,1212,1214,1216,1218,1220,1222,1224,1226],{"class":551,"line":699},[549,1211,703],{"class":702},[549,1213,706],{"class":629},[549,1215,630],{"class":629},[549,1217,711],{"class":702},[549,1219,706],{"class":629},[549,1221,643],{"class":629},[549,1223,718],{"class":558},[549,1225,721],{"class":629},[549,1227,1228],{"class":629}," },\n",[549,1230,1231,1234,1236,1238,1240,1242,1244,1246,1249,1251,1254,1256],{"class":551,"line":748},[549,1232,1233],{"class":702},"  silent",[549,1235,706],{"class":629},[549,1237,731],{"class":633},[549,1239,734],{"class":629},[549,1241,737],{"class":633},[549,1243,734],{"class":629},[549,1245,742],{"class":633},[549,1247,1248],{"class":629},"===",[549,1250,643],{"class":629},[549,1252,1253],{"class":558},"production",[549,1255,721],{"class":629},[549,1257,858],{"class":629},[549,1259,1260,1263,1265,1267,1270],{"class":551,"line":757},[549,1261,1262],{"class":702},"  drain",[549,1264,706],{"class":629},[549,1266,1166],{"class":689},[549,1268,1269],{"class":633},"()",[549,1271,858],{"class":629},[549,1273,1274,1276],{"class":551,"line":762},[549,1275,751],{"class":629},[549,1277,754],{"class":633},[1279,1280,1283,1284,1286,1287,1290],"callout",{"color":1281,"icon":1282},"warning","i-lucide-alert-triangle","If ",[422,1285,1134],{}," is enabled without a ",[422,1288,1289],{},"drain",", events may not be visible anywhere. See the configuration docs for details.",[479,1292,1294],{"id":1293},"error-handling","Error handling",[408,1296,1297,1298,1301,1302,1305,1306,1305,1309,1312],{},"Use ",[422,1299,1300],{},"createError"," where you want structured fields (",[422,1303,1304],{},"why",", ",[422,1307,1308],{},"fix",[422,1310,1311],{},"link","). Map failures to your Lambda return or rethrow so SQS retry\u002FDLQ behavior stays correct—evlog does not replace AWS error semantics.",[539,1314,1316],{"className":612,"code":1315,"filename":614,"language":615,"meta":545,"style":545},"import { createError } from 'evlog'\n\nthrow createError({\n  message: 'Invalid payload',\n  status: 400,\n  why: 'Required field missing',\n  fix: 'Include orderId in the message body',\n})\n",[422,1317,1318,1337,1341,1352,1368,1381,1397,1413],{"__ignoreMap":545},[549,1319,1320,1322,1324,1327,1329,1331,1333,1335],{"class":551,"line":552},[549,1321,623],{"class":622},[549,1323,630],{"class":629},[549,1325,1326],{"class":633}," createError",[549,1328,637],{"class":629},[549,1330,640],{"class":622},[549,1332,643],{"class":629},[549,1334,674],{"class":558},[549,1336,649],{"class":629},[549,1338,1339],{"class":551,"line":652},[549,1340,683],{"emptyLinePlaceholder":682},[549,1342,1343,1346,1348,1350],{"class":551,"line":679},[549,1344,1345],{"class":622},"throw",[549,1347,1326],{"class":689},[549,1349,693],{"class":633},[549,1351,696],{"class":629},[549,1353,1354,1357,1359,1361,1364,1366],{"class":551,"line":686},[549,1355,1356],{"class":702},"  message",[549,1358,706],{"class":629},[549,1360,643],{"class":629},[549,1362,1363],{"class":558},"Invalid payload",[549,1365,721],{"class":629},[549,1367,858],{"class":629},[549,1369,1370,1373,1375,1379],{"class":551,"line":699},[549,1371,1372],{"class":702},"  status",[549,1374,706],{"class":629},[549,1376,1378],{"class":1377},"sbssI"," 400",[549,1380,858],{"class":629},[549,1382,1383,1386,1388,1390,1393,1395],{"class":551,"line":748},[549,1384,1385],{"class":702},"  why",[549,1387,706],{"class":629},[549,1389,643],{"class":629},[549,1391,1392],{"class":558},"Required field missing",[549,1394,721],{"class":629},[549,1396,858],{"class":629},[549,1398,1399,1402,1404,1406,1409,1411],{"class":551,"line":757},[549,1400,1401],{"class":702},"  fix",[549,1403,706],{"class":629},[549,1405,643],{"class":629},[549,1407,1408],{"class":558},"Include orderId in the message body",[549,1410,721],{"class":629},[549,1412,858],{"class":629},[549,1414,1415,1417],{"class":551,"line":762},[549,1416,751],{"class":629},[549,1418,754],{"class":633},[479,1420,1422],{"id":1421},"related","Related",[447,1424,1425,1440,1454],{},[450,1426,1427,1430,1431,1433,1434,1433,1436,1439],{},[417,1428,1429],{"href":272},"Standalone TypeScript",": same ",[422,1432,690],{}," + ",[422,1435,485],{},[422,1437,1438],{},"emit()"," model",[450,1441,1442,1444,1445,1305,1447,800,1450,1453],{},[417,1443,170],{"href":171},": ",[422,1446,1134],{},[422,1448,1449],{},"env.region",[422,1451,1452],{},"AWS_REGION","), drains",[450,1455,1456,1458],{},[417,1457,51],{"href":52},": designing one comprehensive event per unit of work",[1460,1461,1462],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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 .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 .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 .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}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":545,"searchDepth":652,"depth":652,"links":1464},[1465,1467,1471,1473,1474],{"id":481,"depth":652,"text":1466},"Why not one global createLogger?",{"id":529,"depth":652,"text":20,"children":1468},[1469,1470],{"id":533,"depth":679,"text":534},{"id":608,"depth":679,"text":609},{"id":1130,"depth":652,"text":1472},"Stdout and silent",{"id":1293,"depth":652,"text":1294},{"id":1421,"depth":652,"text":1422},"Wide events and structured logging in AWS Lambda functions, including SQS consumers and event-driven handlers.","md",null,{},{"title":280,"icon":283},{"title":280,"description":1475},"kdyf6DH96TMEH_hkaTlFx3WsXZ4U7MKfWKpGPYumr_4",[1483,1485],{"title":275,"path":276,"stem":277,"description":1484,"icon":278,"children":-1},"Wide events and structured errors in Astro server middleware.",{"title":285,"path":286,"stem":287,"description":1486,"icon":288,"children":-1},"Build your own evlog framework integration using the toolkit API — defineFrameworkIntegration, createMiddlewareLogger, AsyncLocalStorage, and the full drain\u002Fenrich\u002Fkeep pipeline.",1778325966277]