def __init__(self): try: self.logs = logsys.LogSys() except: pass try: self.credis = conn_redis.CRedis() except Exception, e: self.logs.writelog(str(e))
#/usr/bin/python #coding=utf-8 ''' 将status数据写入数据库 ''' import dealwith_http_log import lib.read_ini as read_ini import logsys log = logsys.LogSys() def __setconf(confpath, kind): readcf = read_ini.config(dealwith_http_log.INIFILE) try: everypath = readcf.getvalue(confpath, kind) except Exception, e: errstr = "getpath Error!<__setconf>" + str(e) log.writelog(errstr) return everypath def nginxpost(strs, nums=20): # 将改为从数据库读取数据,目前的写法仅用做调试使用,因此处理大文件会稍微慢一些 try: datetime = strs.split('&')[0].split('=')[1] except Exception, e: errstr = "datatime Error!<nginxpost>" + str(e) log.writelog(errstr) #datetime = strs
def __init__(self, sect, key): self.sect = sect self.key = key self.cf = read_ini.config() self.logs = logsys.LogSys() pass