HEROKU logs. That only shows me about 100 lines. Is there not a way to see complete logs for our application on HEROKU?
from heroku logs help:
-n, --num=num number of lines to display
or using heroku web dashboard - logs addon
Related
there is an application on Go that is hosted on heroku, I don't understand why what I output to fmt.Println() doesn't get into the logs, I look at the logs through the heroku logs -t command.
Another question is, if my application asks me to enter certain data into the console at startup, is it possible to do this?
I am trying to get heroku setup locally on my new laptop to be able to access an existing heroku account that has two existing rails apps on it. I was able to install heroku cli locally and I was able to login to heroku. If I run "heroku apps" it lists my two apps. But two things I need help with:
1) I can't remember how to tell heroku which app the git repo in the current folder on my laptop should work with on heroku server. in other words, how do i "select" which app i want to current work with after logging into heroku.
2) when I tried running the "heroku config" command to list existing config vars after logging it it gave me some kind of error message. need some suggestions on what might be causing that too.
Sorry to not include screen shots of errors but on a different company right now. hopefully you can at least help me answer the first question.
Thanks,
Edward
ps. I found this Q&A, does the answer here apply to my question (1)?
How to link a folder with an existing Heroku app
The cause turned out to be that I needed to add the heroku app location as a remote repo using the heroku cli from within my local git repo I had created. I used the following command:
heroku git:remote -a thawing-inlet-61413
where "thawing-inlet-61413" is the name of the app. You can get this by running:
heroku apps
and it will list them.
reference: https://devcenter.heroku.com/articles/git#creating-a-heroku-remote
I'm using Heroku Scheduler to run a few apps each night. I believe they are what Heroku would call a "worker apps" because they run for about 2 hours each and only need to run once per day. That said, I can't figure out how to change them from being web apps to worker apps?
For context, I'm using the free tier of Heroku.
You need to create a file called Procfile in your root.
Found the answer here: https://stackoverflow.com/a/44122238/12020295
So, change your Procfile to read (with your specific command filled in):
worker: node index.js
and then also run on CLI:
$ heroku scale worker=1
So, I'm kind of new to Heroku. I have a small forum for a private community. New Relic tells me there was a 404 this afternoon. I want to find out the details of the request that returned that 404. What can I do?
You can look at the logs on Heroku with heroku logs.
However, Heroku only allows access to the most recent 1500 lines.
Heroku only stores the last 1500 lines of log history. If you’d like
to persist more than 1500 lines, use a logging add-on.
https://devcenter.heroku.com/articles/logging#log-history-limits
You should install one of the many logging add ons so that you can keep more log history.
How could I clear heroku logs?
heroku restart will clear logs - although if you're running in production you may not want to do this on a whim :D
Other than that you can use the advanced logging addon (Syslog drains), which gives you the ability to clear the logs:
deprecated
heroku logs:drains clear
Update 2019/08/07
heroku drains
More info: http://devcenter.heroku.com/articles/logging
The current command to clear logs is
heroku drains
Currently, there is no way to clear the Heroku logs. Heroku maintains a record of the past 1500 lines of log activity.