producthunt / kittens

Heroku log endpoint that displays router errors and timeouts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kittens

Log drain target for your Heroku router logs to help you find 404s, 500s and timeouts errors.

kittens example screenshot

Heavily modified fork of heroku-log-store, storing log data in an attached PostgreSQL database.

Deploy

kittens is deployed best on Heroku, and set up as a log drain for your main application.

$ git clone git://github.com/lfittl/kittens.git
$ cd kittens
$ heroku create my-app-kittens
$ heroku config:set RACK_ENV=production
$ heroku config:set HTTP_AUTH_USER=myuser
$ heroku config:set HTTP_AUTH_PASSWORD=mypassword
$ heroku addons:add heroku-postgresql:basic
$ git push heroku master

Note that its probably a bad idea to run this on the free Heroku Postgres tier, because of the 10,000 row limit.

Setup database

Create the initial database structure using

$ heroku run migrate
Running `migrate` attached to terminal... up, run.4179

Setup Logdrain

Now, add the log drain to your main application:

$ heroku drains:add https://myuser:mypassword@my-app-kittens.herokuapp.com/drain --app my-app

To verify that you are receiving data correctly, view the kittens logs using heroku logs --tail.

Now, if you go to the main page of the app, it should show first data (check the 404 list, that one is easy to test).

Troubleshoot

In case kittens all of a sudden stops reporting ensure that you didnt run over any limits of your database (eg too many rows/gb/etc). You might just be blocked from writing to the DB. (Note by andreasklinger)

Slack Notifications

slack screenshot

To setup daily notifications to Slack, use the Heroku scheduler add-on, and have it call rake daily_report every 24 hours.

In addition set the SLACK_WEBHOOK and APP_URL env variables appropriately.

Authors

About

Heroku log endpoint that displays router errors and timeouts


Languages

Language:Ruby 75.2%Language:HTML 24.8%