为什么Rails没有写入development.log

And*_*vey 7 logging ruby-on-rails

突然,我的Rails 4.2应用程序没有向development.log写任何内容.

绝对没有!

我已经尝试检查正在使用的正确环境,重新启动服务器,检查可能与记录器交互的gems,检查权限logger.flush,等等rake log:clean.

日志文件现在完全为空,并且没有写入任何内容.

跑步rails s给出:

=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-03-14 18:49:57] INFO  WEBrick 1.3.1
[2015-03-14 18:49:57] INFO  ruby 2.1.5 (2014-11-13) [x86_64-darwin14.0]
[2015-03-14 18:49:57] INFO  WEBrick::HTTPServer#start: pid=3963 port=3000
Run Code Online (Sandbox Code Playgroud)

Stackoverflow上有很多类似的问题,但没有一个提供我的案例中有效的答案.

我不知道是什么导致这个或如何系统地调试.

我应该采取什么措施?

And*_*vey 23

好吧,经过多次转圈,我终于找到了罪魁祸首.

rails_12factor显然覆盖config.logger.

请参阅:https://github.com/heroku/rails_stdout_logging/blob/master/lib/rails_stdout_logging/rails3.rb#L7

我从开发环境中删除了这个gem(我实际上只需要在已部署的环境中使用它),现在一切正常.

感谢@maxd帮助我思考正确的方向.