Ruby on Rails SQL Logging -


Is SQL command possible to log in Ruby on Rail Is> Generate and save it on a separate file?

I am still in development mode and want to save all the SQL commands on all different logs.

I have examined the development .log files, but they can also start

"for / Gate" / Gate "127.0.0.1 on 12701.0.0.1 To save data such as 2014-02-17 16:41:47 +0800, etc.

I'm either creating a separate log file for SQL or just this SQL command Leaving these other lines.

Is it possible? Thanks.

< P> If you use an active record, you can activate the records Can overwrite the logger are:
  ActiveRecord :: Base.logger = Logger.new ( "# {Rails.root} /log/sql_log.log")    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -