cwconfig.py
changeset 10308 3f94034cc972
parent 10273 ef74abcf369d
child 10411 4ee15441f2eb
equal deleted inserted replaced
10307:4b8253fb3125 10308:3f94034cc972
   868           'default': 'cubicweb@mydomain.com',
   868           'default': 'cubicweb@mydomain.com',
   869           'help': 'email address used as HELO address for outgoing emails from \
   869           'help': 'email address used as HELO address for outgoing emails from \
   870 the repository',
   870 the repository',
   871           'group': 'email', 'level': 1,
   871           'group': 'email', 'level': 1,
   872           }),
   872           }),
       
   873         ('logstat-interval',
       
   874          {'type' : 'int',
       
   875           'default': 0,
       
   876           'help': 'interval (in seconds) at which stats are dumped in the logstat file; set 0 to disable',
       
   877           'group': 'main', 'level': 2,
       
   878           }),
       
   879         ('logstat-file',
       
   880          {'type' : 'string',
       
   881           'default': Method('default_stats_file'),
       
   882           'help': 'file where stats for the instance should be written',
       
   883           'group': 'main', 'level': 2,
       
   884           }),
   873         )
   885         )
   874 
   886 
   875     @classmethod
   887     @classmethod
   876     def instances_dir(cls):
   888     def instances_dir(cls):
   877         """return the control directory"""
   889         """return the control directory"""
   951             return '/var/log/cubicweb/%s-%s.log' % (self.appid, self.name)
   963             return '/var/log/cubicweb/%s-%s.log' % (self.appid, self.name)
   952         else:
   964         else:
   953             log_path = os.path.join(_INSTALL_PREFIX, 'var', 'log', 'cubicweb', '%s-%s.log')
   965             log_path = os.path.join(_INSTALL_PREFIX, 'var', 'log', 'cubicweb', '%s-%s.log')
   954             return log_path % (self.appid, self.name)
   966             return log_path % (self.appid, self.name)
   955 
   967 
       
   968     def default_stats_file(self):
       
   969         """return default path to the stats file of the instance'server"""
       
   970         logfile = self.default_log_file()
       
   971         if logfile.endswith('.log'):
       
   972             logfile = logfile[:-4]
       
   973         return logfile + '.stats'
       
   974         
   956     def default_pid_file(self):
   975     def default_pid_file(self):
   957         """return default path to the pid file of the instance'server"""
   976         """return default path to the pid file of the instance'server"""
   958         if self.mode == 'system':
   977         if self.mode == 'system':
   959             if _USR_INSTALL:
   978             if _USR_INSTALL:
   960                 default = '/var/run/cubicweb/'
   979                 default = '/var/run/cubicweb/'