From 51d0445a7d7401699cf65d648ef007814258fb54 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 10 Feb 2023 17:57:13 +1100 Subject: [PATCH] ctdb-logging: Really make NOTICE the default debug level 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 Reviewed-by: Amitay Isaacs --- ctdb/common/logging_conf.c | 2 +- ctdb/server/ctdb_config.c | 2 +- ctdb/tests/UNIT/cunit/config_test_001.sh | 2 +- ctdb/tests/UNIT/cunit/config_test_002.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ctdb/common/logging_conf.c b/ctdb/common/logging_conf.c index 1cd929eb533..38b3003a3f7 100644 --- a/ctdb/common/logging_conf.c +++ b/ctdb/common/logging_conf.c @@ -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, diff --git a/ctdb/server/ctdb_config.c b/ctdb/server/ctdb_config.c index 72830278c42..3f61fdae169 100644 --- a/ctdb/server/ctdb_config.c +++ b/ctdb/server/ctdb_config.c @@ -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); diff --git a/ctdb/tests/UNIT/cunit/config_test_001.sh b/ctdb/tests/UNIT/cunit/config_test_001.sh index 5dd45819968..70bf77f7939 100755 --- a/ctdb/tests/UNIT/cunit/config_test_001.sh +++ b/ctdb/tests/UNIT/cunit/config_test_001.sh @@ -30,7 +30,7 @@ database_state_dbdir=$(ctdb-config get \ ok < "$conffile" <