1

In ruby, I've used the gem exception_notification

This will send me an email about the detailed exception information.

What's an alternative for Python?

  • 1
    What version of Python are you using? Do you need to get the information in an email only, or does it need to be able to community with other services? – Undo Sep 14 '15 at 2:40
2

The standard library logging module. Use logging.handlers.SMTPHandler for email. It works in 2 and 3.

https://docs.python.org/2/library/logging.html

  • Seems more like a Google question though. – user193661 Sep 14 '15 at 4:55
1

In addition to the standard logging library you might like to consider using CrashReporter.

Example, from the documentation:

from crashreporter import CrashReporter

# Some code here that actually implements your application

if __name__ == '__main__':
    # Note I have used a configuration file for setting up SMTP and FTP accounts but you can also call functions
    # cr.setup_smtp() and cr.setup_ftp() with your credentials to configure SMTP/FTP respectively.
    cr = CrashReporter(report_dir='/home/calvin/crashreporter',
                       check_interval=10,
                       config='./crashreporter.cfg')

    cr.application_name = 'My App'
    cr.application_version = '1.1.350'

    # Crash reporter set up go ahead and run your app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.