How do I access my application logs?

Posted September 8, 2013 14.6k views
I successfully deployed my ruby on rails app using a combination of this railscast and this tutorial . but my app is not fully working, How do I access my application logs? after ssh into my vps?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

@kamaln7 how do I view the logs from the droplet? Or is this command for the droplet (didnt work for me)

The output log is found in /home/username/apps/projectname/current/log/unicorn.log.

You can use the 'tail' command to output the last X lines of the file, or less to read all of it (type G (yes, it has to be uppercase) to reach the end of the file after running less.

#output the last few lines

tail /home/username/apps/projectname/current/log/unicorn.log
#output the last 40 lines
tail -40 /home/username/apps/projectname/current/log/unicorn.log

#read using less
less /home/username/apps/projectname/current/log/unicorn.log