LogGroupEventSource
Source:
src/AWS/Lambda/LogGroupEventSource.ts
Lambda runtime implementation for AWS.Logs.consumeLogEvents(...).
This layer does two things:
- At deploy time it creates the backing
AWS.Logs.SubscriptionFiltertargeting the current Lambda function plus thelambda:InvokeFunctionpermission forlogs.amazonaws.com. - At runtime it decodes the gzipped/base64
awslogs.datapayload of incoming invocations and forwards each log event into the supplied handler as a typedLogEventRecordstream.
Consuming Log Events
Section titled “Consuming Log Events”yield* AWS.Logs.consumeLogEvents( logGroup, { filterPattern: "?ERROR ?Error" }, (events) => Stream.runForEach(events, (event) => Effect.log(`${event.logStream}: ${event.message}`), ),);