Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.15 KB

README.md

File metadata and controls

39 lines (31 loc) · 1.15 KB

drain

A simple Heroku HTTP drain written in NodeJs

Running

In it's basic no output format,

npm start

To see the Logplex Log lines that are being posted via the body of the request.

LOG_BODY=1 npm start

To see the headers

LOG_HEADERS=1 npm start

Those env variables can be used together to show headers and body for each POST

LOG_BODY=1 LOG_HEADERS=1 npm start

Getting logs from a Heroku app

You will need a publicly available host to run the application. Running drain on the Heroku platform is possible, however it defeats the point. A simple solution to run this locally is to combine it with ngrok.

ngrok 3000
npm start

NOTE: You will need two terminal windows to run both apps in the foreground.

Take note of the hosts that ngrok reports. You will need it in the next step to add the drain to your existing Heroku application.

heroku drains:add [NGROK_HOST]/logs -a [YOUR_HEROKU_APP_NAME]

That's it. You can tell it is working by looking at your ngrok output. It should be reporting a pile of POST requests responding with an HTTP status of 201 Created.