Is there a way to change the settings within Logentries on Heroku to sort the logs based upon the embedded log timestamp vs the timestamp that Heroku displays?
Currently having issues with our logs being completely out of order when we are letting the logs sort by Heroku timestamp. There seems to be a pretty big lack of options from what I can see in the portal.
Related
Anytime my app goes to sleep and comes back on, I lose data in my database
And I'm not storing any media, it's just form data (texts)... I built the app on strapi and I've followed all their guidelines but it keeps happening. I'd be happy if anyone can help
Local data (files, db) is cleared after a Dyno restart because the Heroku File System is ephemeral. A Dyno is restarted (at least) every 24hrs.
In your case Strapi uses SQLite where data is saved in a local file.
Strapi suggests to configure Postgres on Heroku, alternatively you can use an external DB storage service.
First of all:
As you create content types with strapi it generates the code (= new files) for the according controllers/routes/services
Heroku does not persist data after a restart
After a restart strapi checks which content types exist in the code and deletes the tables of nonexisting types from the database.
Therefore, on Heroku you have to set up all your content types locally and connect to an external db (e.g. Heroku Postgres) but never strapi's default textfile based db.
Then push the generated files and finally deploy.
Thus, on Heroku you should always run in production mode. This way the option to alter content types is completely blocked and you will not run into the issue of data loss after a restart.
I have a twitter bot hosted at Heroku, and once a day the server reboots. I have a text file that is constantly being modified, and when the server is restarted the changes in that file are lost. Does anyone know how to keep that file updated when the server is restarted?
Yes,you have to pay heroku for dynos : https://devcenter.heroku.com/articles/dynos
Or you can always choose to deploy it somewhere else
Heroku file system is ephemeral and gets wiped out at every restart.
A solution (if you want to keep using Heroku) is to use an external service to persist your data:
Amazon S3, see Heroku article
Github, an easy and free option if you need to perform simple get/put, see an example
A database (Atlas MongoDB has a free tier which can be used in cases like yours)
I use Heroku and want to see logs in the JST timezone, not the UTC.
So I changed the TZ variable on Heroku CLI and checked the JST works by running date command on Heroku bash, but Heroku logs seem to be shown in the UTC.
Are there any solutions to fix this?
I assume by changing the TZ environment, you mean setting TZ on the Dyno. This won't affect logs, as your logs could have many sources (Postgres, Redis etc...). Generally, it's always best to keep all of your services running in UTC, as this will keep debugging across systems easier. If you need to convert your logs to JST for analysis, I recommend setting up a logging add-on like papertrail, this will allow you to view logs in your preferred timezone, while keeping the main log stream in UTC.
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.
we have jelastic, and even with VDS, all changes made in date are not applied to my environments.
how can I change date/time in jelastic?
thanks.
The VDS is a standalone system. The other servers in your environment are separate.
If you want to change the timezone for your other servers, you should ask your hosting provider to do it. However, in most cases you can also specify a timezone at application level (e.g. How to set a JVM TimeZone Properly Managing timezones etc.), so system time would only be relevant for log files and cron.
With Jelastic, you can use the add-on "TimeZone Change" from the MarketPlace.
Note : on some docker containers it will not work
See official documentation : https://docs.jelastic.com/timezone-management