ctdb-logging: Really make NOTICE the default debug level
authorMartin Schwenke <mschwenke@ddn.com>
Fri, 10 Feb 2023 06:57:13 +0000 (17:57 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 10 Jul 2023 14:21:30 +0000 (14:21 +0000)
NOTICE level debug messages in common/run_event.c are not logged by
default.

Currently eventd ends up using ERROR, since this is specified as
LOGGING_LOG_LEVEL_DEFAULT.  It doesn't inherit the debug level from
ctdbd and only uses NOTICE level when interactive.

Change the real logging default to NOTICE and use it everywhere.

Followups might be:

* Remove the default_log_level argument to logging_conf_init()
* Kick eventd to update debug level when "ctdb setdebug" is used

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/logging_conf.c
ctdb/server/ctdb_config.c
ctdb/tests/UNIT/cunit/config_test_001.sh
ctdb/tests/UNIT/cunit/config_test_002.sh

index 1cd929eb533dd4f91050ec4415241d2871b547d7..38b3003a3f7a8c1106c2c7ec20a64d0a3a1b9454 100644 (file)
@@ -26,7 +26,7 @@
 #include "common/logging_conf.h"
 
 #define LOGGING_LOCATION_DEFAULT       "file:" LOGDIR "/log.ctdb"
-#define LOGGING_LOG_LEVEL_DEFAULT      "ERROR"
+#define LOGGING_LOG_LEVEL_DEFAULT      "NOTICE"
 
 static bool logging_conf_validate_log_level(const char *key,
                                            const char *old_loglevel,
index 72830278c4299fa0b95374792b28f7da99a6cbfa..3f61fdae169e63364c5cb52bfe5b5cad8f3acad8 100644 (file)
@@ -145,7 +145,7 @@ int ctdbd_config_load(TALLOC_CTX *mem_ctx,
                return ret;
        }
 
-       logging_conf_init(conf, "NOTICE");
+       logging_conf_init(conf, NULL);
        cluster_conf_init(conf);
        database_conf_init(conf);
        event_conf_init(conf);
index 5dd4581996864f9d194098a1785c49de715fcb93..70bf77f7939e089c664fe305cd8e2e2aa55af81c 100755 (executable)
@@ -30,7 +30,7 @@ database_state_dbdir=$(ctdb-config get \
 ok <<EOF
 [logging]
        # location = ${logging_location}
-       # log level = ERROR
+       # log level = NOTICE
 [cluster]
        # transport = tcp
        # node address = 
index ad6d381d4ed09d1b82aa91d5f3849af2e624fabd..23b0863b4b8659ff688881ee36dd40937834516d 100755 (executable)
@@ -19,7 +19,7 @@ cat > "$conffile" <<EOF
 EOF
 
 ok <<EOF
-ERROR
+NOTICE
 EOF
 unit_test ctdb-config get "logging" "log level"