Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just output JSON! Most log systems will happily consume JSON, and you can easily run it through `jq -r` if you want to read it in your terminal/vi/emacs or use grep.

    $ ./myapp &>myapp.log
    # Get error messages mentioning "foobar"
    $ jq -c 'select(.severity=="error")' | grep "foobar" | jq -r '.message'


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: