Logging all the requests into a specific file

DL Neil PythonList at DancesWithMice.info
Thu Feb 27 16:24:16 EST 2020


On 28/02/20 9:29 AM, valon.januzaj98 at gmail.com wrote:
> I am new to python and all of this, I am  using this FastAPI, to build API,
> I want when users hit any endpoint for ex /products, that to be written into a file , how do I do it?

The Python Standard Library offers a Logging library.
It has "handlers" to decide where each message to go, "filters" to 
determine 'levels' of messages, and "formatters" to organise the output.

-- 
Regards =dn


More information about the Python-list mailing list