From 7b6dabbeed634b2d544b7632867be651ea85de7b Mon Sep 17 00:00:00 2001 From: Niush Date: Wed, 6 Oct 2021 17:26:26 +0545 Subject: [PATCH] Logger Fixes --- isac_simo/settings.py | 14 ++++++++++++-- syslg/.gitignore | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 syslg/.gitignore diff --git a/isac_simo/settings.py b/isac_simo/settings.py index dbe84f6..7d28444 100644 --- a/isac_simo/settings.py +++ b/isac_simo/settings.py @@ -291,6 +291,11 @@ HONEYPOT_FIELD_NAME = "phonenumber" +# Create the syslg/errors.log +# if PRODUCTION: +# if not os.path.exists('syslg/errors.log'): +# with open('syslg/errors.log', 'w'): pass + LOGGING = { 'version': 1, 'disable_existing_loggers': False, @@ -315,11 +320,16 @@ 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler', 'include_html': True, - } + }, + 'console': { + 'level': 'WARNING', + 'class': 'logging.StreamHandler', + 'formatter': 'simple' + }, }, 'loggers': { 'django': { - 'handlers': ['error_file', 'mail_admins'] if PRODUCTION else ['error_file'], + 'handlers': ['error_file', 'mail_admins'] if PRODUCTION else ['console'], 'level': 'ERROR', 'propagate': True, }, diff --git a/syslg/.gitignore b/syslg/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/syslg/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file