Enable the email handler on pagure.io

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2018-07-19 15:18:11 +02:00
parent d324a17f37
commit d71f24c44d

View file

@ -223,6 +223,7 @@ OLD_VIEW_COMMIT_ENABLED = True
PAGURE_CI_SERVICES=['jenkins']
from pagure.mail_logging import ContextInjector, MSG_FORMAT
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
@ -230,6 +231,14 @@ LOGGING = {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
'email_format': {
'format': MSG_FORMAT
}
},
'filters': {
'myfilter': {
'()': ContextInjector,
}
},
'handlers': {
'console': {
@ -238,12 +247,22 @@ LOGGING = {
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout',
},
'email': {
'level': 'ERROR',
'formatter': 'email_format',
'class': 'logging.handlers.SMTPHandler',
'mailhost': 'localhost',
'fromaddr': 'pagure@localhost',
'toaddrs': 'root@localhost',
'subject': 'ERROR on pagure',
'filters': ['myfilter'],
},
},
# The root logger configuration; this is a catch-all configuration
# that applies to all log messages not handled by a different logger
'root': {
'level': 'INFO',
'handlers': ['console'],
'handlers': ['console', 'email'],
},
'loggers': {
'pagure': {
@ -251,11 +270,6 @@ LOGGING = {
'level': 'DEBUG',
'propagate': True
},
'pagure.lib.encoding_utils': {
'handlers': ['console'],
'level': 'WARN',
'propagate': False
},
'flask': {
'handlers': ['console'],
'level': 'INFO',
@ -271,10 +285,14 @@ LOGGING = {
'level': 'WARN',
'propagate': True
},
'pagure.lib.encoding_utils': {
'handlers': ['console'],
'level': 'WARN',
'propagate': False
},
}
}
CROSS_PROJECT_ACLS = [
'create_project',
'fork_project',