A log drain for Heroku's Logplex. Parses requests and pushes them to redis.
Deploy, then add the /drain
endpoint as a drain to your heroku app.
For example, if drain is deployed to heroku as the app my-new-drain
and you want to recieve logs from your my-application
:
heroku drains:add https://my-new-drain.herokuapp.com/drain -a my-application
To prevent unauthorized logging to your drain, you probably want to setup basic auth.
Set the AUTH_PASSWORD
environment variable on your drain:
heroku set AUTH_PASSWORD=super_secret -a my-new-drain
And include your password in the drain url:
heroku drains:add https://user:super_secret@my-new-drain.herokuapp.com/drain -a my-application
The simplest method is to deploy on heroku:
git clone git@github.com:ryanlower/drain.git
cd drain
heroku apps:create -b https://github.com/kr/heroku-buildpack-go.git
git push heroku master
Via environment variables:
- PORT: The port to listen for incoming logs on (set automatically on heroku)
- AUTH_PASSWORD: [optional] password for basic auth for draining
- REDIS_ADDRESS: [optional] address of redis server, defaults to localhost:6379
- REDIS_PASSWORD: [optional] password for authentication to a password protected redis server
- Add a basic UI (for 'live' view of requests)
- Add extra reporter types, e.g. send average connect time to librato