Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to attach my console to a heroku app as to see the app/website activity?

Tags:

node.js

heroku

I'm using heroku to deplay a node.js website with my Mac (Mac OS 10.6.8. Snow Leopard). I have node 0.6.8.

Is there a way to see the watch the app's activity, for example console.log information?

"heroku console" and "heroku run console" don't seem to work...

Thanks!

like image 615
Michael Eilers Smith Avatar asked Jan 25 '12 04:01

Michael Eilers Smith


1 Answers

You have three options. From best to worst, they are:

  1. Use heroku logs or heroku logs --tail to see what your Node process is writing to the console. For more information, see the documentation for heroku logs.

  2. Use heroku run node to run your Node app interactively. The only problem with this is that your app will start when you execute the run command, and it will exit when you exit. You can read more about this in the Heroku documentation for Node

  3. Redirect the process's stdout and stderr to a file, which you can watch for activity. A code example of how to do this is available at http://pastebin.com/tpNvgv2a.

like image 150
Rohan Singh Avatar answered Oct 02 '22 16:10

Rohan Singh