Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging errors and exceptions on AWS Lambda

I have some AWS Lambda functions that get run about twenty thousand times a day. So I would like to enable logging/alert to monitor all the errors and exceptions.

The cloudwatch log is giving too much noise, and difficult to see the error. Now I'm planning to write the log to AWS S3 Bucket, this will have an impact on the performance.

What's the best way you suggest to log and alert the errors?

like image 473
user1187968 Avatar asked Feb 07 '26 12:02

user1187968


1 Answers

An alternative would be to leave everything as it is (from application perspective) and check AmazonCloudWatch Logs Filter.

You use metric filters to search for and match terms, phrases, or values in your log events. When a metric filter finds one of the terms, phrases, or values in your log events, you can increment the value of a CloudWatch metric.

If you defined your filter you can create a CloudWatch Alarm on the metric and get notified as soon as your defined threshold is reached :-)

Edit

I didnt check the link from @Renato Gama. Sorry. Just follow the instructions behind the link and your problem should be solved easily...

like image 162
MaiKaY Avatar answered Feb 09 '26 06:02

MaiKaY



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!