From a0628f4a84a678173a5e91667101550051ae9a24 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Tue, 16 Dec 2014 18:21:26 +0000 Subject: [PATCH] Ensure requests to the web server hit the file log too. --- web/pgAdmin4.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py index 89b0504dc..21c6b77cd 100755 --- a/web/pgAdmin4.py +++ b/web/pgAdmin4.py @@ -31,17 +31,22 @@ 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 +logger = logging.getLogger('werkzeug') + # File logging fh = logging.FileHandler(config.LOG_FILE) fh.setLevel(config.FILE_LOG_LEVEL) fh.setFormatter(logging.Formatter(config.FILE_LOG_FORMAT)) app.logger.addHandler(fh) +logger.addHandler(fh) # Console logging ch = logging.StreamHandler() ch.setLevel(config.CONSOLE_LOG_LEVEL) ch.setFormatter(logging.Formatter(config.CONSOLE_LOG_FORMAT)) app.logger.addHandler(ch) +logger.addHandler(ch) app.logger.debug('################################################################################') app.logger.debug('Starting pgAdmin 4...')