From 4e5f6fd588bf8342264b96b2a37cc75bb654f386 Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Fri, 3 Nov 2017 15:40:29 +0100 Subject: [PATCH] Reduce swiftclient logging When zaqar is not in debug, set swiftclient logging to WARNING, to remove spurious INFO logs containing 404, which can happen quite often when dealing with lazily created subscription containers. Change-Id: I01c84887a5ddcb76bb36f01fb8f52625decd7be1 --- zaqar/storage/swift/driver.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zaqar/storage/swift/driver.py b/zaqar/storage/swift/driver.py index 4b862b14c..4fa7b9a32 100644 --- a/zaqar/storage/swift/driver.py +++ b/zaqar/storage/swift/driver.py @@ -11,12 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging from osprofiler import profiler from six.moves import urllib from keystoneauth1.identity import generic from keystoneauth1 import session as keystone_session -from oslo_log import log as logging +from oslo_log import log as oslo_logging import swiftclient from zaqar.common import decorators @@ -24,7 +25,7 @@ from zaqar import storage from zaqar.storage.swift import controllers from zaqar.storage.swift import options -LOG = logging.getLogger(__name__) +LOG = oslo_logging.getLogger(__name__) class DataDriver(storage.DataDriverBase): @@ -34,6 +35,9 @@ class DataDriver(storage.DataDriverBase): def __init__(self, conf, cache, control_driver): super(DataDriver, self).__init__(conf, cache, control_driver) self.swift_conf = self.conf[options.MESSAGE_SWIFT_GROUP] + if not self.conf.debug: + # Reduce swiftclient logging, in particular to remove 404s + logging.getLogger("swiftclient").setLevel(logging.WARNING) @property def capabilities(self):