question

JDCimino avatar image
JDCimino asked

How do I connect CloudWatch to an Alexa hosted skill?

I am unable to log my errors to CloudWatch. Is there a tutorial on how to connect my Alexa-hosted skill to CloudWatch?

hosted skill
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-e397ab1d-ab75-427d-99d5-a68d01d78d40 avatar image
newuser-e397ab1d-ab75-427d-99d5-a68d01d78d40 answered

if you are writing python code use root.info method from library logging


import logging

root = logging.getLogger()

if root.handlers:

for handler in root.handlers:

root.removeHandler(handler)

logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)

root.setLevel(logging.INFO)


put this code on start and use roo.info("this will be printed").


Also give cloudwatchlogfullaccess for the role


10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Amazon_Bernardo Bezerra avatar image
Amazon_Bernardo Bezerra answered

Hello and thanks for your message.

In order to see the logs for your Alexa Hosted Skill, you need to click on the link at the bottom left side of the Code tab in the Developer Console:

Regards,
Barry


1564152300625.png (205.9 KiB)
7 comments
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi,

I am trying the same way. But it is not happening for me. I made the skill via Alexa Inhosted process.

Could you please help.

The specific log group: /aws/lambda/9d2ce4a4-b221-4c49-970d-8c76a1008fd0 does not exist in this account or region.

1 Like 1 ·
1594986506601.png (143.8 KiB)
Amazon_Bernardo Bezerra avatar image Amazon_Bernardo Bezerra ♦♦ newuser-1c3e78e3-e325-45fe-9958-aee9456585eb ·

Hello and thank you for your message.

Can you please provide your skill ID so I can look further into this?

Regards,
Barry

0 Likes 0 ·

Exactly the same happens to me. I cannot find the logs. The skill ID is 70ceb981-1b22-409b-8d26-b1630cc33f05

0 Likes 0 ·
Show more comments
Show more comments
newuser-37770487-2e06-44d6-addc-2299101699be avatar image newuser-37770487-2e06-44d6-addc-2299101699be newuser-1c3e78e3-e325-45fe-9958-aee9456585eb ·

I have the same problem because I deleted the file.... :-(

I'm stupid, very stupid. I only wanted space was liberated and I missed this functionality.

0 Likes 0 ·