You can always log your code's execution and activities using simple log statements. The following statements are supported for logging with Node.js runtime:
- console.log()
- console.error()
- console.warn()
- console.info()
The logs can be viewed using both the AWS Management Console as well as the CLI. Let us quickly explore both these options:
- Using the AWS Management Console: We have already been using Lambda's dashboard to view the function's execution logs, however, the logs are only for the current execution. To view your function's logs from the past, you need to view them using the CloudWatch Logs section.
To do so, search, and select CloudWatch option from the AWS Management Console. Next, select the Logs option to display the ...