Don't forget to lycansubscribe
at master 632 B view raw
1require_relative 'app/init' 2require_relative 'app/server' 3 4# logging normally goes to either stdout or stderr depending on how it's run, if logging is enabled in Sinatra 5# but Passenger routes it all to its main log file unless you use a config option that is premium only :\ 6# so we set up logging to a local file explicitly 7 8Dir.mkdir('log') unless Dir.exist?('log') 9$sinatra_log = File.new("log/sinatra.log", "a+") 10 11# flush logs to the file immediately instead of buffering 12$sinatra_log.sync = true 13 14# Sinatra turns off its own logging to stdout if another logger is in the stack 15use Rack::CommonLogger, $sinatra_log 16 17run Server