Last Updated: February 25, 2016
·
569
· rane

Read heroku log output with bunyan

The stuff before the JSON in heroku logs output has to be cut off for
bunyan to work.

$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan

Flag -l makes the output buffered by line.

Alias

alias bunyan-heroku="sed -l 's/.*app\[web\..*\]\: //' | bunyan" 
$ heroku logs --tail | bunyan-heroku -o short

Previously used cut and awk, but found a better
solution
,
for which a credit goes to @kennbrodhagen.