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