Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Debugging a Lambda function using CloudWatch Logs logs

Focus mode
Debugging a Lambda function using CloudWatch Logs logs - Amazon Lex

Amazon CloudWatch Logs is a tool for tracking API calls and metrics that you can use to help debug your Lambda functions. When you test your bot in the console or with API calls, CloudWatch logs each step of the conversation. If you use a print function in your Lambda code, CloudWatch displays it as well.

To view CloudWatch logs for your Lambda function
  1. Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Under the Logs menu in the left side bar, select Log groups.

  3. Select your Lambda function log group, which should be of the format /aws/lambda/function-name.

  4. The list of Log streams contains a log for each session with a bot. Choose a log stream to view it.

  5. In the list of Log events, select the right arrow next to the Timestamp to expand the details for that event. Anything you print from your Lambda code will appear as a log event. Use this information to debug your code.

  6. After you debug your code, remember to Deploy the Lambda function and, if you are using the console, to reload the Test window before re-testing the bot's behavior.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.