Skip to content

Commit 2268c59

Browse files
committed
use ruby standard logger because padrino logger has odd error in my production environment.
1 parent b9aca69 commit 2268c59

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config.ru

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,15 @@
55
# just execute it from the command line.
66

77
require File.expand_path("../config/boot.rb", __FILE__)
8-
use Rack::CommonLogger, logger if ENV['RACK_ENV'] == 'production'
8+
9+
# use ruby standard logger because padrino logger has odd error in my production environment.
10+
require 'logger'
11+
class ::Logger; alias_method :write, :<<; end
12+
13+
if ENV['RACK_ENV'] == 'production'
14+
logger = ::Logger.new("log/production.log")
15+
logger.level = ::Logger::WARN
16+
use Rack::CommonLogger, logger
17+
end
18+
919
run Padrino.application

0 commit comments

Comments
 (0)