Forum: Ruby on Rails loggin of sql statements

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Charlie B. (Guest)
on 2006-02-22 19:22
(Received via mailing list)
Is there a way to have rails log the sql statement that it runs.  It
would be much easier for me to debug my code if I could actually see the
sql that active record is using.


Charlie
recentrambles.com -> use Time not DateTime
Ben M. (Guest)
on 2006-02-22 19:50
(Received via mailing list)
Take a look in "yourapp/log/development.log". Already done for you!

b
Kim S. (Guest)
on 2006-02-22 20:57
(Received via mailing list)
On Feb 22, 2006, at 10:20 AM, Charlie B. wrote:

> http://lists.rubyonrails.org/mailman/listinfo/rails
I you are running in development mode, your sql statements should be
logged in the development log.  If you are running in production
mode, you and can uncomment the line in config/environment.rb that
sets the log level.

   config.log_level = :debug

This will cause your sql statements to be logged.

Kim
--
  Kim S. - principal, Shrier and Deihl - 
mailto:removed_email_address@domain.invalid
Remote Unix Network Admin, Security, Internet Software Development
   Tinker Internet Services - Superior FreeBSD-based Web Hosting
                      http://www.tinker.com/
This topic is locked and can not be replied to.