citraL
citraL

Reputation: 1156

Disable query logging in Rails 3.0.x, but allowing debug information

I have a web application that generates loads of SQL queries, and it becomes difficult to read the log file. I would like to know if it is possible to disable the logging of these SQL queries in development mode(so that they do not appear in development.log file) ?

I have searched the web and read that I can put:

config.log_level = :info

in the development.rb file, but I would like to still be able to read the information generated by my logger.debug commands, which do not appear anymore if I set the log level to info ...

So, is it possible to disable query logging, while keeping logger.debug info in the log files?

Many thanks for your answer !

Upvotes: 0

Views: 99

Answers (1)

phoet
phoet

Reputation: 18845

unfortunately the debugging options in rails are really bad. there is no namespacing of log-messages (by class ie like you would in java) and most of the log-levels are chosen in a fashion that i tend to shake my head about it (why is rendering partials logged on info-level?).

rails would greatly benefit from using a decent logging-library like log4r and using features like namespacing.

(end of rant)

Upvotes: 1

Related Questions