diff --git a/lib/galaxy/webapps/reports/app.py b/lib/galaxy/webapps/reports/app.py index 69392b4fd925..46c52791dd9b 100644 --- a/lib/galaxy/webapps/reports/app.py +++ b/lib/galaxy/webapps/reports/app.py @@ -3,6 +3,7 @@ import time import galaxy.model +from galaxy.config import configure_logging from galaxy.security import idencoding from galaxy.web_stack import application_stack_instance from . import config @@ -19,7 +20,7 @@ def __init__(self, **kwargs): # Read config file and check for errors self.config = config.Configuration(**kwargs) self.config.check() - config.configure_logging(self.config) + configure_logging(self.config) self.application_stack = application_stack_instance() # Determine the database url if self.config.database_connection: diff --git a/lib/galaxy/webapps/reports/config.py b/lib/galaxy/webapps/reports/config.py index c9100015468b..8d0be0b458d3 100644 --- a/lib/galaxy/webapps/reports/config.py +++ b/lib/galaxy/webapps/reports/config.py @@ -2,7 +2,6 @@ import logging import os import re -import sys from galaxy.util import string_as_bool @@ -108,34 +107,3 @@ def get_database_engine_options(kwargs): value = conversions[key](value) rval[key] = value return rval - - -def configure_logging(config): - """ - Allow some basic logging configuration to be read from the cherrpy - config. - """ - format = config.get("log_format", "%(name)s %(levelname)s %(asctime)s %(message)s") - level = logging._levelNames[config.get("log_level", "DEBUG")] - destination = config.get("log_destination", "stdout") - log.info("Logging at '%s' level to '%s'" % (level, destination)) - # Get root logger - root = logging.getLogger() - # Set level - root.setLevel(level) - # Turn down paste httpserver logging - if level <= logging.DEBUG: - logging.getLogger("paste.httpserver.ThreadPool").setLevel(logging.WARN) - # Remove old handlers - for h in root.handlers[:]: - root.removeHandler(h) - # Create handler - if destination == "stdout": - handler = logging.StreamHandler(sys.stdout) - else: - handler = logging.FileHandler(destination) - # Create formatter - formatter = logging.Formatter(format) - # Hook everything up - handler.setFormatter(formatter) - root.addHandler(handler)