Enable the email handler on src.fp.o
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
d71f24c44d
commit
0e04af843a
1 changed files with 70 additions and 0 deletions
|
@ -181,6 +181,76 @@ SSH_KEYS = {
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% 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
|
# Configuration item that are specific for this odd pagure instance
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue