I am building an application with Heroku and having some problems. I want to debug some content like I do with rails server:
logger.debug '...'
How can I do that in Heroku, so I can see the debugging in heroku logs? (or anything else..)
Thanks!
If running heroku local does not help, run a remote shell: heroku run -a <your app name> /bin/bash , and there run npm start to see the logs and debug the issue on the Heroku server.
Simply use heroku logs to display the last 100 lines of your logs. Heroku only saves the last 1500 lines of logs, which you can access using heroku logs -n 1500 . If you want more logging, check out Heroku add-ons like Logentries or Papertrail.
You can view logs with the Heroku CLI, the dashboard, your logging add-on, or in your log drain. You can't view logs for apps in Shield spaces with Private Space Logging enabled. Retrieve logs from your log drain instead.
Terminal access is now provided by clicking a link "More" on the top right of the Heroku dashboard where you can select "run console". This presents an option to run terminal commands and shows a default of 'bash'. However, you do have to explicitly enter 'bash' or other command.
Details here: http://devcenter.heroku.com/articles/logging
Also make sure you set the right Logging level for your Rails app: http://blog.sethladd.com/2005/11/adjust-log-level-in-ruby-on-rails.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With