Error with log4r?


#1

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:innew’


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