This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit bb739db3adf2a8693d6dcfd566689796bd92e6c7
Author: Marcus Christie <[email protected]>
AuthorDate: Thu Apr 2 09:22:06 2020 -0400

    Only log debug msgs when DEBUG=True
---
 django_airavata/settings.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/django_airavata/settings.py b/django_airavata/settings.py
index 38ad25d..c0afe73 100644
--- a/django_airavata/settings.py
+++ b/django_airavata/settings.py
@@ -357,10 +357,19 @@ LOGGING = {
         },
     },
     'handlers': {
-        'console': {
+        # Log everything to the console when DEBUG=True
+        'console_debug': {
+            'filters': ['require_debug_true'],
             'class': 'logging.StreamHandler',
             'formatter': 'verbose'
         },
+        # Only log INFO and higher levels to console when DEBUG=False
+        'console': {
+            'filters': ['require_debug_false'],
+            'class': 'logging.StreamHandler',
+            'formatter': 'verbose',
+            'level': 'INFO'
+        },
         'mail_admins': {
             'filters': ['require_debug_false'],
             'level': 'ERROR',
@@ -371,7 +380,7 @@ LOGGING = {
     'loggers': {
         'django_airavata': {
             'handlers': ['console', 'mail_admins'],
-            'level': 'DEBUG' if DEBUG else 'INFO'
+            'level': 'DEBUG'
         },
         'root': {
             'handlers': ['console'],

Reply via email to