delayed_job_config.rb带有日志配额轨道的未定义方法3.2.8

时间:2013-01-03 19:23:20

标签: ruby-on-rails ruby ruby-on-rails-3 logging delayed-job

我使用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?

谢谢

0 个答案:

没有答案