Rails.logger.info is not working in initializer

社会主义新天地 提交于 2019-12-11 07:15:45

问题


Rails.logger.info does not write any information to log when used in initializer.

How to get logging in initializer?


回答1:


Rails.logger = Logger.new(STDOUT)

before

MyServer::Application.initialize!

in /config/environment.rb




回答2:


May be the log level is silencing your message. Is it production or development?

Take a look to your config.log_level in your config/*.yml files



来源:https://stackoverflow.com/questions/26377359/rails-logger-info-is-not-working-in-initializer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!