From 3e6436bc9bb36389a5a20ad3b4b59273638b984e Mon Sep 17 00:00:00 2001 From: Dave Page Date: Wed, 17 Dec 2014 12:44:07 +0000 Subject: [PATCH] Prevent werkzeug starting up it's own stream handler so that all messages are routed through pgAdmin's handlers. --- web/pgAdmin4.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py index 21c6b77cd..27f1f391e 100755 --- a/web/pgAdmin4.py +++ b/web/pgAdmin4.py @@ -31,8 +31,11 @@ app = Flask(__name__, static_url_path='') logging.addLevelName(25, 'SQL') app.logger.setLevel(logging.DEBUG) -# We also need to update the handler on the webserver in order to see request +# We also need to update the handler on the webserver in order to see request. +# Setting the level prevents werkzeug from setting up it's own stream handler +# thus ensuring all the logging goes through the pgAdmin logger. logger = logging.getLogger('werkzeug') +logger.setLevel(logging.INFO) # File logging fh = logging.FileHandler(config.LOG_FILE) @@ -48,9 +51,9 @@ ch.setFormatter(logging.Formatter(config.CONSOLE_LOG_FORMAT)) app.logger.addHandler(ch) logger.addHandler(ch) -app.logger.debug('################################################################################') -app.logger.debug('Starting pgAdmin 4...') -app.logger.debug('################################################################################') +app.logger.info('################################################################################') +app.logger.info('Starting pgAdmin 4...') +app.logger.info('################################################################################') # The main index page @app.route("/")