Browse Source

Add some logging to console

That is a sensible default for production deployment. As far as now, nothing was
logged to console in production environment (not even in case of HTTP 500
error, which makes production errors undebuggable).
Jocelyn Delalande 8 years ago
parent
commit
0cedaec515
1 changed files with 8 additions and 1 deletions
  1. 8 1
      coin/settings_base.py

+ 8 - 1
coin/settings_base.py

@@ -186,7 +186,10 @@ LOGGING = {
             'level': 'ERROR',
             'filters': ['require_debug_false'],
             'class': 'django.utils.log.AdminEmailHandler'
-        }
+        },
+        'console': {
+            'class': 'logging.StreamHandler',
+        },
     },
     'loggers': {
         'django.request': {
@@ -194,6 +197,10 @@ LOGGING = {
             'level': 'ERROR',
             'propagate': True,
         },
+        'django': {
+            'handlers': ['console'],
+            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
+        },
     }
 }