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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ