The default Ruby Sequel behaviour is to log all DB queries at the INFO level (unlike ActiveRecord which logs at the DEBUG level). How do I change this?
+3
A:
Previously, it was fairly simple to do with a proxy logger object, but enough people have asked for this that I implemented it. With the git master branch of Sequel, you can now do:
DB.sql_log_level = :debug
Which will use the debug method instead of the info method when logging queries.
Jeremy Evans
2010-10-05 18:36:24
Thanks! Where would I set that in a Rails code base?
NatGordon
2010-10-05 20:07:52
Probably in an initializer. It does depend on the Sequel::Database object being in DB, which may not be true if you are not loading it yourself. A safer bet is:Sequel::DATABASES.each{|d| d.sql_log_level = :debug}
Jeremy Evans
2010-10-06 20:12:13