From c7147274f07a2b26ff0ada42d520603b0dca12de Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 10 Nov 2021 17:43:34 -0500 Subject: [PATCH] Resolving issues from code review --- config/logging.py | 16 +++------------- crc/__init__.py | 7 ++++--- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/config/logging.py b/config/logging.py index 8849d36a..bddebeee 100644 --- a/config/logging.py +++ b/config/logging.py @@ -9,22 +9,12 @@ logging_config = { }, 'alembic.runtime.migration': { 'handlers': ['console', 'file'], - 'level': 'WARN', + 'level': 'ERROR', 'propagate': False }, 'urllib3.connectionpool': { 'handlers': ['console', 'file'], - 'level': 'WARN', - 'propagate': False - }, - 'elasticsearch': { - 'handlers': ['console', 'file'], - 'level': 'WARN', - 'propagate': False - }, - 'ElasticIndex': { - 'handlers': ['console', 'file'], - 'level': 'WARN', + 'level': 'ERROR', 'propagate': False }, }, @@ -48,7 +38,7 @@ logging_config = { "level": "DEBUG" }, "file": { - "level": "DEBUG", + "level": "INFO", "formatter": "simple", "class": "logging.FileHandler", "filename": "cr_connect.log" diff --git a/crc/__init__.py b/crc/__init__.py index 4a7f67e3..89e8dce4 100644 --- a/crc/__init__.py +++ b/crc/__init__.py @@ -18,9 +18,6 @@ from sentry_sdk.integrations.flask import FlaskIntegration from apscheduler.schedulers.background import BackgroundScheduler from werkzeug.middleware.proxy_fix import ProxyFix -from config.logging import logging_config -logging.config.dictConfig(logging_config) - connexion_app = connexion.FlaskApp(__name__) app = connexion_app.app @@ -30,9 +27,13 @@ app.config.from_object('config.default') if "TESTING" in os.environ and os.environ["TESTING"] == "true": app.config.from_object('config.testing') app.config.from_pyfile('../config/testing.py') + import logging + logging.basicConfig(level=logging.INFO) else: app.config.root_path = app.instance_path app.config.from_pyfile('config.py', silent=True) + from config.logging import logging_config + logging.config.dictConfig(logging_config) db = SQLAlchemy(app)