Forum: Ruby on Rails problems with log4r and logger

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bbdc298cd824989df148bc5312ab4bc3?d=identicon&s=25 chirag (Guest)
on 2007-07-02 19:38
(Received via mailing list)
I'm having problems with both logger and log4r. They both work fine on
my local Windows machine but do not create the .log files when I try
them on my hosted UNIX server (TextDrive)

Below is the code for both log4r and logger. Both methods write
the .log file to the root Rails directory (not the directory where the
code is located). I changed the permission to 777 on the Root Rails
dir for the sake of testing and both methods still do not
generate .log files. Any ideas?

Thanks! chirag

Using logger
#require 'logger'
  def halo_logger
    logger_fu ='logfile.log')
    logger_fu.debug{ "params #{params} \n" }

Using log4r
require 'log4r'
include Log4r

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

    logger_fu = 'myLog'

    #alternate way of adding a file outputter
    #out ="myLog", config)

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