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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠