Вопрос

Pushing to my staging server (clone of production), I am getting the following Rails logger error that I do not see in production or development:

Completed 500 Internal Server Error in 274ms

NoMethodError (undefined method `debug=' for #<ActiveSupport::BufferedLogger:0x007fd1ca7fa0a0>):
app/controllers/sessions_controller.rb:26:in `create'

Running rails console staging let's me write to the log using Rails.logger.debug just fine, exactly as I am doing in the controller.

I am on the latest version of Rails 3 (3.2.18). I am using the baked in Rails logger, no third party logging services are in place.

Any advice is appreciated! Thank you.

Это было полезно?

Решение

You can't do debug=; it's not a method. What you probably wanted to do is call the debug method and pass it the output you want:

logger.debug "Output content goes here"
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top