导轨 - 查看日志文件中生成的SQL查询 [英] Rails - See generated SQL queries in Log files

查看:121
本文介绍了导轨 - 查看日志文件中生成的SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法看到从生产环境中轨生成的所有查询,就像你在开发可以吗?

Is there a way to see all generated queries from rails in production environment like you can in development?

推荐答案

当然可以。如果你走在config /环境/ production.rb文件中,有这样一段:

Yes you can. If you go in the config/environments/production.rb file, there's a section like this:

# See everything in the log (default is :info)
# config.log_level = :debug

取消对config.log_level行,你会得到相同的日志在生产中,你会在开发。

Uncomment the config.log_level line, and you'll get the same log in production as you would in dev.

这篇关于导轨 - 查看日志文件中生成的SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆