From ca9ce84c6f6366c3bce0ed0f38bb8b60b761fc3e Mon Sep 17 00:00:00 2001 From: Jonas Carson Date: Thu, 22 Feb 2024 10:02:04 -0800 Subject: [PATCH] Update console handler when not running under wsgi to go to stdout. This allows us to redirect exceptions during cron runs to email --- config/settings/apps.py | 4 ++++ config/settings/apps_dev.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/config/settings/apps.py b/config/settings/apps.py index 6b6ead50..ac3b5be2 100644 --- a/config/settings/apps.py +++ b/config/settings/apps.py @@ -1,3 +1,5 @@ +import sys + from .production import * # noqa from .production import LOGGING, SOCIALACCOUNT_PROVIDERS, env # noqa @@ -14,6 +16,8 @@ except ImportError: LOGGING["handlers"]["console"]["class"] = "logging.StreamHandler" + # Send stream logging to stdout so we can redirect exceptions to email + LOGGING["handlers"]["console"]["stream"] = sys.stdout # Update drupal oauth api url for production DRUPAL_SITE_URL = "https://primedconsortium.org" diff --git a/config/settings/apps_dev.py b/config/settings/apps_dev.py index dff0377c..f32b0282 100644 --- a/config/settings/apps_dev.py +++ b/config/settings/apps_dev.py @@ -1,3 +1,5 @@ +import sys + from .production import * # noqa from .production import LOGGING, env # noqa @@ -14,3 +16,5 @@ except ImportError: LOGGING["handlers"]["console"]["class"] = "logging.StreamHandler" + # Send stream logging to stdout so we can redirect exceptions to email + LOGGING["handlers"]["console"]["stream"] = sys.stdout