Jenn@amazon avatar image
Jenn@amazon posted

Print/Log Alexa Request JSON to CloudWatch Logs

Alexa will send back error information to Skills. To see the details, print out the Event JSON by adding:

console.log("===EVENT=== \n"+ JSON.stringify(event));

to the exports.handler function:

exports.handler = function(event, context, callback) {
    console.log("===EVENT=== \n" + JSON.stringify(event));
    var alexa = Alexa.handler(event, context);
    alexa.APP_ID = APP_ID;

In CloudWatch, you'll see:

Expand out the entry and you'll see the Request JSON sent from Alexa:

alexa skills kittroubleshooting
event-json-cw.png (92.1 KiB)
event-json.png (175.1 KiB)
10 |5000

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



jennjin contributed to this article