2

I have an app that's deployed to production, but I'm also testing it locally.

When I run heroku logs --tail, I get the production logs. I can see when I make a request to the webapp and it shows up instantly in the logs.

However, my app on heroku local returns me a "500 Server Error." I want to inspect these logs to understand why. However, I can't find these logs. Is there a command like heroku local logs --tail?

Alex Petralia
  • 1,730
  • 1
  • 22
  • 39
  • Don't you see logs in the terminal, alongside your HTTP 500 error? – ChrisGPT was on strike Feb 17 '19 at 17:22
  • @Chris I don't believe so. I am only seeing when I make successful HTTP requests to the production server. – Alex Petralia Feb 17 '19 at 17:28
  • If you're talking about your _application's_ logs, they'll be wherever you put them. If you log to a file, look at the file. Heroku _expects_ logging to [be output to `STDERR` or `STDOUT`](https://devcenter.heroku.com/articles/logging#writing-to-your-log). If you're doing that (I assumed you were), you should see them alongside your HTTP 500 message. – ChrisGPT was on strike Feb 17 '19 at 18:40
  • Still no way to get around this problem? – Avisek SSarma Nov 25 '20 at 11:13
  • @AlexPetralia Do you have `debug` mode on for your app? like `DEBUG=True` for python flask app – Ankush Mar 26 '22 at 21:37
  • @AlexPetralia Also, [this](https://github.com/heroku/cli/issues/123) might help – Ankush Mar 26 '22 at 21:43

1 Answers1

-1

In order to see logs in IDE or Console use below command

Local:

I'm using Python script and the same deployed in heroku. I want to run locally by using heroku local command and would like to see logs in console but it is not showing logs in IDE Console. So for workaround i tried below command and it works well. Now I can see logs in the IDE itself.

E.g. for Python Script:

heroku local:run python test.py

E.g. for Rails:

heroku local:run rails console

Production:

heroku logs --tail --app <app-name>
Bharathiraja
  • 714
  • 1
  • 12
  • 20