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