mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-06-14 22:36:09 +08:00
Enable the email handler on src.fp.o
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
@@ -181,6 +181,76 @@ SSH_KEYS = {
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
from pagure.mail_logging import ContextInjector, MSG_FORMAT
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'formatters': {
|
||||
'standard': {
|
||||
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
|
||||
},
|
||||
'email_format': {
|
||||
'format': MSG_FORMAT
|
||||
}
|
||||
},
|
||||
'filters': {
|
||||
'myfilter': {
|
||||
'()': ContextInjector,
|
||||
}
|
||||
},
|
||||
'handlers': {
|
||||
'console': {
|
||||
'level': 'INFO',
|
||||
'formatter': 'standard',
|
||||
'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', 'email'],
|
||||
},
|
||||
'loggers': {
|
||||
'pagure': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': True
|
||||
},
|
||||
'flask': {
|
||||
'handlers': ['console'],
|
||||
'level': 'INFO',
|
||||
'propagate': False
|
||||
},
|
||||
'sqlalchemy': {
|
||||
'handlers': ['console'],
|
||||
'level': 'WARN',
|
||||
'propagate': False
|
||||
},
|
||||
'binaryornot': {
|
||||
'handlers': ['console'],
|
||||
'level': 'WARN',
|
||||
'propagate': True
|
||||
},
|
||||
'pagure.lib.encoding_utils': {
|
||||
'handlers': ['console'],
|
||||
'level': 'WARN',
|
||||
'propagate': False
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Configuration item that are specific for this odd pagure instance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user