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