我在rails应用程序中有unicorn配置文件:
配置/ unicorn.rb
app_name = "my_app"
root = "/home/user/my_sites/#{app_name}/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.err.log"
stdout_path "#{root}/log/unicorn.out.log"
listen "/tmp/unicorn.#{app_name}.sock"
worker_processes 2
timeout 30
before_exec do |_|
ENV["BUNDLE_GEMFILE"] = File.join(root, 'Gemfile')
end
如何自动旋转这些日志文件?
对于rails app和rails log我做: Rails.logger = Logger.new(Rails.root.join(“log”,Rails.env +“。log”),3,20 * 1024 * 1024)
独角兽的最佳解决方案是什么?