-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to discard logging? #151
Comments
You need to setup the logging yourself via As far as why your loggers are receiving duplicated messages you'd need to paste more of your actual logging configuration. The symptom of duplicate log messages is almost always because you have multiple handlers handling the same messages. You need to figure out what you have done to get 2 handlers (normally you'd just want one per output device). |
@mmerickel I do not use
|
@wsw70 you are setting a handler on your loggers are a tree structure and are not independent |
@mmerickel Thank you. With your comments I managed to make a configuration which outputs only what I need - |
Related to #235 - Repeatedly getting this warning 'WARNING:waitress.queue:Task queue depth is 1' |
@evandrocoan https://stackoverflow.com/a/55861495/2214933 or follow the advice in #235 |
I was facing the same issue with a lot of You can turn the waitress logging off completely, by passing in the
|
That If you don't want Python logging it is a better idea to setup the Python loggers yourself, in which case the call to |
Setting the root logger may collect other unwanted logs. For example, if I use My solution is to assign a null handler for the root logger: logging.getLogger().addHandler(logging.NullHandler()) |
I feel that when waitress starts, the root logger will be added by default, which will allow the logger we created ourselves to inherit its handler. We can turn off the propagate property of creating loggers ourselves.
The method in the previous comment |
Per the docs
I tried to discard the loggging from
waitress
by issuing alogging.getLogger('waitress').setLevel(logging.ERROR)
beforeserve
(which is the last call in my script).This not stop the logging and, worse, duplicates the log messages from my other loggers (which are named loggers, e.g.
log = logging.getLogger('myscriptname')
, the lines with the pipe delimiter in the example below):How can i actually discard logging from
waitress
and especially not having it interacting with my other loggers?The text was updated successfully, but these errors were encountered: