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
def initialize
      myLog = Logger.instance
      @@logfile = myLog.getLogger('trace.log')

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

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?