make logformat more similar to oslo
make the logformat actually match what we're used to reading in
the other logs, especially including the levels.
Because the logging fixture doesn't include the oslo logging
context processor, we are limited in what we can do here. A good
follow on would be to make a fixture which does understand oslo
logging processing so we could get request_id in the logs.
Change-Id: Ibb95aebd2df714fae331df13ad7789d6341af265
diff --git a/tempest/test.py b/tempest/test.py
index 748a98c..cbf3c9c 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -256,6 +256,12 @@
network_resources = {}
+ # NOTE(sdague): log_format is defined inline here instead of using the oslo
+ # default because going through the config path recouples config to the
+ # stress tests too early, and depending on testr order will fail unit tests
+ log_format = ('%(asctime)s %(process)d %(levelname)-8s '
+ '[%(name)s] %(message)s')
+
@classmethod
def setUpClass(cls):
if hasattr(super(BaseTestCase, cls), 'setUpClass'):
@@ -293,9 +299,8 @@
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
if (os.environ.get('OS_LOG_CAPTURE') != 'False' and
os.environ.get('OS_LOG_CAPTURE') != '0'):
- log_format = '%(asctime)-15s %(message)s'
self.useFixture(fixtures.LoggerFixture(nuke_handlers=False,
- format=log_format,
+ format=self.log_format,
level=None))
@classmethod