2012-07-16 87 views
0

現在在環境中production.rb我寫的代碼如何按時旋轉日誌文件?

config.logger = Logger.new("#{Rails.root.to_s}/log/production.log", 'daily') 

這樣做日誌文件將在每天午夜旋轉。

如何使用define time編寫旋轉日誌的代碼?

回答