require_relative 'app/init' require_relative 'app/server' # logging normally goes to either stdout or stderr depending on how it's run, if logging is enabled in Sinatra # but Passenger routes it all to its main log file unless you use a config option that is premium only :\ # so we set up logging to a local file explicitly Dir.mkdir('log') unless Dir.exist?('log') $sinatra_log = File.new("log/sinatra.log", "a+") # flush logs to the file immediately instead of buffering $sinatra_log.sync = true # Sinatra turns off its own logging to stdout if another logger is in the stack use Rack::CommonLogger, $sinatra_log run Server