本文整理汇总了Python中syslog.LOG_LOCAL0属性的典型用法代码示例。如果您正苦于以下问题:Python syslog.LOG_LOCAL0属性的具体用法?Python syslog.LOG_LOCAL0怎么用?Python syslog.LOG_LOCAL0使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类syslog
的用法示例。
在下文中一共展示了syslog.LOG_LOCAL0属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadAll
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import LOG_LOCAL0 [as 别名]
def loadAll(self):
self.loadError = False
self.loadAttempt += 1
self.loadConfig()
self.loadScanServers()
self.loadDispositionModes()
self.loadHeaderOptions()
#Allow config file to reload itself. If a new config file gets written, it may be unreadable while the new file is written to disk. Sleep 1 sec and try again when file write is complete.
if ((self.loadError) and (self.loadAttempt <= self.maxLoadAttempts)):
log = "Error loading Config File from loadAll, trying again"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
time.sleep(1)
self.loadAll()
elif ((self.loadError) and (self.loadAttempt > self.maxLoadAttempts)):
log = "Error loading Config File from loadAll, using Defaults"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
示例2: loadDispositionModes
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import LOG_LOCAL0 [as 别名]
def loadDispositionModes(self):
Config = ConfigParser.ConfigParser()
try:
Config.read(self.configFileLoc)
DispositionModes = Config.items('DispositionMode')
for DispositionMode in DispositionModes:
self.dispositionModes[DispositionMode[0]] = self._convertDispositionMode(DispositionMode[1])
except ConfigParser.NoSectionError:
if (self.loadAttempt >= self.maxLoadAttempts):
log = "Error loading Config File for DispositionMode config, USING DEFAULTS"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
else:
self.loadError = True
log = "Error loading Config File for DispositionMode config, should try again"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
示例3: loadScanServers
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import LOG_LOCAL0 [as 别名]
def loadScanServers(self):
Config = ConfigParser.ConfigParser()
try:
Config.read(self.configFileLoc)
servers = Config.items('ScanServers')
for server in servers:
self.servers.append(server[1])
except ConfigParser.NoSectionError:
if (self.loadAttempt >= self.maxLoadAttempts):
log = "Error loading Config File for ScanServers config, USING DEFAULTS"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
else:
self.loadError = True
log = "Error loading Config File for ScanServers config, should try again"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
示例4: loadConfig
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import LOG_LOCAL0 [as 别名]
def loadConfig(self):
Config = ConfigParser.ConfigParser()
try:
Config.read(self.configFileLoc)
self.socketname = Config.get('COMMON', 'socketname')
self.milterName = Config.get('COMMON', 'MilterName')
self.milterInstance = Config.get('COMMON', 'MilterInstance')
self.mode = Config.get('COMMON', 'mode')
self.zmqMaxRetry = int(Config.get('COMMON', 'zmqMaxRetry'))
self.zmqTimeout = int(Config.get('COMMON', 'zmqTimeout'))
self.maxFiles = int(Config.get('COMMON', 'maxFiles'))
self.heloWhitelist = str(Config.get('COMMON', 'helowhitelist'))
self.storeEmails = self._convertTrueFalse(Config.get('ArchiveOptions', 'storeEmails'))
self.storeDir = Config.get('ArchiveOptions', 'storeDir')
self.customFolderDateFormat = Config.get('ArchiveOptions', 'customFolderDateFormat')
except ConfigParser.NoSectionError:
if (self.loadAttempt >= self.maxLoadAttempts):
log = "Error loading Config File for COMMON config, USING DEFAULTS"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
else:
self.loadError = True
log = "Error loading Config File for COMMON config, should try again"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
示例5: loadHeaderOptions
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import LOG_LOCAL0 [as 别名]
def loadHeaderOptions(self):
Config = ConfigParser.ConfigParser()
try:
Config.read(self.configFileLoc)
self.ApplyCustomHeaders = self._convertTrueFalse(Config.get('HeaderOptions', 'ApplyCustomHeaders'))
self.CustomHeaderBase = Config.get('HeaderOptions', 'CustomHeaderBase')
self.ApplyMailscanResultHeader = self._convertTrueFalse(Config.get('HeaderOptions', 'ApplyMailscanResultHeader'))
self.MailscanResultHeaderString = Config.get('HeaderOptions', 'MailscanResultHeaderString')
except ConfigParser.NoSectionError:
if (self.loadAttempt >= self.maxLoadAttempts):
log = "Error loading Config File for HeaderOptions config, USING DEFAULTS"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
else:
self.loadError = True
log = "Error loading Config File for HeaderOptions config, should try again"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
except ConfigParser.NoOptionError:
if (self.loadAttempt >= self.maxLoadAttempts):
log = "Error loading Config File for HeaderOptions config, USING DEFAULTS"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))
else:
self.loadError = True
log = "Error loading Config File for HeaderOptions config, should try again"
logger = log2syslog(self.milterName, syslog.LOG_LOCAL0)
logger.writeLog(syslog.LOG_ERR, "%s"%(str(log)))