Hi All,
This configuration makes error.log file in my code base but I am not seeing any logs related to email here.
-- I am using Django 2.0.6, Python 3.6 and MySql 5.7.
For sending an email to the admin user in case of any error, I did following settings in my settings.py file-
DEBUG = False# email configurationsEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'EMAIL = ""SERVER_EMAIL = ""EMAIL_HOST = ""EMAIL_HOST_USER = ""EMAIL_HOST_PASSWORD = ""EMAIL_PORT = ""DEFAULT_FROM_EMAIL = ""
# send server errors to adminADMINS = (('admin', 'admin@example.com'),)MANAGERS = ADMINS
# Logging configuration for productionLOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '%(asctime)s [%(levelname)s] %(filename)s:%(lineno)s %(funcName)s() : %(message)s' }, 'simple': { 'format': '%(asctime)s [%(levelname)s] : %(message)s' }, }, 'handlers': { 'file': { 'level': 'ERROR', 'class': 'logging.FileHandler', 'filename': 'error.log', 'formatter': 'verbose' }, 'mail_admins': { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler', 'formatter': 'simple' }, }, 'loggers': { 'django': { 'handlers': ['file'], 'level': 'ERROR', 'propagate': True, }, 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, },}
This configuration makes error.log file in my code base but I am not seeing any logs related to email here.
I have checked and email credentials,host,server etc all are correct.
Please share your suggestion how to make it works!
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c3d93b4e-6cf7-40ed-a259-80fa14a5f7c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment