1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 01:14:21 +01:00

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

View File

@ -330,6 +330,7 @@ class LdapCherry(object):
cherrypy.log.error_log.setLevel(level) cherrypy.log.error_log.setLevel(level)
if debug: if debug:
cherrypy.log.error_log.handlers = []
handler = logging.StreamHandler(sys.stderr) handler = logging.StreamHandler(sys.stderr)
handler.setLevel(logging.DEBUG) handler.setLevel(logging.DEBUG)
cherrypy.log.error_log.addHandler(handler) cherrypy.log.error_log.addHandler(handler)