https://github.com/angstwad/flask-rollbar
A sane configuration for Rollbar and Flask selfishly based on my own needs
https://github.com/angstwad/flask-rollbar
flask python rollbar
Last synced: 5 months ago
JSON representation
A sane configuration for Rollbar and Flask selfishly based on my own needs
- Host: GitHub
- URL: https://github.com/angstwad/flask-rollbar
- Owner: angstwad
- License: apache-2.0
- Created: 2015-11-03T20:35:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-10T16:42:08.000Z (over 10 years ago)
- Last Synced: 2025-10-30T08:25:26.045Z (8 months ago)
- Topics: flask, python, rollbar
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flask-rollbar
Sets up a sane/reasonable Rollbar configuration for Flask apps, based
upon Rollbar's suggestions and personal experience. Ignores some
400-level exceptions by default but can be customized.
Flask-Rollbar expects there to be two values defined on the Flask app's config:
``ROLLBAR_TOKEN`` and ``ROLLBAR_ENV``. The ``ROLLBAR_TOKEN`` is your app's
server-side POST token, and the environment is the Rollbar environment to which
your events will be posted. Flask-Rollbar defaults to an environment of "dev".
Here's a quick example of initializing this plugin in:
from flask import Flask
from flask.ext.rollbar import Rollbar
app = Flask(__name__)
app.config['ROLLBAR_TOKEN'] = 'mytoken'
app.config['ROLLBAR_ENV'] = 'testing'
Rollbar(app)
@app.route('/')
def this_will_fail():
1/0
Customizing ignored exceptions:
```
from werkzeug.exceptions import Unauthorized, Forbidden, NotFound
ignored = [Unauthorized, Forbidden, NotFound]
Rollbar(app, ignore_exc=ignored)
```