From cdf28f1bca59d87bca1eaf1e339969f4196a3de3 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Fri, 10 Feb 2017 11:37:50 -0500 Subject: [PATCH] remove old logger reconfig method --- awx/main/tasks.py | 2 +- awx/main/utils/handlers.py | 28 +--------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 08242cac7c..d3d12b6259 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -90,7 +90,7 @@ def celery_startup(conf=None, **kwargs): @worker_process_init.connect def task_set_logger_pre_run(*args, **kwargs): cache.close() - configure_external_logger(settings, is_startup=False) + configure_external_logger(settings, async_flag=False, is_startup=False) def _uwsgi_reload(): diff --git a/awx/main/utils/handlers.py b/awx/main/utils/handlers.py index 1a667d2ff5..08005f7ee4 100644 --- a/awx/main/utils/handlers.py +++ b/awx/main/utils/handlers.py @@ -181,7 +181,7 @@ def add_or_remove_logger(address, instance, adding=True): if isinstance(specific_logger.handlers[i], (HTTPSNullHandler, BaseHTTPSHandler)): i_occurance = i break - + if i_occurance is None and not adding: return elif i_occurance is None: @@ -205,29 +205,3 @@ def configure_external_logger(settings_module, async_flag=True, is_startup=True) add_or_remove_logger('awx.analytics', instance, adding=is_enabled) add_or_remove_logger('awx', instance, adding=(is_enabled and 'awx' in settings_module.LOG_AGGREGATOR_LOGGERS)) - - -def configure_external_logger_old(settings_module, async_flag=True, is_startup=True): - - from django.utils.log import configure_logging - - is_enabled = settings_module.LOG_AGGREGATOR_ENABLED - if is_startup and (not is_enabled): - # Pass-through if external logging not being used - return - - LOGGING_DICT = settings_module.LOGGING - if is_enabled: - LOGGING_DICT['handlers']['http_receiver']['class'] = 'awx.main.utils.handlers.BaseHTTPSHandler' - if not async_flag: - LOGGING_DICT['handlers']['http_receiver']['async'] = False - else: - LOGGING_DICT['handlers']['http_receiver']['async'] = True - for param, django_setting_name in PARAM_NAMES.items(): - LOGGING_DICT['handlers']['http_receiver'][param] = getattr(settings_module, django_setting_name, None) - if 'awx' in settings_module.LOG_AGGREGATOR_LOGGERS: - if 'http_receiver' not in LOGGING_DICT['loggers']['awx']['handlers']: - LOGGING_DICT['loggers']['awx']['handlers'] += ['http_receiver'] - # External logging not enabled, but removal of existing configuration needed - configure_logging(settings_module.LOGGING_CONFIG, LOGGING_DICT) -