新手问题 测试服务器上运行后如何查看 log?

Catherine · 2015年12月24日 · 最后由 catherine 回复于 2015年12月25日 · 1942 次阅读

railsroot 的 log 下文件都看过了,没有找到我需要的像本地调试那样的 log 啊。。。?

不应该是到 server 上去看 log 么?如果你用的 apache。可以到、/var/log/apache2/下面找。

看下配置是这个不? config.log_level = :debug

#2 楼 @qinfanpeng 本地测试没问题,但上传到测试服务器前端拿不到数据,调试的话一般用什么工具模拟提交?因为这是做的一个微信公众号,后台我就提供接口,在电脑上测感觉很不方便。。。第一次接触这个,调试感觉太不顺了。。

我的 environment/production.rb 里 config.log_level = :debug 是注释了的。如果打开的话,访问过服务器在 production.log 所有内容都可以看到,就跟平时本地测试打开的 rails s 终端里的 log 一样了?

# Force all environments to use the same logger level 
# (by default production uses :info, the others :debug) 
config.log_level = :debug

production 上的 log_level 默认是 :info,临时改成:debug应该可以满足你的需求;不过长期看来,最好还是建立 uat、staging 之类的环境来来定位这些问题,长期在生产环境这样弄总不是个办法。

Google keyword: Rails config log level

需要 登录 后方可回复, 如果你还没有账号请 注册新账号