2
votes

I notice that when I log something in a Lambda function, the outputted lines in my Cloudwatch log streams include "undefined."

For example, if I call console.log("something");, it appears in Cloudwatch as:

2017-03-07T12:16:37.646Z undefined something

Is there a way to prevent having all these pesky 'undefined's in my logs?

I've RTFD'd in case there was some other parameter I should be including, but sample code logs the same way, and a Google/AWS Forums search didn't help. Thanks.

1

1 Answers

2
votes

Seeing that means that you are calling console.log() outside of your handler and before your handler is invoked.