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