-
Notifications
You must be signed in to change notification settings - Fork 49
Question: How do I log from a Lambda #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting in, could you try flushing stdout after your prints? like so: import System.IO (hFlush, stdout, stderr)
-- your code...
hFlush stdout
hFlush stderr This needs to be done inside of a |
When I flush stdout and stderr, the output goes into CloudWatch logs. Thanks! Do you think there is something that can be done in the runtime to make output go into logs automatically without having to explicitly flush the handles? |
Definitely. I'll take a look. |
Thanks! |
Thanks for accepting the fix! |
Version 2.0.2 with the fix from #53 has been pushed to Hackage now. Closing. Feel free to reopen if something weird appears. Thanks again! 🙏 |
How can I output logs from my handler?
I have been able to create a Lambda using the runtime, and I can return responses that indicate that my handler is being called correctly.
In order to make it easier to develop and debug, I would like to be able to output logs into the CloudWatch logs for the Lambda. If I just do a
putStrLn
the output is not logged into the CloudWatch log group for the Lambda.The text was updated successfully, but these errors were encountered: