Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see untrimmed logs on Heroku Local

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?

like image 449
aksanoble Avatar asked Dec 08 '15 12:12

aksanoble


People also ask

How can I see full logs in Heroku?

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 clear my Heroku log?

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.


1 Answers

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!

like image 101
Sean William Washington Avatar answered Sep 28 '22 11:09

Sean William Washington