Skip to content

LogGroupEventSource

Source: src/AWS/Lambda/LogGroupEventSource.ts

Lambda runtime implementation for AWS.Logs.consumeLogEvents(...).

This layer does two things:

  1. At deploy time it creates the backing AWS.Logs.SubscriptionFilter targeting the current Lambda function plus the lambda:InvokeFunction permission for logs.amazonaws.com.
  2. At runtime it decodes the gzipped/base64 awslogs.data payload of incoming invocations and forwards each log event into the supplied handler as a typed LogEventRecord stream.
yield* AWS.Logs.consumeLogEvents(
logGroup,
{ filterPattern: "?ERROR ?Error" },
(events) =>
Stream.runForEach(events, (event) =>
Effect.log(`${event.logStream}: ${event.message}`),
),
);