Centralize logging initialization

Bug #729210 reported by David Owen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical SSO provider
Triaged
Medium
Unassigned

Bug Description

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 able to 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.

David Owen (dsowen)
description: updated
Changed in canonical-identity-provider:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.