Replies: 5 comments
-
Hi @dsmurrell, there has been some minor improvements to the logging since this issue was created, however the type of functionality you are requesting would need to be investigated and built. How is this handled in Zappa? |
Beta Was this translation helpful? Give feedback.
-
https://github.com/zappa/Zappa#tailing-logs These are some of the use cases they allow. I'm not quite sure how they handle it internally through zappa, only that the logs appear on your console like the following when you tail them. When there is an error you also see that come up in the logs with the full stack trace. What is your current best way of viewing the logs of an API that's put up onto a lambda through Mangum? |
Beta Was this translation helpful? Give feedback.
-
Hi @dsmurrell, so it looks like Zappa provides a fairly extensive CLI to support log tailing which I would not consider including Mangum at this time. However, this does not mean you would not be able to support this yourself with a Mangum deployment. I'd be happy to review any pull requests that aim to improve the logging that exists in Mangum itself, but I do not have the capacity as an individual to re-create what Zappa has been able to do here. |
Beta Was this translation helpful? Give feedback.
-
That makes sense if it's a lot of work, but what is your personal approach to viewing logs of an API that you put into a Lambda using Mangum? |
Beta Was this translation helpful? Give feedback.
-
@dsmurrell I'll convert this to a discussion because others may be able to assist you better. My personal usage of Mangum over the last couple years has been infrequent and mainly for sharing quick prototypes, so the logging implementation has not been a priority of mine. I attempted a CLI solution a few years ago to provide something similar to Zappa as an external project, but ended up abandoning it in favor of using the tooling provided by Serverless Framework. |
Beta Was this translation helpful? Give feedback.
-
Hi there
I followed this tutorial to get FastAPI up into a Lambda function: https://adem.sh/blog/tutorial-fastapi-aws-lambda-serverless
It seems to be working, but when I tail the logs (
sls logs --function app --stage test
), I see my 'hello' INFO log in there, but it's enclosed in a large block of other logging. It looks like the following:What would I need to do to tail nice coloured logs like I'm used to with Flask/Zappa with the option to filter them? Ideally calls to each endpoint would be logged on a single line, my own log statements would be a single lines, and the uncaught exceptions would also be visible. Basically, I'd like to tail the cloud logs so that they look as similar to the local FastAPI logs as possible.
Beta Was this translation helpful? Give feedback.
All reactions