From 3e651e795a76032eef18349a5cddaf770c0e2046 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 26 May 2016 22:57:12 +0200 Subject: [PATCH 1/2] Added sentry to docs --- docs/errorhandling.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/errorhandling.rst b/docs/errorhandling.rst index 4210cae3..9fe00cf0 100644 --- a/docs/errorhandling.rst +++ b/docs/errorhandling.rst @@ -28,6 +28,46 @@ exception to the :attr:`~flask.Flask.logger`. But there is more you can do, and we will cover some better setups to deal with errors. +Error Logging Tools +------------------- + +Sending error mails, even if just for critical ones, can become +overwhelming if enough users are hitting the error and log files are +typically never looked at. This is why we're recommending using +`Sentry `_ for dealing with application errors. +It's available as an Open Source project `on GitHub +`__ and is also available as `Hosted Version +`_ which you can try for free. Sentry +aggregates duplicate erorrs, captures the full stack trace and local +variables for debugging, and send you mails based on new errors or +frequency thresholds. + +To use Sentry you need to install the `raven` client:: + + $ pip install raven + +And then add this to your Flask app:: + + from raven.contrib.flask import Sentry + sentry = Sentry(app, dsn='YOUR_DSN_HERE') + +Of if you are using factories you can also init it later:: + + from raven.contrib.flask import Sentry + sentry = Sentry(dsn='YOUR_DSN_HERE') + + def create_app(): + app = Flask(__name__) + sentry.init_app(app) + ... + return app + +The `YOUR_DSN_HERE` value needs to be replaced with the DSN value you get +from your Sentry installation. + +Afterwards failures are automatically reported to Sentry and from there +you can receive error notifications. + .. _error-handlers: Error handlers From 42b7ab3f499d3ccecfb86220cf3107ba6231cd8f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 27 May 2016 00:17:58 +0200 Subject: [PATCH 2/2] Incorporated ThiefMaster's suggestions for docs --- docs/errorhandling.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/errorhandling.rst b/docs/errorhandling.rst index 9fe00cf0..e2af7af4 100644 --- a/docs/errorhandling.rst +++ b/docs/errorhandling.rst @@ -33,13 +33,13 @@ Error Logging Tools Sending error mails, even if just for critical ones, can become overwhelming if enough users are hitting the error and log files are -typically never looked at. This is why we're recommending using -`Sentry `_ for dealing with application errors. -It's available as an Open Source project `on GitHub -`__ and is also available as `Hosted Version +typically never looked at. This is why we recommend using `Sentry +`_ for dealing with application errors. It's +available as an Open Source project `on GitHub +`__ and is also available as a `hosted version `_ which you can try for free. Sentry -aggregates duplicate erorrs, captures the full stack trace and local -variables for debugging, and send you mails based on new errors or +aggregates duplicate errors, captures the full stack trace and local +variables for debugging, and sends you mails based on new errors or frequency thresholds. To use Sentry you need to install the `raven` client::