11

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

Alex Jenkins
  • 111
  • 1
  • 4
  • Anyone looking at this question should take a look at https://stackoverflow.com/a/37383297/364088 and, another answer to the same question which complements that one, https://stackoverflow.com/a/41873785/364088 . It may not resolve every problem of this sort but I suspect a good many. @alexjenkins - did you find a way to fix this issue ? – glaucon Oct 26 '20 at 10:06
  • Change your Lambda function to return a different value and then, assuming you're using the AWS Lambda Console, click Deploy and click Test. Does that new value show up in the results? – jarmod Oct 26 '20 at 20:12

2 Answers2

20

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.

NublicPablo
  • 959
  • 11
  • 21
3

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.

Ew Na
  • 55
  • 7