From 4d53b7c65943eaa74fac7f423aed300e860a0b3c Mon Sep 17 00:00:00 2001 From: Seth Ladygo Date: Wed, 13 Mar 2019 16:46:08 -0700 Subject: [PATCH] settings.py: add logging config --- procat2/settings.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/procat2/settings.py b/procat2/settings.py index b83ca86..31981ab 100644 --- a/procat2/settings.py +++ b/procat2/settings.py @@ -26,9 +26,42 @@ SECRET_KEY = '-fawvl=exzaq&(%@t2!i!e1pvor@2%j60$ito#5qtiq-8zwmki' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': 'debug.log', + }, + 'console': { + 'class': 'logging.StreamHandler', + }, + }, + 'loggers': { + 'procat2': { + 'handlers': ['console', 'file'], + 'level': 'DEBUG', + #'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), + 'propagate': True, + }, + 'lazysignup': { + 'handlers': ['console', 'file'], + 'level': 'DEBUG', + #'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), + 'propagate': True, + }, + 'django': { + 'handlers': ['console', 'file'], + #'level': 'DEBUG', + 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), + 'propagate': True, + }, + }, +} # Application definition - INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth',