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
精彩评论