fastapi-nano icon indicating copy to clipboard operation
fastapi-nano copied to clipboard

Add logging- Feature request

Open dojowahi opened this issue 9 months ago • 3 comments

If we add how logging can be incorporated, when API calls are made, using middleware it will cover all facets.

dojowahi avatar Oct 31 '23 14:10 dojowahi

Indeed. I’m curious to see what you have in mind. Would you like to work on that? It’ll need tests too.

rednafi avatar Oct 31 '23 16:10 rednafi

I was thinking of having a logging.conf, and then building off it in different modules. A separate folder for middleware, which automatically gets called before and after and after API call is made. It has some sort of unique ID for each request so you can trace which logs come from the same requests, and also time taken by API

dojowahi avatar Oct 31 '23 19:10 dojowahi

Not a bad idea. I have to see the first pass to make a comment on that.

rednafi avatar Oct 31 '23 20:10 rednafi