Enable the email handler on pagure.io
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
d324a17f37
commit
d71f24c44d
1 changed files with 25 additions and 7 deletions
|
@ -223,6 +223,7 @@ OLD_VIEW_COMMIT_ENABLED = True
|
||||||
|
|
||||||
PAGURE_CI_SERVICES=['jenkins']
|
PAGURE_CI_SERVICES=['jenkins']
|
||||||
|
|
||||||
|
from pagure.mail_logging import ContextInjector, MSG_FORMAT
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': False,
|
'disable_existing_loggers': False,
|
||||||
|
@ -230,6 +231,14 @@ LOGGING = {
|
||||||
'standard': {
|
'standard': {
|
||||||
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
|
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
|
||||||
},
|
},
|
||||||
|
'email_format': {
|
||||||
|
'format': MSG_FORMAT
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'filters': {
|
||||||
|
'myfilter': {
|
||||||
|
'()': ContextInjector,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'handlers': {
|
'handlers': {
|
||||||
'console': {
|
'console': {
|
||||||
|
@ -238,12 +247,22 @@ LOGGING = {
|
||||||
'class': 'logging.StreamHandler',
|
'class': 'logging.StreamHandler',
|
||||||
'stream': 'ext://sys.stdout',
|
'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
|
# The root logger configuration; this is a catch-all configuration
|
||||||
# that applies to all log messages not handled by a different logger
|
# that applies to all log messages not handled by a different logger
|
||||||
'root': {
|
'root': {
|
||||||
'level': 'INFO',
|
'level': 'INFO',
|
||||||
'handlers': ['console'],
|
'handlers': ['console', 'email'],
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'pagure': {
|
'pagure': {
|
||||||
|
@ -251,11 +270,6 @@ LOGGING = {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'propagate': True
|
'propagate': True
|
||||||
},
|
},
|
||||||
'pagure.lib.encoding_utils': {
|
|
||||||
'handlers': ['console'],
|
|
||||||
'level': 'WARN',
|
|
||||||
'propagate': False
|
|
||||||
},
|
|
||||||
'flask': {
|
'flask': {
|
||||||
'handlers': ['console'],
|
'handlers': ['console'],
|
||||||
'level': 'INFO',
|
'level': 'INFO',
|
||||||
|
@ -271,10 +285,14 @@ LOGGING = {
|
||||||
'level': 'WARN',
|
'level': 'WARN',
|
||||||
'propagate': True
|
'propagate': True
|
||||||
},
|
},
|
||||||
|
'pagure.lib.encoding_utils': {
|
||||||
|
'handlers': ['console'],
|
||||||
|
'level': 'WARN',
|
||||||
|
'propagate': False
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CROSS_PROJECT_ACLS = [
|
CROSS_PROJECT_ACLS = [
|
||||||
'create_project',
|
'create_project',
|
||||||
'fork_project',
|
'fork_project',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue