I have a Rails 3 app.
Using the default logging config, when I issue a command like
logger.warn "some message"
Logger message appears in console and in logs.
Now I add one line to production.rb
config.logger = Logger.new(Rails.root.join("log","biteme.log"))
Logger message does not appear in console, only the logs.
Then I change it to this:
config.logger = Logger.new(config.paths.log.first)
And now message appears in console and in logs. There is some knowledge here that I am missing, because it does not make sense why the first config omits log message going to console. Any ideas?
Rails actually now uses
ActiveSupport::BufferedLoggerinstead of ruby’s standardLoggerclass.Try making your custom logger of that class and see if it works: