Search code examples
ruby-on-railsdeploymentcapistranocapistrano3

Rails Capistrano 3 - how to share production.log file into the shared folder of Capistrano?


I'm using Capistrano 3 for deployment with my Rails app. The problem is that every time I deploy my app to the server the ./log/production.log file is reset. I've heard it's possible to have the production.log file into the shared folder and being appended at each deployment.

I thought this was made by default by Capistrano but apparently not for me :(

Any thoughts?

Thanks!


Solution

  • In your config/deploy.rb you need a line similar to this:

    set :linked_dirs, %w{log public/system}
    

    This will tell capistrano to symlink log and public/system into the shared directory on deployment.