I have an AWS Lambda Function which takes a ZipCode and finds locations within a radius. Each location returned is processed further by running it through a series of business processes. My test data is comprised of 24 locations being returned for each request. Each request has a guid that represents the request I'm peppering my code with console.log statements so I can follow what's happening via CloudWatch logs.
Whenever I run the lambda function, the CloudWatch log Ends before the process finishes. I subsequently make another request to Lambda with a different Guid and I see entries in CLoudWatch log for the previous request.
How come CloudWatch is not staying active and capturing log entries throughout the entire process? - I'm assuming that Lambda function ends as soon as "End" shows up in CloudWatch Log.
How come log entries from a previous request are showing up muddled in with a subsequent request?
UPDATE
The data construct containing the 24 locations comes from an async method. Each of the 24 locations is a Task. Because async is a promise of future results, is it possible the lambda function is closing down before the async is satisfied? This could explain why only a handful of the 24 locations are outputted in CLoudWatch log before the "End" is registered. There's no consistency as to how many of the 24 are processed/logged before the "End" event happens. The subsequent call seems to pick up the balance from the original call.