[{"data":1,"prerenderedAt":1512},["ShallowReactive",2],{"navigation_docs":3,"-frameworks-aws-lambda":427,"-frameworks-aws-lambda-surround":1507},[4,35,159,201,289,324,411],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Build on top","\u002Fbuild-on-top","5.build-on-top",[294,297,302,307,311,315,320],{"title":41,"path":295,"stem":296,"icon":54},"\u002Fbuild-on-top\u002Foverview","5.build-on-top\u002F0.overview",{"title":298,"path":299,"stem":300,"icon":301},"Stream","\u002Fbuild-on-top\u002Fstream","5.build-on-top\u002F1.stream","i-lucide-radio-tower",{"title":303,"path":304,"stem":305,"icon":306},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F2.fs-reader","i-lucide-folder-search",{"title":156,"path":308,"stem":309,"icon":310},"\u002Fbuild-on-top\u002Fconsumer-recipes","5.build-on-top\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":312,"path":313,"stem":314,"icon":288},"Pipeline extension","\u002Fbuild-on-top\u002Fpipeline-extension","5.build-on-top\u002F4.pipeline-extension",{"title":316,"path":317,"stem":318,"icon":319},"Sinks","\u002Fbuild-on-top\u002Fsinks","5.build-on-top\u002F5.sinks","i-lucide-share-2",{"title":321,"path":322,"stem":323,"icon":288},"Framework integration","\u002Fbuild-on-top\u002Fframework-integration","5.build-on-top\u002F6.framework-integration",{"title":325,"path":326,"stem":327,"children":328,"page":34},"Adapters","\u002Fadapters","6.adapters",[329,332,372,387],{"title":41,"path":330,"stem":331,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":333,"path":334,"stem":335,"children":336,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[337,342,347,352,357,362,367],{"title":338,"path":339,"stem":340,"icon":341},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":343,"path":344,"stem":345,"icon":346},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":348,"path":349,"stem":350,"icon":351},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":353,"path":354,"stem":355,"icon":356},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":358,"path":359,"stem":360,"icon":361},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":363,"path":364,"stem":365,"icon":366},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":368,"path":369,"stem":370,"icon":371},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":373,"path":374,"stem":375,"children":376,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[377,382],{"title":378,"path":379,"stem":380,"icon":381},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":383,"path":384,"stem":385,"icon":386},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":388,"path":389,"stem":390,"children":391,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[392,397,402,406],{"title":393,"path":394,"stem":395,"icon":396},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":398,"path":399,"stem":400,"icon":401},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":403,"path":404,"stem":405,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":407,"path":408,"stem":409,"icon":410},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":412,"path":413,"stem":414,"children":415,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[416,419,423],{"title":41,"path":417,"stem":418,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":420,"path":421,"stem":422,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":424,"path":425,"stem":426,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":428,"title":280,"body":429,"description":1500,"extension":1501,"links":1502,"meta":1503,"navigation":1504,"path":281,"seo":1505,"stem":282,"__hash__":1506},"docs\u002F4.frameworks\u002F16.aws-lambda.md",{"type":430,"value":431,"toc":1488},"minimark",[432,463,503,512,523,538,552,555,560,631,635,1144,1153,1160,1178,1303,1316,1320,1338,1444,1448,1484],[433,434,435,436,440,441,445,446,450,451,454,455,458,459,462],"p",{},"AWS Lambda has ",[437,438,439],"strong",{},"no HTTP middleware lifecycle"," like Nuxt or Express, so evlog behaves like ",[442,443,444],"a",{"href":272},"standalone TypeScript",": call ",[447,448,449],"code",{},"initLogger()"," once, create a logger ",[437,452,453],{},"per invocation"," (or per SQS message) with ",[447,456,457],{},"createLogger()",", then call ",[447,460,461],{},"log.emit()"," when work finishes.",[464,465,468,471,490],"prompt",{":actions":466,"description":467,"icon":283},"[\"copy\",\"cursor\",\"windsurf\"]","Set up evlog in my AWS Lambda function",[433,469,470],{},"Set up evlog in an AWS Lambda function (e.g. SQS consumer).",[472,473,474,478,481,484,487],"ul",{},[475,476,477],"li",{},"Install evlog: pnpm add evlog",[475,479,480],{},"Call initLogger({ env: { service: 'my-fn' } }) once at module load (cold start)",[475,482,483],{},"In the handler, create a new createLogger({ messageId, ... }) per invocation or per message",[475,485,486],{},"Use log.set() to accumulate context; call log.emit() when done",[475,488,489],{},"Avoid a single module-level logger instance reused across invocations (Lambda reuses runtimes)",[433,491,492,493,498,499],{},"Docs: ",[442,494,495],{"href":495,"rel":496},"https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\u002Faws-lambda",[497],"nofollow","\nAdapters: ",[442,500,501],{"href":501,"rel":502},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters",[497],[504,505,507,508,511],"h2",{"id":506},"why-not-one-global-createlogger","Why not one global ",[447,509,510],{},"createLogger","?",[433,513,514,515,518,519,522],{},"Lambda ",[437,516,517],{},"execution environments are reused",": the same process can handle many invocations in sequence. Module-level variables persist, so ",[437,520,521],{},"one shared logger instance"," can leak fields from a previous invocation into the next.",[433,524,525,528,529,531,532,537],{},[437,526,527],{},"Do this:"," ",[447,530,449],{}," once at the top level (configuration only), and ",[437,533,534,536],{},[447,535,457],{}," inside the handler"," (or inside the loop over SQS records) for each unit of work.",[433,539,540,543,544,547,548,551],{},[437,541,542],{},"Dependency injection"," (passing ",[447,545,546],{},"log"," into functions) is optional—it helps tests and clarity—but what matters is ",[437,549,550],{},"one logger per invocation",", not whether you use DI.",[504,553,20],{"id":554},"quick-start",[556,557,559],"h3",{"id":558},"_1-install","1. Install",[561,562,563,588,602,616],"code-group",{},[564,565,571],"pre",{"className":566,"code":567,"filename":568,"language":569,"meta":570,"style":570},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add evlog\n","pnpm","bash","",[447,572,573],{"__ignoreMap":570},[574,575,578,581,585],"span",{"class":576,"line":577},"line",1,[574,579,568],{"class":580},"sBMFI",[574,582,584],{"class":583},"sfazB"," add",[574,586,587],{"class":583}," evlog\n",[564,589,592],{"className":566,"code":590,"filename":591,"language":569,"meta":570,"style":570},"bun add evlog\n","bun",[447,593,594],{"__ignoreMap":570},[574,595,596,598,600],{"class":576,"line":577},[574,597,591],{"class":580},[574,599,584],{"class":583},[574,601,587],{"class":583},[564,603,606],{"className":566,"code":604,"filename":605,"language":569,"meta":570,"style":570},"yarn add evlog\n","yarn",[447,607,608],{"__ignoreMap":570},[574,609,610,612,614],{"class":576,"line":577},[574,611,605],{"class":580},[574,613,584],{"class":583},[574,615,587],{"class":583},[564,617,620],{"className":566,"code":618,"filename":619,"language":569,"meta":570,"style":570},"npm install evlog\n","npm",[447,621,622],{"__ignoreMap":570},[574,623,624,626,629],{"class":576,"line":577},[574,625,619],{"class":580},[574,627,628],{"class":583}," install",[574,630,587],{"class":583},[556,632,634],{"id":633},"_2-initialize-once-log-per-invocation","2. Initialize once, log per invocation",[564,636,641],{"className":637,"code":638,"filename":639,"language":640,"meta":570,"style":570},"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",[447,642,643,675,702,709,722,771,780,785,817,848,866,884,907,915,920,928,969,976,1005,1022,1067,1094,1103,1113,1126,1132,1138],{"__ignoreMap":570},[574,644,645,649,652,656,660,663,666,669,672],{"class":576,"line":577},[574,646,648],{"class":647},"s7zQu","import",[574,650,651],{"class":647}," type",[574,653,655],{"class":654},"sMK4o"," {",[574,657,659],{"class":658},"sTEyZ"," SQSEvent",[574,661,662],{"class":654}," }",[574,664,665],{"class":647}," from",[574,667,668],{"class":654}," '",[574,670,671],{"class":583},"aws-lambda",[574,673,674],{"class":654},"'\n",[574,676,678,680,682,685,688,691,693,695,697,700],{"class":576,"line":677},2,[574,679,648],{"class":647},[574,681,655],{"class":654},[574,683,684],{"class":658}," initLogger",[574,686,687],{"class":654},",",[574,689,690],{"class":658}," createLogger",[574,692,662],{"class":654},[574,694,665],{"class":647},[574,696,668],{"class":654},[574,698,699],{"class":583},"evlog",[574,701,674],{"class":654},[574,703,705],{"class":576,"line":704},3,[574,706,708],{"emptyLinePlaceholder":707},true,"\n",[574,710,712,716,719],{"class":576,"line":711},4,[574,713,715],{"class":714},"s2Zo4","initLogger",[574,717,718],{"class":658},"(",[574,720,721],{"class":654},"{\n",[574,723,725,729,732,734,737,739,741,744,747,749,752,754,757,760,763,765,768],{"class":576,"line":724},5,[574,726,728],{"class":727},"swJcz","  env",[574,730,731],{"class":654},":",[574,733,655],{"class":654},[574,735,736],{"class":727}," service",[574,738,731],{"class":654},[574,740,668],{"class":654},[574,742,743],{"class":583},"sqs-consumer",[574,745,746],{"class":654},"'",[574,748,687],{"class":654},[574,750,751],{"class":727}," environment",[574,753,731],{"class":654},[574,755,756],{"class":658}," process",[574,758,759],{"class":654},".",[574,761,762],{"class":658},"env",[574,764,759],{"class":654},[574,766,767],{"class":658},"NODE_ENV ",[574,769,770],{"class":654},"},\n",[574,772,774,777],{"class":576,"line":773},6,[574,775,776],{"class":654},"}",[574,778,779],{"class":658},")\n",[574,781,783],{"class":576,"line":782},7,[574,784,708],{"emptyLinePlaceholder":707},[574,786,788,791,795,798,801,803,807,809,811,814],{"class":576,"line":787},8,[574,789,790],{"class":647},"export",[574,792,794],{"class":793},"spNyl"," async",[574,796,797],{"class":793}," function",[574,799,800],{"class":714}," handler",[574,802,718],{"class":654},[574,804,806],{"class":805},"sHdIc","event",[574,808,731],{"class":654},[574,810,659],{"class":580},[574,812,813],{"class":654},")",[574,815,816],{"class":654}," {\n",[574,818,820,823,826,829,832,835,838,840,843,846],{"class":576,"line":819},9,[574,821,822],{"class":647},"  for",[574,824,825],{"class":727}," (",[574,827,828],{"class":793},"const",[574,830,831],{"class":658}," record",[574,833,834],{"class":654}," of",[574,836,837],{"class":658}," event",[574,839,759],{"class":654},[574,841,842],{"class":658},"Records",[574,844,845],{"class":727},") ",[574,847,721],{"class":654},[574,849,851,854,857,860,862,864],{"class":576,"line":850},10,[574,852,853],{"class":793},"    const",[574,855,856],{"class":658}," log",[574,858,859],{"class":654}," =",[574,861,690],{"class":714},[574,863,718],{"class":727},[574,865,721],{"class":654},[574,867,869,872,874,876,878,881],{"class":576,"line":868},11,[574,870,871],{"class":727},"      messageId",[574,873,731],{"class":654},[574,875,831],{"class":658},[574,877,759],{"class":654},[574,879,880],{"class":658},"messageId",[574,882,883],{"class":654},",\n",[574,885,887,890,892,894,896,899,902,905],{"class":576,"line":886},12,[574,888,889],{"class":727},"      approximateReceiveCount",[574,891,731],{"class":654},[574,893,831],{"class":658},[574,895,759],{"class":654},[574,897,898],{"class":658},"attributes",[574,900,901],{"class":654},"?.",[574,903,904],{"class":658},"ApproximateReceiveCount",[574,906,883],{"class":654},[574,908,910,913],{"class":576,"line":909},13,[574,911,912],{"class":654},"    }",[574,914,779],{"class":727},[574,916,918],{"class":576,"line":917},14,[574,919,708],{"emptyLinePlaceholder":707},[574,921,923,926],{"class":576,"line":922},15,[574,924,925],{"class":647},"    try",[574,927,816],{"class":654},[574,929,931,934,936,939,941,944,947,949,951,954,956,958,960,963,965,967],{"class":576,"line":930},16,[574,932,933],{"class":658},"      log",[574,935,759],{"class":654},[574,937,938],{"class":714},"set",[574,940,718],{"class":727},[574,942,943],{"class":654},"{",[574,945,946],{"class":727}," queue",[574,948,731],{"class":654},[574,950,655],{"class":654},[574,952,953],{"class":727}," name",[574,955,731],{"class":654},[574,957,831],{"class":658},[574,959,759],{"class":654},[574,961,962],{"class":658},"eventSourceARN",[574,964,662],{"class":654},[574,966,662],{"class":654},[574,968,779],{"class":727},[574,970,972],{"class":576,"line":971},17,[574,973,975],{"class":974},"sHwdD","      \u002F\u002F … parse record.body and process the message\n",[574,977,979,981,983,985,987,989,992,994,996,999,1001,1003],{"class":576,"line":978},18,[574,980,933],{"class":658},[574,982,759],{"class":654},[574,984,938],{"class":714},[574,986,718],{"class":727},[574,988,943],{"class":654},[574,990,991],{"class":727}," status",[574,993,731],{"class":654},[574,995,668],{"class":654},[574,997,998],{"class":583},"ok",[574,1000,746],{"class":654},[574,1002,662],{"class":654},[574,1004,779],{"class":727},[574,1006,1008,1010,1013,1015,1018,1020],{"class":576,"line":1007},19,[574,1009,912],{"class":654},[574,1011,1012],{"class":647}," catch",[574,1014,825],{"class":727},[574,1016,1017],{"class":658},"error",[574,1019,845],{"class":727},[574,1021,721],{"class":654},[574,1023,1025,1027,1029,1031,1033,1035,1038,1041,1044,1047,1050,1053,1055,1057,1060,1062,1064],{"class":576,"line":1024},20,[574,1026,933],{"class":658},[574,1028,759],{"class":654},[574,1030,1017],{"class":714},[574,1032,718],{"class":727},[574,1034,1017],{"class":658},[574,1036,1037],{"class":654}," instanceof",[574,1039,1040],{"class":580}," Error",[574,1042,1043],{"class":654}," ?",[574,1045,1046],{"class":658}," error",[574,1048,1049],{"class":654}," :",[574,1051,1052],{"class":654}," new",[574,1054,1040],{"class":714},[574,1056,718],{"class":727},[574,1058,1059],{"class":714},"String",[574,1061,718],{"class":727},[574,1063,1017],{"class":658},[574,1065,1066],{"class":727},")))\n",[574,1068,1070,1072,1074,1076,1078,1080,1082,1084,1086,1088,1090,1092],{"class":576,"line":1069},21,[574,1071,933],{"class":658},[574,1073,759],{"class":654},[574,1075,938],{"class":714},[574,1077,718],{"class":727},[574,1079,943],{"class":654},[574,1081,991],{"class":727},[574,1083,731],{"class":654},[574,1085,668],{"class":654},[574,1087,1017],{"class":583},[574,1089,746],{"class":654},[574,1091,662],{"class":654},[574,1093,779],{"class":727},[574,1095,1097,1100],{"class":576,"line":1096},22,[574,1098,1099],{"class":647},"      throw",[574,1101,1102],{"class":658}," error\n",[574,1104,1106,1108,1111],{"class":576,"line":1105},23,[574,1107,912],{"class":654},[574,1109,1110],{"class":647}," finally",[574,1112,816],{"class":654},[574,1114,1116,1118,1120,1123],{"class":576,"line":1115},24,[574,1117,933],{"class":658},[574,1119,759],{"class":654},[574,1121,1122],{"class":714},"emit",[574,1124,1125],{"class":727},"()\n",[574,1127,1129],{"class":576,"line":1128},25,[574,1130,1131],{"class":654},"    }\n",[574,1133,1135],{"class":576,"line":1134},26,[574,1136,1137],{"class":654},"  }\n",[574,1139,1141],{"class":576,"line":1140},27,[574,1142,1143],{"class":654},"}\n",[433,1145,1146,1147,528,1150,1152],{},"If you process the whole batch as one logical unit, use a ",[437,1148,1149],{},"single",[447,1151,457],{}," per handler invocation with batch metadata instead of one logger per record.",[504,1154,1156,1157],{"id":1155},"stdout-and-silent","Stdout and ",[447,1158,1159],{},"silent",[433,1161,1162,1163,1166,1167,1170,1171,1174,1175,759],{},"Many teams ingest Lambda logs from ",[437,1164,1165],{},"CloudWatch"," via stdout. If you use a ",[437,1168,1169],{},"drain adapter"," (OTLP, Datadog, Axiom, etc.) and want JSON or platform-specific formatting without duplicate console noise, set ",[447,1172,1173],{},"silent: true"," in production—see ",[442,1176,170],{"href":1177},"\u002Fcore-concepts\u002Fconfiguration#silent-mode",[564,1179,1181],{"className":637,"code":1180,"filename":639,"language":640,"meta":570,"style":570},"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",[447,1182,1183,1203,1221,1225,1233,1254,1283,1297],{"__ignoreMap":570},[574,1184,1185,1187,1189,1192,1194,1196,1198,1201],{"class":576,"line":577},[574,1186,648],{"class":647},[574,1188,655],{"class":654},[574,1190,1191],{"class":658}," createAxiomDrain",[574,1193,662],{"class":654},[574,1195,665],{"class":647},[574,1197,668],{"class":654},[574,1199,1200],{"class":583},"evlog\u002Faxiom",[574,1202,674],{"class":654},[574,1204,1205,1207,1209,1211,1213,1215,1217,1219],{"class":576,"line":677},[574,1206,648],{"class":647},[574,1208,655],{"class":654},[574,1210,684],{"class":658},[574,1212,662],{"class":654},[574,1214,665],{"class":647},[574,1216,668],{"class":654},[574,1218,699],{"class":583},[574,1220,674],{"class":654},[574,1222,1223],{"class":576,"line":704},[574,1224,708],{"emptyLinePlaceholder":707},[574,1226,1227,1229,1231],{"class":576,"line":711},[574,1228,715],{"class":714},[574,1230,718],{"class":658},[574,1232,721],{"class":654},[574,1234,1235,1237,1239,1241,1243,1245,1247,1249,1251],{"class":576,"line":724},[574,1236,728],{"class":727},[574,1238,731],{"class":654},[574,1240,655],{"class":654},[574,1242,736],{"class":727},[574,1244,731],{"class":654},[574,1246,668],{"class":654},[574,1248,743],{"class":583},[574,1250,746],{"class":654},[574,1252,1253],{"class":654}," },\n",[574,1255,1256,1259,1261,1263,1265,1267,1269,1271,1274,1276,1279,1281],{"class":576,"line":773},[574,1257,1258],{"class":727},"  silent",[574,1260,731],{"class":654},[574,1262,756],{"class":658},[574,1264,759],{"class":654},[574,1266,762],{"class":658},[574,1268,759],{"class":654},[574,1270,767],{"class":658},[574,1272,1273],{"class":654},"===",[574,1275,668],{"class":654},[574,1277,1278],{"class":583},"production",[574,1280,746],{"class":654},[574,1282,883],{"class":654},[574,1284,1285,1288,1290,1292,1295],{"class":576,"line":782},[574,1286,1287],{"class":727},"  drain",[574,1289,731],{"class":654},[574,1291,1191],{"class":714},[574,1293,1294],{"class":658},"()",[574,1296,883],{"class":654},[574,1298,1299,1301],{"class":576,"line":787},[574,1300,776],{"class":654},[574,1302,779],{"class":658},[1304,1305,1308,1309,1311,1312,1315],"callout",{"color":1306,"icon":1307},"warning","i-lucide-alert-triangle","If ",[447,1310,1159],{}," is enabled without a ",[447,1313,1314],{},"drain",", events may not be visible anywhere. See the configuration docs for details.",[504,1317,1319],{"id":1318},"error-handling","Error handling",[433,1321,1322,1323,1326,1327,1330,1331,1330,1334,1337],{},"Use ",[447,1324,1325],{},"createError"," where you want structured fields (",[447,1328,1329],{},"why",", ",[447,1332,1333],{},"fix",[447,1335,1336],{},"link","). Map failures to your Lambda return or rethrow so SQS retry\u002FDLQ behavior stays correct—evlog does not replace AWS error semantics.",[564,1339,1341],{"className":637,"code":1340,"filename":639,"language":640,"meta":570,"style":570},"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",[447,1342,1343,1362,1366,1377,1393,1406,1422,1438],{"__ignoreMap":570},[574,1344,1345,1347,1349,1352,1354,1356,1358,1360],{"class":576,"line":577},[574,1346,648],{"class":647},[574,1348,655],{"class":654},[574,1350,1351],{"class":658}," createError",[574,1353,662],{"class":654},[574,1355,665],{"class":647},[574,1357,668],{"class":654},[574,1359,699],{"class":583},[574,1361,674],{"class":654},[574,1363,1364],{"class":576,"line":677},[574,1365,708],{"emptyLinePlaceholder":707},[574,1367,1368,1371,1373,1375],{"class":576,"line":704},[574,1369,1370],{"class":647},"throw",[574,1372,1351],{"class":714},[574,1374,718],{"class":658},[574,1376,721],{"class":654},[574,1378,1379,1382,1384,1386,1389,1391],{"class":576,"line":711},[574,1380,1381],{"class":727},"  message",[574,1383,731],{"class":654},[574,1385,668],{"class":654},[574,1387,1388],{"class":583},"Invalid payload",[574,1390,746],{"class":654},[574,1392,883],{"class":654},[574,1394,1395,1398,1400,1404],{"class":576,"line":724},[574,1396,1397],{"class":727},"  status",[574,1399,731],{"class":654},[574,1401,1403],{"class":1402},"sbssI"," 400",[574,1405,883],{"class":654},[574,1407,1408,1411,1413,1415,1418,1420],{"class":576,"line":773},[574,1409,1410],{"class":727},"  why",[574,1412,731],{"class":654},[574,1414,668],{"class":654},[574,1416,1417],{"class":583},"Required field missing",[574,1419,746],{"class":654},[574,1421,883],{"class":654},[574,1423,1424,1427,1429,1431,1434,1436],{"class":576,"line":782},[574,1425,1426],{"class":727},"  fix",[574,1428,731],{"class":654},[574,1430,668],{"class":654},[574,1432,1433],{"class":583},"Include orderId in the message body",[574,1435,746],{"class":654},[574,1437,883],{"class":654},[574,1439,1440,1442],{"class":576,"line":787},[574,1441,776],{"class":654},[574,1443,779],{"class":658},[504,1445,1447],{"id":1446},"related","Related",[472,1449,1450,1465,1479],{},[475,1451,1452,1455,1456,1458,1459,1458,1461,1464],{},[442,1453,1454],{"href":272},"Standalone TypeScript",": same ",[447,1457,715],{}," + ",[447,1460,510],{},[447,1462,1463],{},"emit()"," model",[475,1466,1467,1469,1470,1330,1472,825,1475,1478],{},[442,1468,170],{"href":171},": ",[447,1471,1159],{},[447,1473,1474],{},"env.region",[447,1476,1477],{},"AWS_REGION","), drains",[475,1480,1481,1483],{},[442,1482,51],{"href":52},": designing one comprehensive event per unit of work",[1485,1486,1487],"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":570,"searchDepth":677,"depth":677,"links":1489},[1490,1492,1496,1498,1499],{"id":506,"depth":677,"text":1491},"Why not one global createLogger?",{"id":554,"depth":677,"text":20,"children":1493},[1494,1495],{"id":558,"depth":704,"text":559},{"id":633,"depth":704,"text":634},{"id":1155,"depth":677,"text":1497},"Stdout and silent",{"id":1318,"depth":677,"text":1319},{"id":1446,"depth":677,"text":1447},"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":1500},"kdyf6DH96TMEH_hkaTlFx3WsXZ4U7MKfWKpGPYumr_4",[1508,1510],{"title":275,"path":276,"stem":277,"description":1509,"icon":278,"children":-1},"Wide events and structured errors in Astro server middleware.",{"title":285,"path":286,"stem":287,"description":1511,"icon":288,"children":-1},"Build your own evlog framework integration using the toolkit API — defineFrameworkIntegration, createMiddlewareLogger, AsyncLocalStorage, and the full drain\u002Fenrich\u002Fkeep pipeline.",1778346804741]