diff --git a/application/__init__.py b/application/__init__.py index f1fbf88..1352c9e 100644 --- a/application/__init__.py +++ b/application/__init__.py @@ -29,10 +29,10 @@ logger = logging.getLogger(__name__) try: - with open('log_config.yaml', 'r') as config_file: + with open('log_config.yaml') as config_file: config = yaml.safe_load(config_file.read()) logging.config.dictConfig(config) -except: +except Exception: # Fallback to a basic configuration logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s') logger.exception("Logging setup failed") @@ -41,7 +41,7 @@ # As well, to ensure that logging configuration succeeded regardless # of a successful dictConfig execution, log a warning message # to see whether the configuration was actually successful - logger.warning(f"Logging is set up with config={config}") + logger.warning("Logging is set up with config=%s", config) from .Profile.Profile import Profile