Search code examples
herokuheroku-api

Retrieve Heroku logs programmatically


I want to be able to access the Heroku-provided logs for my Node.js app online. Is there a way to add this into my app, or to use some REST API with AJAX for this? If so, how?


Solution

  • You can use the Heroku Platform API to start a log session: https://devcenter.heroku.com/articles/platform-api-reference#log-session

    There's a Node.js wrapper for the Heroku API here: https://github.com/heroku/node-heroku-client