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

Prevent disabling existing loggers. #902

Closed

Conversation

arthur-a
Copy link

In pasterapp, when we are sending HUP signal to master process gunicorn's existing loggers will be disabled.

@tilgovi
Copy link
Collaborator

tilgovi commented Sep 30, 2014

Why is it a problem if the configuration is read again? Are you configuring additional loggers via code after gunicorn starts up? Why are they not simply configured again by your code in the new worker? Is it a problem related to interacting with --preload?

@arthur-a
Copy link
Author

arthur-a commented Oct 1, 2014

To clarify here is some piece of my development.ini file:

[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 8080
accesslog = -
errorlog = -

[loggers]
keys=root

[handlers]
keys=console

[formatters]
keys=default

[logger_root]
level=INFO
qualname=root
handlers=console

[handler_console]
class=StreamHandler
formatter=default
args=(sys.stdout, )

[formatter_default]
format=[%(asctime)s] [%(levelname)-7s] - %(process)d:%(name)s:%(funcName)s - %(message)s

I just use accesslog and errorlog names to enable their messages in log.

Then I'm running gunicorn --paste development.ini and sending HUP signal, there are no messages in log after the signal.

If I'm using gunicorn --paste development.ini --log-config development.ini messages continue to display in log after the signal.

I mean only accesslog and errorlog messages from gunicorn's loggers.

@tilgovi
Copy link
Collaborator

tilgovi commented Oct 15, 2014

@benoitc we have a timeline for next release? I'll try to prioritize the issues I can make time for.

@tilgovi
Copy link
Collaborator

tilgovi commented Oct 15, 2014

@arthur-a are you using the latest gunicorn? Gunicorn used to require --log-config with paster but now it should use the .ini file automatically. I will try to test your issue with HUP. You can also add sections for gunicorn.error and gunicorn.access to your .ini.

There may be a problem here, and things are too surprising. But the right fix might be somewhere else...

@tilgovi
Copy link
Collaborator

tilgovi commented Oct 15, 2014

I think I believe that it should not be necessary to add gunicorn.access and gunicorn.error loggers to the .ini file. They should propagate by default and go to your root logger. I will check more about this.

@arthur-a
Copy link
Author

Today I'm pulling latest version from master branch and nothing's changed.

@tilgovi
Copy link
Collaborator

tilgovi commented Nov 18, 2014

With and without gunicorn.error as an explicit logger, I cannot reproduce this on master. Please re-open if you are still having trouble and we can try to debug together.

@tilgovi tilgovi closed this Nov 18, 2014
@tilgovi
Copy link
Collaborator

tilgovi commented Nov 19, 2014

I'm actually about to address this in a new PR.

tilgovi added a commit that referenced this pull request Nov 19, 2014
Rather than using fileConfig twice and risking different defaults
and behavior around disable_existing_loggers (ref #902), simply
set the default logging config file to be the paster config file
if it has a logger section and let glogging set up the rest.
@tilgovi
Copy link
Collaborator

tilgovi commented Nov 19, 2014

Okay. See #941 for a new PR.

tilgovi added a commit that referenced this pull request Nov 19, 2014
Rather than using fileConfig twice and risking different defaults
and behavior around disable_existing_loggers (ref #902), simply
set the default logging config file to be the paster config file
if it has a logger section and let glogging set up the rest.
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.

2 participants