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