Move cache event logs to their own logger

On high traffic systems, the cache event logs can be very high
volume and also not very useful.  Similar to how we put zuul
connection io traffic in its own logger so that folks can filter
it out, let's move the cache event log messages to their own.

Eventually we should probably remove this log line entirely, but
since the cache is new, we may yet need to debug basic functionality,
so putting it in its own logger lets us turn it on and off easily.

Change-Id: Ice382748a0b21a7e73bb0d2b3461761a8d7871da
This commit is contained in:
James E. Blair 2023-05-12 08:16:25 -07:00
parent 66b36ce0de
commit 4e3690812b

View File

@ -735,6 +735,7 @@ class NodepoolTreeCache(abc.ABC):
'''
log = logging.getLogger("nodepool.zk.ZooKeeper")
event_log = logging.getLogger("nodepool.zk.cache.event")
def __init__(self, zk, root):
self.zk = zk
@ -832,7 +833,7 @@ class NodepoolTreeCache(abc.ABC):
self._cacheListener(event)
def _handleCacheEvent(self, event):
self.log.debug("Cache event %s", event)
self.event_log.debug("Cache event %s", event)
data, stat = None, None
# The cache is being (re-)initialized. Since this happens out