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