Making waitress log requests

1,325 views
Skip to first unread message

Ram Rachum

unread,
Aug 10, 2014, 4:52:35 PM8/10/14
to pylons...@googlegroups.com
Hi,

I have a question. I'm using waitress on my development machine (instead of Django runserver). What I miss from runserver is having log entries in the console for every request made. How can I have that with waitress?


Thanks,
Ram.

Karl O. Pinc

unread,
Aug 10, 2014, 10:16:18 PM8/10/14
to pylons...@googlegroups.com
Hi,
Use Paste's Translogger.


from mypackage import wsgiapp
from waitress import serve
from paste.translogger import TransLogger
serve(TransLogger(wsgiapp, setup_console_handler=False))

(If you are configuring logging, remove the setup_console_handler,
which defaults to True.)

I am, at this very moment, finalizing a patch to the waitress docs
for submission as a pull request.

Meanwhile, you can see how it's done with pyramid here:

http://docs.pylonsproject.org/projects/pyramid/en/master/narr/logging.html#request-logging-with-paste-s-translogger

(I'll let you find the url for the Paste docs. Sorry.)

Regards,


Karl <k...@meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

Ram Rachum

unread,
Aug 11, 2014, 7:39:37 PM8/11/14
to pylons...@googlegroups.com
Thanks Karl!
Reply all
Reply to author
Forward
0 new messages