Skip to content
Myr

Added sentry to docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 8d7e7aa · Browse files · 1 file+40 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+40 added−0 removed

  • other:+40 added−0 removed

1 file+40 added−0 removed

modified:docs/errorhandling.rst+40 added
26 unmodified lines
2728But there is more you can do, and we will cover some better setups to deal29with errors.3031Error Logging Tools32-------------------3334Sending error mails, even if just for critical ones, can become35overwhelming if enough users are hitting the error and log files are36typically never looked at. This is why we're recommending using37`Sentry <http://www.getsentry.com/>`_ for dealing with application errors.38It's available as an Open Source project `on GitHub39<github.com/getsentry/sentry>`__ and is also available as `Hosted Version40<https://getsentry.com/signup/>`_ which you can try for free. Sentry41aggregates duplicate erorrs, captures the full stack trace and local42variables for debugging, and send you mails based on new errors or43frequency thresholds.4445To use Sentry you need to install the `raven` client::4647 $ pip install raven4849And then add this to your Flask app::5051 from raven.contrib.flask import Sentry52 sentry = Sentry(app, dsn='YOUR_DSN_HERE')5354Of if you are using factories you can also init it later::5556 from raven.contrib.flask import Sentry57 sentry = Sentry(dsn='YOUR_DSN_HERE')5859 def create_app():60 app = Flask(__name__)61 sentry.init_app(app)62 ...63 return app6465The `YOUR_DSN_HERE` value needs to be replaced with the DSN value you get66from your Sentry installation.6768Afterwards failures are automatically reported to Sentry and from there69you can receive error notifications.7071.. _error-handlers:7273Error handlers74--------------
319 unmodified lines