有,使用 logging.handlers.SMTPHandler,SMTP和logging模块都需要自己配置。
如果使用163邮箱发信,这个handler可以这样配置:
h = SMTPHandler("smtp.163.com", user_mail, target_mail,
"logging from my app",
credentials=(user_mail, password),
secure=())
具体怎么集成到你的logging配置,取决于你用的fileConfig, dictConfig还是别的。反正都可以配上去就是了。