Skip to content

Commit

Permalink
Update console handler when not running under wsgi to go to stdout. T…
Browse files Browse the repository at this point in the history
…his allows us to redirect exceptions during cron runs to email
  • Loading branch information
jmcarson committed Feb 22, 2024
1 parent 5e927db commit ca9ce84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/settings/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from .production import * # noqa
from .production import LOGGING, SOCIALACCOUNT_PROVIDERS, env # noqa

Expand All @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions config/settings/apps_dev.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from .production import * # noqa
from .production import LOGGING, env # noqa

Expand All @@ -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

0 comments on commit ca9ce84

Please sign in to comment.