def __init__(self, directory, server, key, extentions): """ Initialization of a log Collection agent @param directory: path to the directory containing files log to send and watch @param server: address of a collection server where to send logs @param AgentKey: @param AgentCertificat: """ self.server = urljoin('https://%s' % server, 'send/%s' % key) self.http = httplib2.Http(disable_ssl_certificate_validation=True) if extentions: extentions = ['' if x=='noext' else x for x in extentions] self.lw = LogWatcher(directory,self.sendLine, extentions) signal.signal(signal.SIGTERM, self._exitHandler) self.exit = False