From fb749bb66d8b43f7fa650332c821e15499db459d Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Aug 17 2017 21:12:41 +0000 Subject: [PATCH 1/2] Move log initialization earlier in the startup process. --- diff --git a/greenwave/app_factory.py b/greenwave/app_factory.py index 5519e7c..9fc37cf 100644 --- a/greenwave/app_factory.py +++ b/greenwave/app_factory.py @@ -40,6 +40,8 @@ def create_app(config_obj=None): load_config(app) if app.config['PRODUCTION'] and app.secret_key == 'replace-me-with-something-random': raise Warning("You need to change the app.secret_key value for production") + # initialize logging + init_logging(app) #load policies policy_pathnames = glob.glob(os.path.join(app.config['POLICIES_DIR'], '*.yaml')) app.config['policies'] = [] @@ -50,8 +52,6 @@ def create_app(config_obj=None): app.register_error_handler(code, json_error) app.register_error_handler(ConnectionError, json_error) app.register_error_handler(Timeout, json_error) - # initialize logging - init_logging(app) # register blueprints app.register_blueprint(api, url_prefix="/api/v1.0") app.add_url_rule('/healthcheck', view_func=healthcheck) From af90a63963fbb5bf4d8a581ece38429b42fe435e Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Aug 17 2017 21:12:53 +0000 Subject: [PATCH 2/2] Log some information about policies loaded at startup. --- diff --git a/greenwave/app_factory.py b/greenwave/app_factory.py index 9fc37cf..0754b23 100644 --- a/greenwave/app_factory.py +++ b/greenwave/app_factory.py @@ -44,6 +44,7 @@ def create_app(config_obj=None): init_logging(app) #load policies policy_pathnames = glob.glob(os.path.join(app.config['POLICIES_DIR'], '*.yaml')) + app.logger.info("Found policy_pathnames %r" % policy_pathnames) app.config['policies'] = [] for policy_pathname in policy_pathnames: app.config['policies'].extend(yaml.safe_load_all(open(policy_pathname, 'r')))