abkfenris / baxter-flask

Avalanche and geospatial data system for Baxter State Park
0 stars 1 forks source link

Monitoring #48

Open abkfenris opened 9 years ago

abkfenris commented 9 years ago

Some monitoring/logging setup.

Maybe psdash?

abkfenris commented 9 years ago

psdash logs

psdash -p 5050 -l '/private/var/log/*'

Also check out Sentry/Raven for exceptions. Maybe sentry.alexkerney.com?

abkfenris commented 9 years ago

ProxyFix so that Flask relays right client info to sentry. Flask instructions

abkfenris commented 9 years ago

Added ProxyFix to create_app

in baxter\__init__.py:

def create_app(config_name):
    ...other stuff
    if app.debug:
        sentry.init_app(app, logging=True, level=logging.DEBUG)
    else:
        sentry.init_app(app, logging=True, level=logging.ERROR)
        app.wsgi_app = ProxyFix(app.wsgi_app)

This way sentry gives information more like this: screen shot 2015-02-07 at 6 46 20 am than this: screen shot 2015-02-07 at 6 48 51 am Now which is more helpful?

I may want to back down the logging level, so I'm getting a bit more information right now.