Blame SOURCES/bz1919318-01-remove-unwanted-logging-to-system-log.patch

82c061
From e802f0c419ca3ff12a75045f57ed3ab535ff1c46 Mon Sep 17 00:00:00 2001
82c061
From: Tomas Jelinek <tojeline@redhat.com>
82c061
Date: Thu, 7 Jan 2021 16:33:12 +0100
82c061
Subject: [PATCH] remove unwanted logging to system log
82c061
82c061
In commit 966959ac54d80c4cdeeb0fac40dc7ea60c1a0a82, pcs/app.py got
82c061
imported into pcs/run.py. The intention was to unify running various pcs
82c061
parts (cli, daemon, snmp). This caused logging.basicConfigure() located
82c061
in app.py to be run every time run.py was executed. Due to this, pcs
82c061
daemon was configured to log to stderr. All those stderr logs were
82c061
propagated to system log by systemd / system logger.
82c061
---
82c061
 pcs/app.py | 6 ++----
82c061
 1 file changed, 2 insertions(+), 4 deletions(-)
82c061
82c061
diff --git a/pcs/app.py b/pcs/app.py
82c061
index 4806c2d0..c3de179b 100644
82c061
--- a/pcs/app.py
82c061
+++ b/pcs/app.py
82c061
@@ -111,7 +111,6 @@ def _non_root_run(argv_cmd):
82c061
             sys.exit(exitcode)
82c061
 
82c061
 
82c061
-logging.basicConfig()
82c061
 usefile = False
82c061
 filename = ""
82c061
 
82c061
@@ -227,9 +226,8 @@ def main(argv=None):
82c061
                     ).format(val)
82c061
                 )
82c061
 
82c061
-    logger = logging.getLogger("pcs")
82c061
-    logger.propagate = 0
82c061
-    logger.handlers = []
82c061
+    # initialize logger
82c061
+    logging.getLogger("pcs")
82c061
 
82c061
     if (os.getuid() != 0) and (argv and argv[0] != "help") and not usefile:
82c061
         _non_root_run(argv)
82c061
-- 
82c061
2.26.2
82c061