Просмотр исходного кода

Fixes: #5199 - Change default logging for LDAP to INFO

Daniel Sheppard 5 лет назад
Родитель
Сommit
23a9cb2fad
2 измененных файлов с 3 добавлено и 2 удалено
  1. 1 0
      docs/release-notes/version-2.9.md
  2. 2 2
      netbox/netbox/authentication.py

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -8,6 +8,7 @@
 * [#5174](https://github.com/netbox-community/netbox/issues/5174) - Ensure consistent alignment of rack elevations
 * [#5174](https://github.com/netbox-community/netbox/issues/5174) - Ensure consistent alignment of rack elevations
 * [#5175](https://github.com/netbox-community/netbox/issues/5175) - Fix toggling of rack elevation order
 * [#5175](https://github.com/netbox-community/netbox/issues/5175) - Fix toggling of rack elevation order
 * [#5184](https://github.com/netbox-community/netbox/issues/5184) - Fix missing Power Utilization
 * [#5184](https://github.com/netbox-community/netbox/issues/5184) - Fix missing Power Utilization
+* [#5199](https://github.com/netbox-community/netbox/issues/5199) - Change default LDAP logging to INFO
 
 
 ---
 ---
 
 

+ 2 - 2
netbox/netbox/authentication.py

@@ -175,6 +175,6 @@ class LDAPBackend:
         # Enable logging for django_auth_ldap
         # Enable logging for django_auth_ldap
         ldap_logger = logging.getLogger('django_auth_ldap')
         ldap_logger = logging.getLogger('django_auth_ldap')
         ldap_logger.addHandler(logging.StreamHandler())
         ldap_logger.addHandler(logging.StreamHandler())
-        ldap_logger.setLevel(logging.DEBUG)
-
+        ldap_logger.setLevel(logging.INFO if settings.DEBUG is False else logging.DEBUG)
+        ldap_logger.info('Set Logging')
         return obj
         return obj