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

Option to instruct aiohttp-wsgi to not touch logging #21

Open
NicolasLM opened this issue Feb 2, 2018 · 3 comments
Open

Option to instruct aiohttp-wsgi to not touch logging #21

NicolasLM opened this issue Feb 2, 2018 · 3 comments

Comments

@NicolasLM
Copy link

aiohttp-wsgi shouldn't touch the logging configuration or at least provide an option to instruct it not to.

Here is a real life scenario where the setup done by aiohttp-wsgi is problematic: a Django user has a custom configuration for the aiohttp logger:

# in Django settings.py
LOGGING = {
    "loggers": {
        "aiohttp": {
             "level": "ERROR"
         }
    }
}

What happens is:

  • the interpreter logging is configured first by Django (when the WSGI app is imported)
  • aiohttp-wsgi logging.basicConfig does nothing because logging is already configured
  • the aiohttp logger level gets overridden by the level ofaiohttp-wsgi

It may not sound too bad, but it's tiresome when a user has to track down all third-party libraries doing such things, thus I recommend libraries authors to avoid touching logging and let the user configure this the way he wants in a central place.

@etianen
Copy link
Owner

etianen commented Feb 5, 2018 via email

@NicolasLM
Copy link
Author

As the new aiohttp_wsgi.serve does not configure logging, I believe this issue can be closed.

@etianen
Copy link
Owner

etianen commented Mar 16, 2018

It might still be nice to have it as an option to the CLI, I think.

I just ran out of time to implement it today!

@etianen etianen reopened this Mar 16, 2018
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

No branches or pull requests

2 participants