diff --git a/docs/integrations/flask.rst b/docs/integrations/flask.rst index 438a4795..8fc4e1ab 100644 --- a/docs/integrations/flask.rst +++ b/docs/integrations/flask.rst @@ -30,7 +30,8 @@ You can optionally configure logging too:: import logging from raven.contrib.flask import Sentry - sentry = Sentry(app, logging=True, level=logging.ERROR) + sentry = Sentry(app, logging=True, level=logging.ERROR, \ + logging_exclusions=("logger1", "logger2", ...)) Building applications on the fly? You can use Raven's ``init_app`` hook:: @@ -48,7 +49,8 @@ You can pass parameters in the ``init_app`` hook:: def create_app(): app = Flask(__name__) sentry.init_app(app, dsn='___DSN___', logging=True, - level=logging.ERROR) + level=logging.ERROR, + logging_exclusions=("logger1", "logger2", ...)) return app Settings diff --git a/docs/integrations/logging.rst b/docs/integrations/logging.rst index da703aa6..514d54a7 100644 --- a/docs/integrations/logging.rst +++ b/docs/integrations/logging.rst @@ -132,3 +132,13 @@ message within Sentry:: logger.error('There was some %s error', 'crazy') logger.error('There was some %s error', 'fun') logger.error('There was some %s error', 1) + +Exclusions +~~~~~~~~~~ + +You can also configure some logging exclusions during setup. These loggers +will not propagate their logs to the Sentry handler. + + from raven.conf import setup_logging + + setup_logging(handler, exclude=("logger1", "logger2", ...))