Logging Incoming Events
Explore the use of sam logs --tail to continuously monitor AWS Lambda function logs. Learn to log incoming event data to understand different event formats from AWS services, aiding in troubleshooting and development.
We'll cover the following...
We'll cover the following...
An amazingly useful option of sam logs is --tail. It will continuously check for updates and show new log outputs as they appear. Remember that CloudWatch isn’t pulling information from a single source, so the tail operation isn’t synchronous, but it is generally quick enough for troubleshooting.
Run the sam logs command in tail mode and keep it open. Then, you’ll add some more logging to the function so you can see the outputs.