Skip to content
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

Propagate log config to backend #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pomarec
Copy link

@pomarec pomarec commented Nov 18, 2013

I am not totally sure this is the right approach but I can't find another way to change the log level of the backend.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling ddd00ac on pomarec:propagate-log-config into 7f72672 on mozilla-services:master.

@tarekziade
Copy link
Member

can you look if 5497479 fixes the issue for you ?

@pomarec
Copy link
Author

pomarec commented Nov 29, 2013

It actually did not. But it probably solves it for backends concerned by the PR (gevent, fastgevent and geventwebsocket).

This is how to tested it :

Install chaussette#master and waitress#pomarec/feature.shutdown-gracefuly (this branch just stop the server when sending sighup to it and logs two info msgs)

pip install -e git://github.com/mozilla-services/chaussette.git@master#egg=chaussette
pip install -e git://github.com/pomarec/waitress.git@feature.shutdown-gracefuly#egg=waitress

run chaussette :
chaussette --log-level DEBUG --backend waitress
send a sighup to chaussette
kill -s -sighup <chaussette_pid>

Outputs :

2013-11-29 15:49:47 [15419] [INFO] Application is <function hello_app at 0x101aac050>
2013-11-29 15:49:47 [15419] [INFO] Serving on localhost:8080
2013-11-29 15:49:47 [15419] [INFO] Using <class 'chaussette.backend._waitress.Server'> as a backend

But it should ouputs this : (as it does with chaussette#pomarec/propagate-log-config)

2013-11-29 15:50:29 [15460] [INFO] Application is <function hello_app at 0x1054b8050>
2013-11-29 15:50:29 [15460] [INFO] Serving on localhost:8080
2013-11-29 15:50:29 [15460] [INFO] Using <class 'chaussette.backend._waitress.Server'> as a backend
2013-11-29 15:50:34 [15460] [INFO] Gracefully shutting down...
2013-11-29 15:50:34 [15460] [INFO] Shutdown

Note : to install chaussette#pomarec/propagate-log-config :
pip install -e git://github.com/pomarec/chaussette.git@propagate-log-config#egg=chaussette

@douardda
Copy link

I've tried the proposed scenario on a merge from current head with your branch, and it does not behaves as it should (I still do no have a "Gracefully shutting down..." log message).

Reading the code, I'm not sure I understand how it works.

Should'nt we provide an API for backend to handle the configuration of the logger for each backend?

David

@pomarec
Copy link
Author

pomarec commented Jul 22, 2015

I'm sorry I don't have time to dig this those days. I'll probably come back to this later but can't commit.
It is possible that I mismerged my branches during my test. Sorry If I wasted your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants