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