Question

How do I access my application logs?

Posted September 8, 2013 13k views
I successfully deployed my ruby on rails app using a combination of this railscast http://railscasts.com/episodes/335-deploying-to-a-vps and this tutorial https://coderwall.com/p/yz8cha . 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.

×
2 answers
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

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

Submit an Answer