When I''m inserting a big chunk of data into a text or blob field, Rails happily logs the whole lot to my development.log file. I''d still like to log the SQL, but truncating the lengthy data would be nice. Anyone know a way to do this? Alternatively, can I temporarily turn of SQL logging from my code before doing these inserts? Cheers, Pete Yandell
On 9/13/05, Pete Yandell <pete-AylieETRJAdBDgjK7y7TUQ@public.gmane.org> wrote:> When I''m inserting a big chunk of data into a text or blob field, > Rails happily logs the whole lot to my development.log file. I''d > still like to log the SQL, but truncating the lengthy data would be > nice. Anyone know a way to do this? > > Alternatively, can I temporarily turn of SQL logging from my code > before doing these inserts?take a look at the #silence method of ActiveRecord: http://rails.rubyonrails.com/classes/ActiveRecord/Base.html#M000704 -- rick http://techno-weenie.net