Comment 0 for bug 729210

Revision history for this message
David Owen (dsowen) wrote :

Currently, logging is initialized only in django.wsgi. Logging is not initialized when the app is run using manage.py, wsgiserver.py, or wsgi_test_server.py. This means that: command-line preflight cannot verify logging configuration, and neither can a development/test web server.

Initialization could be pulled out of django.wsgi and put into a central location. Perhaps a new identityprovider.log module, with an interface similar to Python's logging module.

Care must be taken to meet these requirements:

 1. Logging should not be initialized before settings in django.conf.settings are available.

 2. This should not prevent management commands from running as a user that doesn't have write permissions on the logging destination.

 3. The preflight management command should give an accurate indication, when the command is run as the appropriate user.

 4. Logging should be initialized no more than once, no matter how it is requested. Beware that some libraries (such as lazr.restful) may load Django applications and their modules before Django itself attempts to.