Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see logs when deploying to Heroku from Github?

Tags:

github

heroku

I have a nodejs repo on github and I have it connected with Heroku with the auto dpeloy option. Then when I push to master it will be deploy to Heroku server also. My question is how can I see the logs of my application? I can only find the build logs.

If it is a Heroku repo then I can do a Heroku logs but now I only have my git repo.

Thanks!

like image 743
Yiting Li Avatar asked Jul 29 '15 18:07

Yiting Li


People also ask

How do I view Heroku logs?

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.

How do I view Heroku files in git?

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.

How does Heroku sync with GitHub?

You can configure GitHub integration in the Deploy tab of apps in the Heroku Dashboard. To configure GitHub integration, you have to authenticate with GitHub. You only have to do this once per Heroku account. GitHub repo admin access is required for you to configure automatic GitHub deploys.

How do I deploy a project from GitHub to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.


2 Answers

Another method of viewing logs that might be more convenient is:

  1. Go to Heroku app page (e.g. dashboard.heroku.com/apps/myAppName)

  2. Click on "more" at the top right of the page

  3. Click on "view logs" at the top of this menu

This enables you to view the app's logs on the Heroku online GUI, without needing to install the Heroku CLI.

diagram of steps to view logs online

like image 188
Jake Thakur Avatar answered Oct 12 '22 09:10

Jake Thakur


You have probably enabled GitHub integration on your Heroku app. You still have a Heroku app right - that's what you enabled the GitHub integration on. If your app's name is foo-bar-123 then heroku logs -a foo-bar-123 should do it.

like image 21
Jon Mountjoy Avatar answered Oct 12 '22 11:10

Jon Mountjoy