Rails 3.2.2 log files unordered, requests intertwined

后端 未结 6 1016
礼貌的吻别
礼貌的吻别 2021-02-08 02:02

I recollect getting log files that were nicely ordered, so that you could follow one request, then the next, and so on.

Now, the log files are, as my 4 year old says \"a

6条回答
  •  长情又很酷
    2021-02-08 02:24

    If you value production log readability over everything else you can use the

    PassengerMaxInstancesPerApp 1
    

    configuration. It might cause some scaling issues. Alternatively you could stuff something like this in application.rb:

    process_log_filename = Rails.root + "log/#{Rails.env}-#{Process.pid}.log"
    log_file = File.open(process_log_filename, 'a')
    Rails.logger = ActiveSupport::BufferedLogger.new(log_file)
    

提交回复
热议问题