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