Simple error logging for Sinatra

Writes to console and outputs to log…

error_logger ='log/errors.log')
error do
  e = request.env['sinatra.error']
  info = "Application error\n#{e}\n#{e.backtrace.join("\n")}" info
  Kernel.puts info

  'Application error'

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s