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