Streamline the logging configuration
With !1490 (merged), some logs were added for each failed permission check. Those debugging logs are visible in production and adding a custom configuration to only enable them in dev causes them to be duplicated in dev and still visible in production.
It seems the logging.basicConfig
call made in manage.py gunicorn
is causing this particular issue, and this shows a more general issue in the way logging is currently handled in the backend: we just override the Django settings in management commands when it is just not necessary. This causes some loggers to also be missing from the Django configuration since we just don't always notice it.
The best way to handle this might be to first remove our current configuration (except for the silenced loggers like Solr's), remove every use of logging.basicConfig
, then look for every getLogger
and add them back to the configuration correctly, testing with DEBUG=True and False and with both gunicorn
and runserver
to check that it works.