-
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
Unable to configure root logger #2250
Comments
Can you provide the full traceback and error message you're getting? |
Unfortunately, this is already a full traceback. Just |
I had the same problem; this seems to be new with
to the I read the Python docs on the logging config dict as saying that this |
6da84c6 might be related. I can see that the change has also been backported to 19.10. It seems to me that we need to document this in the changelog. |
Alas, this doesn't work either |
I experienced this issue today when I upgraded from v19.9.0 to v20.0.4. I think it's related to the way the default and the user log configuration dictionaries are merged (see below), which may sometimes result in an invalid configuration. Lines 229 to 231 in 5d0c778
Let me explain this in detail. First, here's my logging configuration, which fails with logconfig_dict = {
'version': 1,
'formatters': {
'web_standard': {
'format': '%(asctime)s %(name)s[%(process)d]: [%(levelname)s] %(message)s',
'datefmt': None,
'style': '%',
},
},
'handlers': {
'web_console': {
'class': 'logging.StreamHandler',
'level': 'DEBUG',
'formatter': 'web_standard',
},
},
'loggers': {
'gunicorn': {
'level': 'WARNING',
'propagate': False,
'handlers': ['web_console'],
},
},
'incremental': False,
'disable_existing_loggers': False,
} We also know that Lines 48 to 52 in 5d0c778
If we add that to my configuration it will result in an invalid configuration because there's no handler named For my configuration, adding a handler named Alternatively, explicitly configuring the logconfig_dict['root'] = {
'level': 'WARNING',
'handlers': ['web_console'],
} |
If anyone would like to contribute a PR to add some documentation language around this, please tag me and I'll review! There's an |
it helped me |
the main reason that file basef loggin handled failed is that they can't be reused, so if y setup it on a root level, u cant reuse the same file in another handler as well as the same handler in another than root logger |
Hi, everyone!
I have a problem with root logger:
Error: Unable to configure root logger
.Run command:
gunicorn project:create_app -c gunicorn.config.py
,create_app
is a coroutine that is returned the instance ofaiohttp.web.Application
(aiohttp v3.6.2
).Gunicorn config file (
gunicorn.config.py
):My
project/log.py
file:This problem appears on versions
19.10
and20.*
(by pip), on different workers. On version19.8
, everything works well.I tried to configure logs in different ways, change workers, aiohttp versions, but all in vain. I think the problem is in
logconfig_dict
.Python
3.6
,3.7
,3.8
.Please help solve the problem. Thank you in advance!
PS: I apologize for my English.
The text was updated successfully, but these errors were encountered: