- Newest
- Most votes
- Most comments
logger.Debug probably won't appear in CloudWatch but print statements will appear. Regardless, when lambda is invoked, the invocation statement will appear in CloudWatch. If you don't see a log group, make sure you are checking for log groups in the correct region and that you have permissions to create it. Also, under Monitor section in Lambda, it should have a link to CloudWatch.
"Even when running the default 'Test' on a new Lambda with AWSLambdaBasicExecutionRole, the log group does not get created in any region. Clicking 'View logs in CloudWatch' from Lambda's Monitor tab confirms log group missing, with error: Log group does not exist. Role permissions look correct; this occurs even for a basic hello-world Python function. What account, free tier, or root policy could block log group creation?"
answered a year ago
sorry I meant that as a comment to the previous answer...
There are several potential reasons why your Lambda function logs aren't appearing in CloudWatch Logs:
-
CloudWatch Logs Quota Limits: Your AWS account may have reached CloudWatch Logs quota limits, causing CloudWatch to throttle function logging. When this happens, some logs may not appear in CloudWatch Logs.
-
Log Rate Exceeding Processing Capacity: If your function outputs logs at too high a rate for Lambda to process them (exceeding 2 MB/s for a single log stream), Lambda may drop logs to prevent slowing down your function's execution.
-
Permissions Issues: While you've attached the AWSLambdaBasicExecutionRole, which should provide the necessary permissions (logs:CreateLogGroup, logs:CreateLogStream, and logs:PutLogEvents), there might be an issue with how the role is attached or configured.
-
Log Format Configuration: For Python functions, note that using Python
printstatements will only send logs to CloudWatch in plain text format. Your code is using the logging module correctly, which should work. -
Delayed Log Appearance: There can be a delay of 5-10 minutes before logs appear in CloudWatch Logs. Have you waited long enough after function execution?
-
Log Level Configuration: Check if you have any log level filtering configured on your Lambda function. The ApplicationLogLevel setting can filter logs based on their severity level.
To troubleshoot:
- Verify that the execution role is correctly attached to your Lambda function
- Try using both print statements and logger calls to see if either appears
- Wait at least 10 minutes after function execution to check for logs
- Check if you're hitting any CloudWatch Logs service quotas
- Try creating a new function with a different name in case there's an issue with the specific log group
If none of these solutions work, you might need to contact AWS Support as there could be an account-specific issue.
Sources
Troubleshoot execution issues in Lambda - AWS Lambda
Configuring CloudWatch log groups - AWS Lambda
Log and monitor Python Lambda functions - AWS Lambda
Sending Lambda function logs to CloudWatch Logs - AWS Lambda
LoggingConfig - AWS Lambda
Relevant content
asked 3 years ago
asked 2 years ago
asked 2 years ago
- AWS OFFICIALUpdated 4 years ago

"Even when running the default 'Test' on a new Lambda with AWSLambdaBasicExecutionRole, the log group does not get created in any region. Clicking 'View logs in CloudWatch' from Lambda's Monitor tab confirms log group missing, with error: Log group does not exist. Role permissions look correct; this occurs even for a basic hello-world Python function. What account, free tier, or root policy could block log group creation?"