getting the following error  while using logging at random
any idea what can cause this behaviour
 
Traceback (most recent call last):
File    lib/python2.4/logging/__init__.py", line 737, in emit
ValueError: I/O operation on closed file
 
 
        self.Log = logging.getLogger('MAIN')
        sFormat='%(asctime)s %(name)s %(levelname)s %(message)s'
        filer = logging.FileHandler('/tmp/log.log','a')
        filer.setLevel(logging.DEBUG)
        formatter = logging.Formatter(sFormat)
        filer.setFormatter(formatter)
       
        Erfiler = logging.FileHandler('/tmp/error.log','a')
        Erfiler.setLevel(logging.ERROR)
        Erfiler.setFormatter (formatter)
        #logging.getLogger('').addHandler(filer)
        self.Log.addHandler(filer)
        self.Log.addHandler(Erfiler)
 
 
using the following in subsequent modules
self.Log = logging.getLogger('MAIN.MODULE')
 self.Log.info("log the message") 
 
 

 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to