Alex Jenkins
Alex Jenkins

Reputation: 121

aws lambda not logging print statements

I have a lambda_handler function like:

def lambda_handler(event, context):
   print('test')

I can see the log output is passing to CloudWatch just fine. I can see the Start, End, Syntax errors, etc. so I don't think it's a permissions thing, but I cannot see my print statements anywhere. I have the following allowed in my IAM role:

Allow: logs:CreateLogGroup

Allow: logs:CreateLogStream

Allow: logs:PutLogEvents

Upvotes: 12

Views: 12208

Answers (2)

Ew Na
Ew Na

Reputation: 65

Hey i just faced exactly the same problem. I added several print statements to some very long dicts and afterwards i was not able to display additional print statements (The old print statements were still displayed). I deleted some of the print statements with higher data volume and now it just works fine. SO i guess it is a kind of storage problem.

Upvotes: 4

NublicPablo
NublicPablo

Reputation: 1039

I was facing the same problem. For me the missing step was to hit the "deploy" button.

As silly as it sounds, it might save some time to a future reader.

Upvotes: 27

Related Questions