how to log inside of response template?

0

I have a pipeline response template and inside the "After Mapping" section I want to output to cloud watch a parameters value so I can debug what is going on with the resolver. I am basically looking for a vtl version of console.log()

已提问 5 年前1277 查看次数
2 回答
0

I found a sloppy way of doing it via

$util.validate(false, $record.entity )

This will generate an error in graphql, but it can show what the value was of a variable.

已回答 5 年前
0

You can also just stash the value and it will show up in the logs, depending on your settings.

$util.qr($ctx.stash.put("debugthis", $record.entity))

Also note that your log level in AppSync must be set to ALL if you want to see this output.

已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则