There are several ways to write logs from Python Lambda function to AWS CloudWatch: 1️⃣ print(”Yay, done!”) Print statements are logged to CLoudWatch only when invoked in AWS console. This method is valid only for development or debugging. In case you want your production workload to log all print statement, you need to redirect standard output to the standard error stream by using sys.stdout = sys.stderr in the application code.
Share this post
🐾How to write logs from Python Lambda…
Share this post
There are several ways to write logs from Python Lambda function to AWS CloudWatch: 1️⃣ print(”Yay, done!”) Print statements are logged to CLoudWatch only when invoked in AWS console. This method is valid only for development or debugging. In case you want your production workload to log all print statement, you need to redirect standard output to the standard error stream by using sys.stdout = sys.stderr in the application code.