Python Forum

Full Version: running Flask with waitress having web traffic log...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

Following my previous thread: Flask-Self-hosted-deployment-which-server

I will use Waitress as I'm running this under Windows :/

I would like to have the web traffic logged.
but according to Waitress documentation
Waitress doc Wrote:Waitress logs error conditions, debugging output, etc., but not web traffic. For web traffic logging, Paste provides TransLogger middleware.

So actually I have to use PasteDeploy to lunch waitress and have a config.ini file with the setup...

Not that simple...

Does somebody know how to use this ?

Or do you know an alternative to waitress that provide web traffic log and can run on Windows ?
I found some guidance

https://stackoverflow.com/questions/5237...ress-serve
https://docs.pylonsproject.org/projects/...astedeploy

But in the .ini , file I don't know what to put in line 2 ->
[app:wsgiapp]
use = egg:mypackage#wsgiapp
Thanks
I'm advancing.

Instead of launch my app trough an .ini file, according to the Waitress doc I can do ->

from waitress import serve
from paste.translogger import TransLogger
if __name__ == "__main__":
	serve(TransLogger(app, setup_console_handler=False))
But I get:
Output:
ModuleNotFoundError: No module named 'paste.translogger'
Any idea who to fix that ?
for anyone who's concerned, after installing paste pip install Paste, then
waitress.serve(TransLogger(app))
works like a charm.