Forum: Ruby on Rails loggin of sql statements

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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 -> 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!

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

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 S. - principal, Shrier and Deihl - 
Remote Unix Network Admin, Security, Internet Software Development
   Tinker Internet Services - Superior FreeBSD-based Web Hosting
This topic is locked and can not be replied to.