summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnav Kumar <arnav@arnavkumar.com>2017-06-29 02:26:14 +0800
committerArnav Kumar <arnav@arnavkumar.com>2017-06-29 02:44:33 +0800
commit296259011837bc4ed49c0f3800af397e20318dc7 (patch)
tree996945b29b41ff58ad6c03f6bc5f190f05728bea
parentedef5f6759e6c91ea972c83be28ffb6def8195d2 (diff)
downloadraven-296259011837bc4ed49c0f3800af397e20318dc7.tar.gz
Add docs for logging_configured signal for Flask
-rw-r--r--docs/integrations/flask.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/integrations/flask.rst b/docs/integrations/flask.rst
index 8491a9d..ad3403c 100644
--- a/docs/integrations/flask.rst
+++ b/docs/integrations/flask.rst
@@ -202,3 +202,27 @@ This may also require `changes
<http://flask.pocoo.org/docs/0.10/deploying/wsgi-standalone/#proxy-setups>`_
to the proxy configuration to pass the right headers if it isn't doing so
already.
+
+
+Signals
+-------
+
+Raven uses `blinker <https://github.com/jek/blinker>`_ to emit a signal
+(called ``logging_configured``) after logging has been configured for the
+client. You may `bind to that signal <https://pythonhosted.org/blinker/#subscribing-to-signals>`_
+in your application to do any additional configuration to the logging
+handler ``SentryHandler``.
+
+.. sourcecode:: python
+
+ from raven.contrib.flask import Sentry, logging_configured
+ from flask import Flask, g, render_template
+ from raven.contrib.flask import Sentry
+
+ app = Flask(__name__)
+ sentry = Sentry(app, dsn='___DSN___', logging=True)
+
+ @logging_configured.connect
+ def internal_server_error(sender, sentry_handler=None, **kwargs):
+ # configure sentry_handler here
+ sentry_handler.addFilter(some_filter)