Skip to content

Commit

Permalink
Logger Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Niush committed Oct 6, 2021
1 parent c56e501 commit 7b6dabb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions isac_simo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
},
Expand Down
2 changes: 2 additions & 0 deletions syslg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 7b6dabb

Please sign in to comment.