Ejemplo n.º 1
0
 def dispatch_logmsg(self):
     
     self.log_regex.get_regex_patterns()
     
     while True:
         logmsg = self.logmsg_queue.get()
         log_para = {}
         
         try:   
             if not checkutf8(logmsg):
                 #对于非utf8编码实行严格过滤
                 continue
                 
             log_conf.init_logpara(log_para,logmsg)
             
             if  log_conf.unknown_msg(log_para):
                 log = LogFactory.create_log(log_para)
                 log.dealwithlog(log_para)
                 continue 
             
             if not log_conf.check_priority(log_para):
                 continue
             self.log_regex.regex_match(log_para)
             log = LogFactory.create_log(log_para)
             log.dealwithlog(log_para)
                 
         except:
             syslog.syslog(syslog.LOG_ERR,"log dispatch err:"+str(traceback.format_exc()))
             continue
     
             
             
             
Ejemplo n.º 2
0
 def setup_logging(self):
     """
 Set up Pythons logger for this environment
 """
     LogFactory.from_config(default_path=self.config["logging_config"])
Ejemplo n.º 3
0
 def setup_logging(self):
     '''
 Set up Pythons logger for this environment
 '''
     LogFactory.from_config(default_path=self.config["logging_config"])