-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
dictConfig in logconfig #1087
Comments
Can you confirm what you mean. Having a dictionary somehow in the command line with |
My application reads config from file and part of this config is for logging. I want to pass that part to dictConfig. I'm not using command line arguments for logging config at all. |
Looks like a reasonable request to me. I think we can also deprecate |
+1 . Any PR is welcome :) |
Hello - I'm also interested in this feature. Is the PR above similar to what you had in mind? |
I fail to see how the command line can be used. Can someone provide a proper example? And test? |
@benoitc is a CLI option needed for every setting? It's not something I've addressed in the pull request above - that just works with the python configuration file. If it was a CLI option, how would you use it? The only way I could see it working is if the value is dumped in a json or yaml file and the filename is used as the setting, but that just makes things more complicated if you are already using the python config. |
Maybe the way Circus handles logging configuration could be used as a model? See circus/util.py:configure_logger(). |
@akaihola how is it different from the way we are doing it now? Also we should not forget that the logging backend is pluggable in Gunicorn. |
I found a workaround using At least seems to work with the default worker type. |
I figured out how to do this for dictConfig using a json config file. In your gunicorn config.py file you put the following code.
Then start with This should let you configure your logging using a json file instead of the default INI format. |
Please excuse my ignorance, but I am slightly confused how #1602 enables me to load a dict config via the gunicorn command line:
What am I missing? |
From logging docs:
Could you suppport
dictConfig
inlogconfig
option?The text was updated successfully, but these errors were encountered: