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 <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2018-12-23 17:17:56 -05:00
1 parent 8a7c849fbf
commit a541ea06b7
1 file changed
+4 -5
+4 -5
View File
@@ -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)