I'm running a NodeJS app on heroku local, however all my console.log statements and error messages get trimmed.
For example:
forego | starting web.1 on port 5000
web.1 | module.js:339
I don't see the full error logs. How to avoid this trimming of error messages?
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.
heroku restart will clear logs - although if you're running in production you may not want to do this on a whim :D. This isn't true though. heroku restart simply adds onto the logs the restart activity.
heroku local
will run whatever processes you tell it to in the Procfile. If you'd like to stream your development log, simply add something like log: tail -f log/development.log
to your Procfile. You'll also want to make sure that you create a second Procfile (I use Procfile.dev
) for this. Replace the log file path with wherever your desired log file is located.
Cheers!
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