Topic: [solved] rails/console: how to get verbose output?

ugh... I hate to ask this but after a long time of Googling console guides, I couldn't find it. What's the command to get script/console to show such things as what SQL is being used when executing commands in the console?

Last edited by dann (2009-04-13 16:24:16)

Re: [solved] rails/console: how to get verbose output?

dann wrote:

ugh... I hate to ask this but after a long time of Googling console guides, I couldn't find it. What's the command to get script/console to show such things as what SQL is being used when executing commands in the console?

I don't think you can do this in the standard console.  You can see it in the log file though.  I usually have the console open in one window and the log opened with 'tail -f' in another, and tab between them.

###########################################
#If i've helped you then please recommend me at Working With Rails:
#http://www.workingwithrails.com/person/ … i-williams

Re: [solved] rails/console: how to get verbose output?

You can redirect the logger output to STDOUT, here's a couple of blogs about how to do it:

System wide console logging
Watching ActiveRecord

Rob Anderton
TheWebFellas

Re: [solved] rails/console: how to get verbose output?

Thanks...to do it straight from the console (w/o editing the config files), just type: ActiveRecord::Base.logger = Logger.new(STDOUT)

Re: [solved] rails/console: how to get verbose output?

This helped me a lot. Before this I didn't have any logging at all in development.log while working in the console. Do you have any idea why it happened? (I checked any file, that might have been modified while I was in the console, but find none)