Loggin of sql statements


#1

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


#2

Take a look in “yourapp/log/development.log”. Already done for you!

b


#3

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/