GithubHelp home page GithubHelp logo

angstwad / flask-rollbar Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 8 KB

A sane configuration for Rollbar and Flask selfishly based on my own needs

License: Apache License 2.0

Python 100.00%
python flask rollbar

flask-rollbar's Introduction

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)

flask-rollbar's People

Contributors

angstwad avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cuttlesoft

flask-rollbar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.