diff --git a/coordinator/ProcessorUtils.py b/coordinator/ProcessorUtils.py index fee2ea72e5fabc211e7568f60db6d600690bef5f..da7e13a684e3e8972c1d54970ae7daeeaa1c8e04 100644 --- a/coordinator/ProcessorUtils.py +++ b/coordinator/ProcessorUtils.py @@ -502,9 +502,6 @@ def setup_logging(job_file_path: str, is_live: bool, log_level: str): :return: """ - assert 'LOGGING_CONFIG' in os.environ - logging_config_env = os.environ['LOGGING_CONFIG'] - assert os.path.exists(logging_config_env) # get the email credentials file path from the environment variables assert 'EMAIL_CRED' in os.environ @@ -522,7 +519,16 @@ def setup_logging(job_file_path: str, is_live: bool, log_level: str): arg_string = ' '.join(sys.argv) # load logging json config file - json_file_path = logging_config_env + + # if there is no value set for the LOGGING_CONFIG file, set a default path. + if not 'LOGGING_CONFIG' in os.environ: + log_config_path_project = os.path.join(os.path.dirname(__file__), "../configs", "logger", "template_log_config.json") + print(f"ENVIRONMENT VARIABLE 'LOGGING_CONFIG' IS NOT SET, UISING DEFAULT FILE - {log_config_path_project}") + else: + log_config_path_project = os.environ['LOGGING_CONFIG'] + + assert os.path.exists(log_config_path_project) + json_file_path = log_config_path_project with open(json_file_path, 'r') as f: log_config_dict = json.load(f)