Browse Source

Adjust io-level logging in gerrit/git drivers

Currently the logging for polling is verbose.  Adjust it as follows:

* In the git driver, don't list every ref we see, just log the count
  so we know it's working.
* In the gerrit driver, move logging of some HTTP traffic to the
  "io" logger.
* In the default logging configuration for the server, if the '-d'
  option is given, do not include "io" logging.  The only way to
  get this extremely verbose data is now with a custom logging
  config.

Change-Id: If0d5877f65296ee2a9f7f0298f8bc6664e6c2a4c
changes/28/707728/1
James E. Blair 3 days ago
parent
commit
1e04bdb4aa
3 changed files with 8 additions and 3 deletions
  1. +4
    -0
      zuul/ansible/logconfig.py
  2. +2
    -2
      zuul/driver/gerrit/gerritconnection.py
  3. +2
    -1
      zuul/driver/git/gitwatcher.py

+ 4
- 0
zuul/ansible/logconfig.py View File

@@ -90,6 +90,10 @@ _DEFAULT_SERVER_LOGGING_CONFIG = {
'handlers': ['console'],
'level': 'INFO',
},
'zuul.GerritConnection.io': {
'handlers': ['console'],
'level': 'WARN',
},
'sqlalchemy.engine': {
'handlers': ['console'],
'level': 'WARN',

+ 2
- 2
zuul/driver/gerrit/gerritconnection.py View File

@@ -612,7 +612,7 @@ class GerritConnection(BaseConnection):
verify=self.verify_ssl,
auth=self.auth, timeout=TIMEOUT,
headers={'User-Agent': self.user_agent})
self.log.debug('Received: %s %s' % (r.status_code, r.text,))
self.iolog.debug('Received: %s %s' % (r.status_code, r.text,))
if r.status_code != 200:
raise Exception("Received response %s" % (r.status_code,))
ret = None
@@ -636,7 +636,7 @@ class GerritConnection(BaseConnection):
auth=self.auth, timeout=TIMEOUT,
headers={'Content-Type': 'application/json;charset=UTF-8',
'User-Agent': self.user_agent})
self.log.debug('Received: %s %s' % (r.status_code, r.text,))
self.iolog.debug('Received: %s %s' % (r.status_code, r.text,))
if r.status_code != 200:
raise Exception("Received response %s" % (r.status_code,))
ret = None

+ 2
- 1
zuul/driver/git/gitwatcher.py View File

@@ -116,7 +116,8 @@ class GitWatcher(threading.Thread):
try:
for project in self.connection.projects:
refs = self.lsRemote(project)
self.log.debug("Read refs %s for project %s" % (refs, project))
self.log.debug("Read %s refs for project %s",
len(refs), project)
if not self.projects_refs.get(project):
# State for this project does not exist yet so add it.
# No event will be triggered in this loop as

Loading…
Cancel
Save