On Feb 22, 2006, at 10:20 AM, Charlie Bowman wrote:
> 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
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> 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 Shrier - principal, Shrier and Deihl - mailto:kim@tinker.com
Remote Unix Network Admin, Security, Internet Software Development
Tinker Internet Services - Superior FreeBSD-based Web Hosting
http://www.tinker.com/