Closed gannebamm closed 4 years ago
Since we do not know if the contrib app is used, we have to update the LOGGING information if LDAP_ENABLED = True
like:
LOGGING.update(
"loggers": {
"django": {
"handlers": ["console"], "level": "ERROR", },
"geonode": {
"handlers": ["console"], "level": "INFO", },
"geoserver-restconfig.catalog": {
"handlers": ["console"], "level": "ERROR", },
"owslib": {
"handlers": ["console"], "level": "ERROR", },
"pycsw": {
"handlers": ["console"], "level": "ERROR", },
"celery": {
"handlers": ["console"], "level": "DEBUG", },
"mapstore2_adapter.plugins.serializers": {
"handlers": ["console"], "level": "DEBUG", },
"geonode_logstash.logstash": {
"handlers": ["console"], "level": "DEBUG", },
# add ldap logger
"django_auth_ldap": {
'handlers': ["console"], 'level': 'DEBUG', },
},
)
@t-book @afabiani Are you with me?
EDIT: This is not nice and not DRY. Isn´t there a better way to achieve this?
@gannebamm In general I do agree
EDIT: This is not nice and not DRY. Isn´t there a better way to achieve this?
Untested but maybe something like this could work.
if LDAP_ENABLED and 'geonode_ldap' not in INSTALLED_APPS:
import logging
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
If
LDAP_ENABLED = True
you would expect it to print logging information. But since it is not part of the LOGGING setup it wont display any. Therefore it should be added to https://github.com/GeoNode/geonode-project/blob/master/project_name/settings.py#L124