Pylons / waitress

Waitress - A WSGI server for Python 3
https://docs.pylonsproject.org/projects/waitress/en/latest/
Other
1.44k stars 164 forks source link

Enable an option to disable the root logging config #297

Closed 1zg12 closed 4 years ago

1zg12 commented 4 years ago

Issue

Fixes: #298

Background

At the moment, waitress would always set up the root logger with logging.basicConfig().

There are two major kinds of issue could be generated:

Unnecessary waitress noise

wairtess could print out a lot of messages, which for most of the cases, it's not really necessary for the application.

Interference with application logging

As it has configured the root logger, which would generate additional unintended log output.

Changes

This will give users an option to disable the root logger logging configure, and leave the _quiet as it is, so that certain information could still be printed out.

image

Ref

https://github.com/Pylons/waitress/issues/151 https://github.com/Pylons/waitress/issues/235

Note

There is another workaround to turn off the logging of waitress completely by using the _quiet parameter, ref: https://github.com/Pylons/waitress/issues/133#issuecomment-629992140

However, since it's said as test shim, I am proposing to add a new parameter here. Thanks.

mmerickel commented 4 years ago

Thank you but for reasons I put into https://github.com/Pylons/waitress/issues/298#issuecomment-630240957, this PR just doesn't serve a purpose if you configure logging the way you want it in your application.

Any application interfacing with libraries that use the stdlib logging module should always configure logging in some way - either via basicConfig, dictConfig, fileConfig, or even some more imperative form. If done properly, the basicConfig invoked by waitress is already a no-op.