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.
This commit is contained in:
kakwa 2019-02-12 22:36:16 +01:00
parent 799ca2403f
commit 73c02ccff4
1 changed files with 1 additions and 0 deletions

View File

@ -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)