rednafi / fastapi-nano

🐍 Simple FastAPI template that mimics Flask's blueprint directory structure
MIT License
897 stars 97 forks source link

Add logging- Feature request #278

Closed dojowahi closed 1 month ago

dojowahi commented 1 year ago

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

rednafi commented 1 year ago

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

dojowahi commented 1 year ago

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

rednafi commented 1 year ago

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

priamai commented 1 month ago

+1 on this is amazing!

rednafi commented 1 month ago

A basic logged added.

https://github.com/rednafi/fastapi-nano/pull/316