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 sinatra-logger didnt tried it, wanted to know ideal and simple way to "log" in sinatra. Like we do logger.info for rails.
The code which i tried and didnt work is from the following site link and also some of SO links were too pointing to the same approach used in the link above.
configure do
LOGGER = Logger.new("sinatra.log")
end
helpers do
def logger
LOGGER
end
end
i have written this in app.rb of my app, it fails saying undefined method `configure' for App:Module
Any pointers or guide would be helpful. Thanks.
Edits Right Now am using file write to log my errors and messages:
File.open('log.txt', 'a') do |f|
f.write "#{status}-#{CONFIG.api_url}-#{data.inspect}-tweet}"
end