Ruby on rails 控制器中未定义Rails logger方法,控制台中没有问题

Ruby on rails 控制器中未定义Rails logger方法,控制台中没有问题,ruby-on-rails,ruby-on-rails-3,logging,Ruby On Rails,Ruby On Rails 3,Logging,推到我的暂存服务器(生产的克隆),我得到了以下在生产或开发中没有看到的Rails记录器错误: Completed 500 Internal Server Error in 274ms NoMethodError (undefined method `debug=' for #<ActiveSupport::BufferedLogger:0x007fd1ca7fa0a0>): app/controllers/sessions_controller.rb:26:in `create'

推到我的暂存服务器(生产的克隆),我得到了以下在生产或开发中没有看到的Rails记录器错误:

Completed 500 Internal Server Error in 274ms

NoMethodError (undefined method `debug=' for #<ActiveSupport::BufferedLogger:0x007fd1ca7fa0a0>):
app/controllers/sessions_controller.rb:26:in `create'
在274ms内完成500个内部服务器错误
NoMethodError(对于#未定义的方法'debug='):
app/controllers/sessions_controller.rb:26:in'create'
运行
rails控制台暂存
让我们使用rails.logger.debug写入日志,很好,就像我在控制器中所做的那样

我使用的是最新版本的Rails 3(3.2.18)。我使用的是baked in Rails logger,没有第三方日志服务


任何建议都将不胜感激!谢谢。

您不能执行
调试=
;这不是一种方法。您可能想做的是调用
debug
方法并将所需的输出传递给它:

logger.debug "Output content goes here"

您不能执行
debug=
;这不是一种方法。您可能想做的是调用
debug
方法并将所需的输出传递给它:

logger.debug "Output content goes here"

您不能执行
debug=
;这不是一种方法。您可能想做的是调用
debug
方法并将所需的输出传递给它:

logger.debug "Output content goes here"

您不能执行
debug=
;这不是一种方法。您可能想做的是调用
debug
方法并将所需的输出传递给它:

logger.debug "Output content goes here"

在终端中尝试:
RAILS\u ENV=staging RAILS c
,然后
logger.debug“check”
@email列宁这里是输出,它也会写入我的日志文件:irb(main):002:0>Rails.logger.debug'check'=>truetry-in-terminal:
Rails\u ENV=staging-Rails c
,然后
logger.debug'check'
@emaillenin这是输出,它也会写入我的日志文件:irb(main):002:0>Rails.logger.debug'check'=>truetry-in-terminal:
Rails\u ENV=staging-Rails c
,然后
logger.debug'check'
@emaillenin这是输出,它也会写入我的日志文件:irb(main):002:0>Rails.logger.debug'check'=>truery-in-terminal:
Rails\u ENV=staging-Rails c
然后
logger.debug'check'
@email列宁这里是输出,它也会写入我的日志文件:irb(main):002:0>Rails.logger.debug'check'=>truel真不敢相信我错过了。。。漫长的一天。谢谢真不敢相信我错过了。。。漫长的一天。谢谢真不敢相信我错过了。。。漫长的一天。谢谢真不敢相信我错过了。。。漫长的一天。谢谢