Undefined method `tagged' for Formatter error after Rails 4 upgrade

时光怂恿深爱的人放手 提交于 2019-12-05 03:24:54

Are you using a customer logger?

Check in config/environments/development.rb. That's where the logger is usually assigned.

Also, look in config/initializers for logging-related monkey patches.

I was using Chris Powell's logger patch, and it caused a very similar error.

If you're using that patch, there's an updated one for Rails 4: http://cbpowell.wordpress.com/2013/08/09/beautiful-logging-for-ruby-on-rails-4/

I also had the same error, got rid of it by re-initializing the logger.

Added a new file on config/initializers, called it log_formatting.rb

with this code:

Rails.logger = ActiveSupport::Logger.new "log/mylog.log"
Rails.logger.formatter = proc{|severity,datetime,progname,msg|
    "[#{datetime.strftime("%Y-%m-%d %H:%M:%S")}] [#{severity}]: #{msg}\n"
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!