summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <ralonsoh@redhat.com>2022-11-11 10:15:58 +0100
committerRodolfo Alonso <ralonsoh@redhat.com>2022-11-14 16:59:12 +0000
commitde615d9370681a2834cebe88acfa81b919da340c (patch)
tree75f039dcd69fd5030e2a27112047cfad22b86d46
parent94b9dc32ec1f52a582adbd97fe2847f7c87d6c17 (diff)
downloadoslo-log-de615d9370681a2834cebe88acfa81b919da340c.tar.gz
Make the eventlet logging fix execution conditional5.0.2
This patch changes the ``log.setup()`` signature to allow a kwarg that makes the eventlet logging fix conditional. Some libraries that import oslo.log, replace the logging locking handling with its own implementation. For example oslo.privsep replaces the logging handler with its own one [1], that allows the communication between the privileged daemon process and the service importing the library. This local handler clashes with the evenlet logging fix implemented in [2]. [1]https://github.com/openstack/oslo.privsep/blob/1020c6fbf54f93cad9fa36b97bcd9cf75549984a/oslo_privsep/daemon.py#L579 [2]https://review.opendev.org/c/openstack/oslo.log/+/852443 Partial-Bug: #1995514 Related-Bug: #1995091 Change-Id: I4bbcfe7db6d75188e61b9084cb02b2dd2aaa0c76
-rw-r--r--oslo_log/log.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/oslo_log/log.py b/oslo_log/log.py
index 74c9691..945fdc9 100644
--- a/oslo_log/log.py
+++ b/oslo_log/log.py
@@ -281,9 +281,10 @@ def _fix_eventlet_logging():
logging.Handler.createLock = pipe_mutex.pipe_createLock
-def setup(conf, product_name, version='unknown'):
+def setup(conf, product_name, version='unknown', *, fix_eventlet=True):
"""Setup logging for the current application."""
- _fix_eventlet_logging()
+ if fix_eventlet:
+ _fix_eventlet_logging()
if conf.log_config_append:
_load_log_config(conf.log_config_append)
else: