Skip to content

Instantly share code, notes, and snippets.

@Sutto
Forked from zacheryph/app.rb
Created October 25, 2009 02:30
Show Gist options
  • Save Sutto/217850 to your computer and use it in GitHub Desktop.
Save Sutto/217850 to your computer and use it in GitHub Desktop.
require 'sinatra/base'
class Bacon < Sinatra::Base
enable :logging, :clean_trace
get '/' do
'Hello from Sinatra!'
end
end
require 'sinatra'
require 'app.rb'
set :environment, (ENV["RACK_ENV"] || :production).to_sym
disable :run
log_dir = File.join(root_dir, "log")
FileUtils.mkdir_p(log_dir)
log = File.open(File.join(log_dir, "web-app.log"), "a")
# The Important Part iirc
$stdout.reopen(log)
$stderr.reopen(log)
run Bacon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment