From 73c02ccff4158ecc0f01a7ef49b5b701663f4673 Mon Sep 17 00:00:00 2001 From: kakwa Date: Tue, 12 Feb 2019 22:36:16 +0100 Subject: [PATCH] disable default logger if running in debug mode (-D) Debug mode can lead to log sensitive data (like password changes). Having -D to log exclusively to stderr is a safer option. --- ldapcherry/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 72fbc2e..6c1b277 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -330,6 +330,7 @@ class LdapCherry(object): cherrypy.log.error_log.setLevel(level) if debug: + cherrypy.log.error_log.handlers = [] handler = logging.StreamHandler(sys.stderr) handler.setLevel(logging.DEBUG) cherrypy.log.error_log.addHandler(handler)