Find particular string in Heroku logs

Using heroku logs -t | grep "term" is great for filtering current log events. However, Heroku retains a max of 1500 lines of log output, so even if you do heroku logs -n 1500 -t you won't see log events that occurred prior to that log window.

The better approach is to use a logging add-on like Papertrail that retains your logs for a greater period of time and makes your full log history searchable.

Of course, it also possible that the log event you think is triggering in your code isn't.


Try putting | grep "search term" after your heroku logs -n 500 statement

so something like: heroku logs -n 500 | grep "MY ERROR STRING"