title: Simple and Ideal Logging in Sinatra
body: <p>I went through few blogs and sites which gave me some information about how to log in sinatra but didnt work for my app and also i went through a gem called <a href="https://github.com/kematzy/sinatra-logger" rel="nofollow">sinatra-logger</a> didnt tried it, wanted to know ideal and simple way to "log" in sinatra. Like we do logger.info for rails.</p>
  
  <p>The code which i tried and didnt work is from the following site <a href="http://www.nickhammond.com/2009/03/28/easy-logging-with-sinatra/" rel="nofollow">link</a> and also some of SO links were too pointing to the same approach used in the link above.</p>
  
  <pre><code>configure do
   LOGGER = Logger.new("sinatra.log")
  end
  
  helpers do
   def logger
    LOGGER
   end
  end
  </code></pre>
  
  <p>i have written this in app.rb of my app, it fails <em>saying undefined method `configure' for App:Module</em></p>
  
  <p>Any pointers or guide would be helpful. Thanks.</p>
  
  <p><strong>Edits</strong>
  Right Now am using file write to log my errors and messages:</p>
  
  <pre><code>File.open('log.txt', 'a') do |f|
   f.write "#{status}-#{CONFIG.api_url}-#{data.inspect}-tweet}"
  end
  </code></pre>