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