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

393 views Asked by At

I have to to deploy a Ruby on Rails application to an tomcat application 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?

1

There are 1 answers

0
danivovich On BEST ANSWER

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