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

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -