Ruby on rails log file size too large

前端 未结 9 1463
无人共我
无人共我 2021-02-01 16:01

I stumbled to learn that my rails3.1 log file is super large, around 21mb. Is this, in terms of size normal? What the log file would like in the production environment? Besides,

9条回答
  •  萌比男神i
    2021-02-01 16:12

    Yes, You can using syntax like this:

    config.logger = ActiveSupport::Logger.new(config.log_file, num_of_file_to_keep, num_of_MB*1024*1024)
    

    Example:

    config.logger = ActiveSupport::Logger.new(config.log_file, 2, 20*1024*1024)
    

    It not only using for Rails log, you can using log file of any services run with rails, such as: rpush log, ...

提交回复
热议问题