diff --git a/dashboard/app.py b/dashboard/app.py index c1d84960..11dcccd3 100644 --- a/dashboard/app.py +++ b/dashboard/app.py @@ -1,4 +1,5 @@ """SSO Dashboard App File.""" +import google.cloud.logging import json import logging.config import mimetypes @@ -38,6 +39,7 @@ from dashboard.models.alert import Rules from dashboard.models.tile import S3Transfer +from google.cloud.logging_v2.handlers import CloudLoggingHandler logging.basicConfig(level=logging.DEBUG) @@ -46,7 +48,11 @@ config_dict = yaml.safe_load(config_yml) logging.config.dictConfig(config_dict) +gcp_logger_client = google.cloud.logging.Client() +gcp_handler = CloudLoggingHandler(gcp_logger_client) + logger = logging.getLogger("sso-dashboard") +logger.addHandler(gcp_handler) app = Flask(__name__) everett_config = get_config() diff --git a/requirements.txt b/requirements.txt index e5c8efa7..28f1361d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,6 +26,7 @@ Flask-pyoidc==3.13.0 flask-talisman==1.0.0 future==0.18.3 gevent==22.10.2 +google-cloud-logging>=3.0.0 greenlet==2.0.2 gunicorn==20.1.0 identify==2.5.24