Forum How do I...?

Generate Debug logs for a Prince AWS lambda & API gateway deployment

upendra
We have deployed Prince on AWS lambda and PI gateway following the instructions on
https://medium.com/@bruce_39084/setting-up-prince-on-aws-lambda-and-api-gateway-4d524dcb035b

We are able to see error logs in the AWS cloud watch logs. However we are unable to view DEBUG or INFO logs from prince on the cloudwatch logs.

Is there documentation on how we can get the debug logs for prince to be printed on the AWS cloudwatch log groups?
pjrm
I'm not the right person to answer this, but I'd suggest adding "--debug" to the “array of Prince’s command line options” as that article describes for how to add options.
upendra
Have added those options to the index.js as below:

let child = execFile("./prince", ["-", "-o", "-", "--debug", "-v"], opts, function(err, stdout, stderr) {

Still unable to see debug/info logs in cloud watch logs for the lambda.
alfie
Turning on "--debug" will output messages to stderr, however looking at the code from the link above, it doesn't seem to output stderr anywhere.

Can you try adding the following after the "execFile()" call and let me know if it worked?

console.log(stderr.toString());
upendra
That worked nicely. The log now has the prince debug messages.

Thanks for the prompt response.
alfie
Great, I'm glad that worked for you.