Created
September 12, 2016 00:10
-
-
Save jeb2239/8d3dc1caaf029c27fae17fb3a6779e91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.handlers | |
smtp_handler = logging.handlers.SMTPHandler(mailhost=("smtp.example.com", 25), | |
fromaddr="[email protected]", | |
toaddrs="[email protected]", | |
subject=u"AppName error!") | |
logger = logging.getLogger() | |
logger.addHandler(smtp_handler) | |
try: | |
break | |
except Exception as e: | |
logger.exception('Unhandled Exception') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment