From 348076444bb0c1b9e08eac5331685f5c7a5115d8 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 17 Aug 2009 11:07:58 +0200 Subject: production logging enabled --- config.ru | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.ru b/config.ru index 0cc3dc6..95e58ae 100644 --- a/config.ru +++ b/config.ru @@ -2,4 +2,11 @@ require 'rubygems' require 'sinatra' require 'application.rb' +if ENV["RACK_ENV"] == 'production' + FileUtils.mkdir_p 'log' unless File.exists?('log') + log = File.new("log/sinatra.log", "a") + $stdout.reopen(log) + $stderr.reopen(log) +end + run Sinatra::Application -- cgit v1.2.3