aws-samples / aws-serverless-connect-wallboard

Sample code for building a serverless wallboard for Amazon Connect.
MIT No Attribution
29 stars 16 forks source link

How can I check the Lambda logs? #3

Closed TimPaisley closed 3 years ago

TimPaisley commented 3 years ago

Hi there, I'm hoping it's okay to ask this here.

I'm working on extending the code to include an agent's contact status, but I don't think it's working and I'd like to check the Lambda logs to figure out why (specifically Connect-Wallboard-Agent-Events). I've checked in CloudWatch but it doesn't seem like the Logger.debug() or similar calls are being output there.

Should I be using print()s instead? Is there something additional I need to set up before I can see the logs?

Much appreciated!

Brettles commented 3 years ago

You can definitely use Logger.debug() but you'll need to set the logging level to DEBUG by changing Logger.setLevel(logging.INFO) to Logger.setLevel(logging.DEBUG).

Otherwise, print() just works fine. It definitely shows up in CloudWatch Logs. If not, check the Lambda role and make sure it has permission to write to CloudWatch.

TimPaisley commented 3 years ago

Logger.setLevel(logging.DEBUG) did the job! Thanks so much!