How to change Rails 3.0's default log path?

前端 未结 3 1519
你的背包
你的背包 2021-02-14 01:03

I have to change my rail application\'s default log path because of my company\'s internal software deployment process: basically my rails app ends up on a read-only location, a

3条回答
  •  终归单人心
    2021-02-14 01:22

    You just need define your logger

    config.logger = ActiveSupport::BufferedLogger.new(File.join(ENV['SOME_ENVIRONMENT_VAR'], "var/output/logs/rails.log"))
    

    This trick works with Rails 2 too. And you can define by environment where you really want your log file.

提交回复
热议问题