Python Forum
running Flask with waitress having web traffic log...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
running Flask with waitress having web traffic log...
#1
Question 
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 ?
Reply
#2
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
Reply
#3
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 ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [Solved] Running Gunicorn with flask.... SpongeB0B 1 1,588 Jun-27-2022, 03:09 PM
Last Post: SpongeB0B
  Flask Ubuntu Server Not Running Wheel 0 1,978 Jul-14-2020, 08:12 PM
Last Post: Wheel
  Running Flask web on other IP than 127.0.0.1 popolon59 1 2,095 Mar-29-2020, 10:02 AM
Last Post: Larz60+
  Flask not running python interpreter from virtual env Charles1 1 2,231 Nov-22-2019, 05:09 PM
Last Post: Larz60+
  Running simple flask - getting 404 beginner1 2 5,270 Oct-28-2019, 02:10 PM
Last Post: beginner1
  Running flask run produces error. Charles1 1 4,028 Oct-04-2019, 10:38 PM
Last Post: snippsat
  Restarting Waitress? Wittermore 3 3,826 Jul-13-2019, 10:30 AM
Last Post: noisefloor

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020