In my situation, the only way I could work with reliable work was as follows: (simplified example)
First I set the log and log folder as follows:
require 'logger' configure do log_dir = "#{root}/log" Dir.mkdir(log_dir) unless Dir.exists?(log_dir) file = File.new("#{log_dir}/#{environment}.log", 'a+') file.sync = true use Rack::CommonLogger, file end
Then in a separate environment configuration
configure :test do set :logging, Logger::ERROR end configure :development do set :logging, Logger::DEBUG end configure :production do set :logging, Logger::INFO end
It works.
source share