Changeset 6579 for main/waeup.sirp/trunk
- Timestamp:
- 6 Aug 2011, 11:20:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/datacenter.py
r6578 r6579 28 28 self._createSubDirs() 29 29 30 def _setupLogger(self, logger):31 """Setup datacenter logger.32 """33 logdir = os.path.join(self.storage, 'logs')34 if not os.path.exists(logdir):35 os.mkdir(logdir)36 filename = os.path.join(logdir, 'datacenter.log')37 38 # Create a rotating file handler logger for datacenter.39 handler = logging.handlers.RotatingFileHandler(40 filename, maxBytes=5*1024**1, backupCount=5)41 formatter = logging.Formatter(42 '%(asctime)s - %(levelname)s - %(message)s')43 handler.setFormatter(formatter)44 45 # Here we decide, whether our messages will _also_ go to46 # application log.47 logger.propagate = False48 logger.setLevel(logging.DEBUG)49 logger.addHandler(handler)50 return logger51 52 30 def _createSubDirs(self): 53 31 """Create standard subdirs. … … 106 84 self.storage = path 107 85 self._createSubDirs() 108 # Adjust logger...109 #logger = self.logger110 #handlers = logger.handlers111 #for handler in handlers:112 # logger.removeHandler(handler)113 #self._setupLogger(logger)114 86 grok.notify(DataCenterStorageMovedEvent(self)) 115 87 return not_copied
Note: See TracChangeset for help on using the changeset viewer.