Forum: Ruby on Rails error with log4r?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
chirag (Guest)
on 2007-07-02 22:40
(Received via mailing list)
I get the following 'undefined method' error with I use log4r (see
below). I verified that the gem installed properly. Any ideas?

Chirag

NoMethodError in Raw data filesController#new

undefined method `outputters=' for #<Logger:0x4eb65b4>

RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/controllers/raw_data_files_controller.rb:20:in
`halo_log4r'
#{RAILS_ROOT}/app/controllers/raw_data_files_controller.rb:54:in `new'

-------------------------------------------------------------------
  def halo_log4r
    config = {
      "filename" => "fu.log",
      "maxsize" => 16000,
      "trunc" => true
    }

    logger_fu = Logger.new 'myLog'

    #alternate way of adding a file outputter
    #out = RollingFileOutputter.new("myLog", config)
    #logger_fu.add(out)

  logger_fu.outputters = RollingFileOutputter.new("myLog", config);
  logger_fu.level = DEBUG
  logger_fu.debug{ "params #{params} \n" }
  end
This topic is locked and can not be replied to.