From a541ea06b7b43fdd4f3908040f600aebe4a43fb4 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 20 Dec 2018 12:40:35 -0800 Subject: [PATCH] logging: Make cherrypy log to the main log - Access log is not populated by cherrpy anymore. - CherrPy does not log WSGI handler requests at all. So the request for HTML pages actually is never logged. Only static file requests which are hardly useful are logged. Reviewed-by: James Valleroy --- plinth/__main__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plinth/__main__.py b/plinth/__main__.py index 7985f272f..dd58cb30b 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -69,11 +69,10 @@ def parse_arguments(): def setup_logging(): """Setup logging framework""" - # Don't propagate cherrypy log messages to root logger - logging.getLogger('cherrypy').propagate = False - - cherrypy.log.error_file = cfg.status_log_file - cherrypy.log.access_file = cfg.access_log_file + # Remove default handlers and let the log message propagate to root logger. + for cherrypy_logger in [cherrypy.log.error_log, cherrypy.log.access_log]: + for handler in list(cherrypy_logger.handlers): + cherrypy_logger.removeHandler(handler) # Capture all Python warnings such as deprecation warnings logging.captureWarnings(True)