Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的开发环境中,所有日志都保存到logs/development.log. 日志文件包含在每个网页中执行的 SQL 查询以及其他噪音。有没有办法将 Rails 3 配置为仅将这些查询记录在单独的日志文件中?我目前正在使用 3.2.11
logs/development.log
在您的config/environments/development.rb文件中,您可以执行以下操作:
config/environments/development.rb
config.active_record.logger = Logger.new("log/sql.log")