Search code examples
capistranocapistrano3

Change location of capistrano.log file


My Capistrano 3 deploy writes a log to /log/capistrano.log but I'd like to change it. I've searched the official documentation but could not find anything.

I prefer to keep my deploy files separate to my application stuff so I have tidied them into their own /cap folder using:

# Capfile.rb
set :deploy_config_path, 'cap/deploy.rb'
set :stage_config_path, 'cap/deploy'

It would be great if my log in there too! How?


Solution

  • If you use the Airbrussh formatter (default since Capistrano 3.5), you can set the log location like so:

    set :format_options, log_file: 'cap/log/capistrano.log'
    

    Documentation is here: https://github.com/mattbrictson/airbrussh#configuration