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