我使用rails 3.2.8,我需要在开发和生产环境中进行日志轮换:
我已将development.rb
和production.rb添加到日志轮换的下一个:
config.logger = Logger.new("#{Rails.root.to_s}/log/development.log", 2, 10.megabytes)
config.logger = Logger.new("#{Rails.root.to_s}/log/production.log", 2, 10.megabytes)
我需要使用delayed_job gem,我知道这是我的delayed_job_config.rb:
Delayed::Worker.max_attempts = 2
Delayed::Worker.delay_jobs = !Rails.env.test?
Delayed::Worker.logger = Rails.logger
Delayed::Worker.logger.auto_flushing = true
我收到了下一个错误:
...config/initializers/delayed_job_config.rb:4:in `<top (required)>': undefined method `auto_flushing=' for #<Logger:0xbe59ba0> (NoMethodError)
我需要使用日志轮换,因为这些文件增长得非常快,我必须手动删除。
如何修复此错误?并将日志轮换添加到env?
谢谢