Topic: is log4r

thread safe? does any one know log4r method are thread safe?

how can i do the two lines in the init method only once? I mean, is there a static method equivalent in Ruby as in Java?

Class foo
@@logfile=nil
def initialize
      myLog = Logger.instance
      @@logfile = myLog.getLogger('trace.log')
end   
end

require 'log4r'
require 'singleton'
module PayPalSDKUtils
class Logger 
    include Singleton
    cattr_accessor :MyLog
    def getLogger(filename)
      @@MyLog = Log4r::Logger.new("mylog")
      Log4r::FileOutputter.new('my_log',
                       :filename=> "#{RAILS_ROOT}/log/#{filename}",
                       :trunc=>false,
                       :formatter=> MyFormatter)
      @@MyLog.add('my_log')
      return @@MyLog
      end 
  end

Re: is log4r

i found out all outputters in log4r are thread safe. So the real question still remain, what is the equivalent of static block in Java if any?