···11+require_relative 'server'
22+33+# logging normally goes to either stdout or stderr depending on how it's run, if logging is enabled in Sinatra
44+# but Passenger routes it all to its main log file unless you use a config option that is premium only :\
55+# so we set up logging to a local file explicitly
66+77+Dir.mkdir('log') unless Dir.exist?('log')
88+$sinatra_log = File.new("log/sinatra.log", "a+")
99+1010+# flush logs to the file immediately instead of buffering
1111+$sinatra_log.sync = true
1212+1313+# Sinatra turns off its own logging to stdout if another logger is in the stack
1414+use Rack::CommonLogger, $sinatra_log
1515+1616+run Sinatra::Application