I need log http-requests to a file in a Waitress server running a Flask application. I wanted to separate the Flask app from the server so I created a file
myapp_waitress.py
from myflaskapp import app
from waitress import serve
from paste.translogger import TransLogger
import logging.config
import os
BASE_DIR = os.getcwd()
log_ini_file = os.path.join(BASE_DIR, "mylog.ini")
logging.config.fileConfig(log_ini_file)
logger = logging.getLogger('waitress')
serve(TransLogger(app, setup_console_handler=False))
and run the Waitress server like
python myapp_waitress.py
What should I to put in mylog.ini file to make Waitress to log requests to a file? I've read https://docs.pylonsproject.org/projects/waitress/en/stable/logging.html several times but as a new pythonist can't make much sense of it. What I'd like to have is a simple example of file logging from Waitress.