I am working on a simple app in Sinatra with DataMapper. I want to see the queries that DM is created for my various chained finders, etc.
I have tried:
DataMapper::Logger.new(STDOUT, :debug)
in my configure do ... end
block in an environment.rb
file that loads when the app is started.
I have also tried:
DataMapper::Logger.new('log/my-app.log', :debug)
Neither yields log statements from the app accessed either through a browser or through an irb
session that requires my app. I do see the app starting message.
I am using rackup config.ru
to run the app locally.
What am I missing?
It seems that I missed a perfectly reasonable step. You need to place the DataMapper::Logger.new(STDOUT, :debug)
before you make the connection. HT to @snusnu on #datamapper IRC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With