Attach handlers to django_auth_ldap

To assist with debugging LDAP authentication, associate the 'django_auth_ldap'
handler with the 'tower_warnings' logger.  To enable debugging, set the
following in a tower settings file:

> LOGGING['handlers']['tower_warnings']['level'] =  'DEBUG'

Also uses the proper `filename` for the tower_warnings log file.
This commit is contained in:
James Laska
2015-11-05 12:06:29 -05:00
parent 9ea8dc845e
commit 4060370fad

View File

@@ -721,7 +721,7 @@ LOGGING = {
'level': 'WARNING', 'level': 'WARNING',
'class':'logging.handlers.RotatingFileHandler', 'class':'logging.handlers.RotatingFileHandler',
'filters': ['require_debug_false'], 'filters': ['require_debug_false'],
'filename': os.path.join(LOG_ROOT, 'tower_warnings.log'), 'filename': os.path.join(LOG_ROOT, 'tower.log'),
'maxBytes': 1024 * 1024 * 5, # 5 MB 'maxBytes': 1024 * 1024 * 5, # 5 MB
'backupCount': 5, 'backupCount': 5,
'formatter':'simple', 'formatter':'simple',
@@ -813,7 +813,8 @@ LOGGING = {
'propagate': False, 'propagate': False,
}, },
'django_auth_ldap': { 'django_auth_ldap': {
'handlers': ['null'], 'handlers': ['console', 'file', 'tower_warnings'],
'level': 'DEBUG',
}, },
} }
} }