Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-3.2production-environment

Rails: Better way to access the production.log file when deployed on VPS?


I have deployed my app on Linode VPS and the only way I know to access the production.log file is by ssh-ing into the console, going to the production.log file and opening it by nano or vim inside the console.

This is very annoying and tedious to read. It normally shows the first line of the log, so in order to see an error I have to keep scrolling down with the down key which is a painfully slow process. How can I open this log outside the console?

Also, does the log file size get ridiculously big if I don't delete its content from time to time?


Solution

  • tail and grep can be very helpful for finding things in your logs

    however for errors you should use a service, such as airbrake (there are others)

    you can try the free developer account, 1 project only - https://signup.airbrake.io/account/new?dev=true

    • click the very small 'Signup' link near the bottom

    Or choose the Free plan (1 Project, 1 User, 2 Rate Limit) Signup

    yes - periodically you will want to clear your log files - cat /dev/null > /somewhere/app/shared/log/production.log