user1883793
user1883793

Reputation: 4189

Where is my Rails log file after deployed to VPS using Capistrano

I have deploy my Rails app to a VPS (Nginx + Unicorn + Postgres) using Capistrano 3, but I got an error page "we're sorry, but something went wrong." And I can't find my Rails log file, I uncommented this line in the deploy.rb, and still cannot find it.

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

There are log files in my current/log directory and shared/log/, but they don't get updated when I refresh my error page.

Any idea?

Thanks

Upvotes: 0

Views: 203

Answers (1)

Felix Borzik
Felix Borzik

Reputation: 1230

Try doing the following:

  1. touch /var/www/projectx/shared/log/unicorn.log
  2. Update your unicorn.rb file with:

    stderr_path "#{root}/shared/log/unicorn.log"
    stdout_path "#{root}/shared/log/unicorn.log"
    
  3. Restart your unicorn workers and master process.

Reason: your log file will be reset each time you will update your repo.

Upvotes: 1

Related Questions