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 2018-12-20 12:40:35 -08:00 committed by James Valleroy
parent 8a7c849fbf
commit a541ea06b7
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

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)