seuros / capistrano-puma

Puma integration for Capistrano
https://github.com/seuros/capistrano-puma
MIT License
615 stars 299 forks source link

Make the 'append' argument in template configurable. #296

Closed lanzhiheng closed 4 years ago

lanzhiheng commented 4 years ago

I think we should make the last argument in stdout_redirect configurable.

    def stdout_redirect(stdout=nil, stderr=nil, append=false)
      @options[:redirect_stdout] = stdout
      @options[:redirect_stderr] = stderr
      @options[:redirect_append] = append
    end

Fetch the value in our template

seuros commented 4 years ago

why will you reset the log file at every deploy ?

lanzhiheng commented 4 years ago

@seuros After too much deploy, the log about puma grew bigger.

image

Sometimes I want to restrict the logs's size in my project. Like this. But I think that puma can't do the same as Rails's log by configuring the size of the it

  logger = ActiveSupport::Logger.new(Rails.root.join('log/production.log'), 0, 10.megabytes)
  logger.formatter = config.log_formatter
  config.logger    = ActiveSupport::TaggedLogging.new(logger)

So, to handle this problem, I think it will be better to reset the log file at every deploy.

lanzhiheng commented 4 years ago

If you consider it is acceptable, I can push a commit for this tweak.

seuros commented 4 years ago

that not a deployment responsability . You should not fix this issue by redeploying.

Checkout logrotate , https://en.wikipedia.org/wiki/Log_rotation

lanzhiheng commented 4 years ago

Thanks for your advice. I will check it later.