cwconfig.py
branchstable
changeset 5641 4c1d0e80a376
parent 5630 40d7c7e180f1
parent 5640 8a6d14f4fb9d
child 5647 b21655cfc835
equal deleted inserted replaced
5635:56784e46509f 5641:4c1d0e80a376
   289     __metaclass__ = metaconfiguration
   289     __metaclass__ = metaconfiguration
   290     # to set in concrete configuration
   290     # to set in concrete configuration
   291     name = None
   291     name = None
   292     # log messages format (see logging module documentation for available keys)
   292     # log messages format (see logging module documentation for available keys)
   293     log_format = '%(asctime)s - (%(name)s) %(levelname)s: %(message)s'
   293     log_format = '%(asctime)s - (%(name)s) %(levelname)s: %(message)s'
   294     # nor remove appobjects based on unused interface
   294     # the format below can be useful to debug multi thread issues:
       
   295     # log_format = '%(asctime)s - [%(threadName)s] (%(name)s) %(levelname)s: %(message)s'
       
   296     # nor remove appobjects based on unused interface [???]
   295     cleanup_interface_sobjects = True
   297     cleanup_interface_sobjects = True
   296     # debug mode
   298     # debug mode
   297     debugmode = False
   299     debugmode = False
   298 
   300 
   299 
   301 
   687             if debug:
   689             if debug:
   688                 logthreshold = 'DEBUG'
   690                 logthreshold = 'DEBUG'
   689             else:
   691             else:
   690                 logthreshold = self['log-threshold']
   692                 logthreshold = self['log-threshold']
   691         self.debugmode = debug
   693         self.debugmode = debug
   692         init_log(debug, syslog, logthreshold, logfile, self.log_format)
   694         if sys.platform == 'win32':
       
   695             # no logrotate on win32, so use logging rotation facilities
       
   696             # for now, hard code weekly rotation every sunday, and 52 weeks kept
       
   697             # idea: make this configurable?
       
   698             init_log(debug, syslog, logthreshold, logfile, self.log_format,
       
   699                      rotation_parameters={'when': 'W7', # every sunday
       
   700                                           'interval': 1,
       
   701                                           'backupCount': 52,                                          
       
   702                                          })
       
   703         else:
       
   704             init_log(debug, syslog, logthreshold, logfile, self.log_format)
   693         # configure simpleTal logger
   705         # configure simpleTal logger
   694         logging.getLogger('simpleTAL').setLevel(logging.ERROR)
   706         logging.getLogger('simpleTAL').setLevel(logging.ERROR)
   695 
   707 
   696     def vregistry_path(self):
   708     def vregistry_path(self):
   697         """return a list of files or directories where the registry will look
   709         """return a list of files or directories where the registry will look