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 I'm either creating a separate log file for SQL or just this SQL command Leaving these other lines. Is it possible? Thanks. "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.
< 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
Post a Comment