开发者

Preventing Rails from opening production.log, when it is deployed with jruby-rack into tomcat

开发者 https://www.devze.com 2022-12-27 08:34 出处:网络
I have to to deploy a Ruby on Rails application to an tomcat applic开发者_开发问答ation server using jruby-rack. Due to security reasons my customer has the webapps directory mounted read only and he

I have to to deploy a Ruby on Rails application to an tomcat applic开发者_开发问答ation server using jruby-rack. Due to security reasons my customer has the webapps directory mounted read only and he won't changed this. The problem that arises is, that the rails logger wants to open the WEB-INF/log/production.log in write mode. He writes nothing to this file because log4j and friends are configured and working, but rails complains that the file is not readable.

Are there any suggestions from preventing rails from opening this file?


In your environment.rb file, change the path for the logger.

Rails.configuration.logger = Logger.new("/dev/null")
ActiveRecord::Base.logger = Rails.configuration.logger
ActionController::Base.logger = Rails.configuration.logger
ActionMailer::Base.logger = Rails.configuration.logger
0

精彩评论

暂无评论...
验证码 换一张
取 消