python - Django log reports are not getting in my gmail -
i new python , django. trying log errors gmail whenever code breaks , configured settings.here structure of project:
myproject: -app1: .... views.py -app2: .... urls.py settings.py
i log messages gmail. i've setup in settings.py following logger:
logging = { 'version': 1, 'disable_existing_loggers': false, 'formatters': { 'verbose': { 'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", 'datefmt' : "%d/%b/%y %h:%m:%s" }, 'simple': { 'format': '%(levelname)s %(message)s' }, }, 'handlers': { 'file': { 'level': 'warning', 'class': 'logging.filehandler', 'filename': '_temp/logs/app.log', 'formatter': 'verbose' }, 'mail_admins':{ 'level':'error', 'class': 'django.utils.log.adminemailhandler', 'include_html': true, } }, 'loggers': { 'django': { 'handlers':['file'], 'propagate': true, 'level':'warning', }, '_main': { 'handlers': ['file'], 'level': 'warning', }, 'apps.orders':{ 'handlers': ['mail_admins'], 'level': 'error', 'propagate':false, }, 'apps.account':{ 'handlers': ['mail_admins'], 'level': 'error', 'propagate':false, }, 'apps.vegetables':{ 'handlers': ['mail_admins'], 'level': 'error', 'propagate':false, }, 'apps.utils':{ 'handlers': ['mail_admins'], 'level': 'error', 'propagate':false, }, 'apps.rating':{ 'handlers': ['mail_admins'], 'level': 'error', 'propagate':false, } }
}
here other settings in settings.dev file
email_host = 'smtp.gmail.com' email_host_user = 'test@gmail.com' email_host_password = 'password' email_port = 587 email_use_tls = true send_broken_link_emails = true admins = ( ('administrator', 'navajyothms1989@gmail.com'), ('administrator2','arunghosh@gmail.com'), ) managers = admins debug = false
is there way out error logs email ??
Comments
Post a Comment