From 2dbdee29736fcbf0fe1d41c306959b22d05f72b0 Mon Sep 17 00:00:00 2001 From: "Gao,Yan" Date: Mon, 30 Apr 2018 18:02:04 +0200 Subject: [PATCH] Log: upgrade important messages and downgrade unimportant ones It also fixes a message that's supposed to be "quorum.two_node not present in cmap". --- src/sbd-cluster.c | 11 ++++++----- src/sbd-common.c | 4 ++-- src/sbd-inquisitor.c | 6 +++--- src/sbd-md.c | 6 +++--- src/sbd-pacemaker.c | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/sbd-cluster.c b/src/sbd-cluster.c index ae4750e..c7328af 100644 --- a/src/sbd-cluster.c +++ b/src/sbd-cluster.c @@ -201,10 +201,11 @@ sbd_get_two_node(void) } if (cmap_get_uint8(cmap_handle, "quorum.two_node", &two_node_u8) == CS_OK) { - cl_log(LOG_NOTICE, "Corosync is%s in 2Node-mode", two_node_u8?"":" not"); + cl_log(two_node_u8? LOG_NOTICE : LOG_INFO, + "Corosync is%s in 2Node-mode", two_node_u8?"":" not"); two_node = two_node_u8; } else { - cl_log(LOG_NOTICE, "quorum.two_node present in cmap\n"); + cl_log(LOG_INFO, "quorum.two_node not present in cmap\n"); } return TRUE; @@ -264,7 +265,7 @@ sbd_membership_connect(void) { bool connected = false; - cl_log(LOG_NOTICE, "Attempting cluster connection"); + cl_log(LOG_INFO, "Attempting cluster connection"); cluster.destroy = sbd_membership_destroy; @@ -308,7 +309,7 @@ sbd_membership_connect(void) } } - set_servant_health(pcmk_health_transient, LOG_NOTICE, "Connected, waiting for initial membership"); + set_servant_health(pcmk_health_transient, LOG_INFO, "Connected, waiting for initial membership"); notify_parent(); notify_timer_cb(NULL); @@ -530,7 +531,7 @@ servant_cluster(const char *diskname, int mode, const void* argp) enum cluster_type_e cluster_stack = get_cluster_type(); crm_system_name = strdup("sbd:cluster"); - cl_log(LOG_INFO, "Monitoring %s cluster health", name_for_cluster_type(cluster_stack)); + cl_log(LOG_NOTICE, "Monitoring %s cluster health", name_for_cluster_type(cluster_stack)); set_proc_title("sbd: watcher: Cluster"); sbd_membership_connect(); diff --git a/src/sbd-common.c b/src/sbd-common.c index f22c4f2..0ce6478 100644 --- a/src/sbd-common.c +++ b/src/sbd-common.c @@ -893,7 +893,7 @@ notify_parent(void) case pcmk_health_pending: case pcmk_health_shutdown: case pcmk_health_transient: - DBGLOG(LOG_INFO, "Not notifying parent: state transient (%d)", servant_health); + DBGLOG(LOG_DEBUG, "Not notifying parent: state transient (%d)", servant_health); break; case pcmk_health_unknown: @@ -904,7 +904,7 @@ notify_parent(void) break; case pcmk_health_online: - DBGLOG(LOG_INFO, "Notifying parent: healthy"); + DBGLOG(LOG_DEBUG, "Notifying parent: healthy"); sigqueue(ppid, SIG_LIVENESS, signal_value); break; diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c index 237bf43..90c7d26 100644 --- a/src/sbd-inquisitor.c +++ b/src/sbd-inquisitor.c @@ -64,7 +64,7 @@ void recruit_servant(const char *devname, pid_t pid) servant_count++; if(sbd_is_disk(newbie)) { - cl_log(LOG_NOTICE, "Monitoring %s", devname); + cl_log(LOG_INFO, "Monitoring %s", devname); disk_count++; } else { newbie->outdated = 1; @@ -565,7 +565,7 @@ void inquisitor_child(void) if(cluster_alive(true)) { /* We LIVE! */ if(cluster_appeared == false) { - cl_log(LOG_NOTICE, "Active cluster detected"); + cl_log(LOG_INFO, "Active cluster detected"); } tickle = 1; can_detach = 1; @@ -574,7 +574,7 @@ void inquisitor_child(void) } else if(cluster_alive(false)) { if(!decoupled) { /* On the way up, detach and arm the watchdog */ - cl_log(LOG_NOTICE, "Partial cluster detected, detaching"); + cl_log(LOG_INFO, "Partial cluster detected, detaching"); } can_detach = 1; diff --git a/src/sbd-md.c b/src/sbd-md.c index 6a964dd..6f152c4 100644 --- a/src/sbd-md.c +++ b/src/sbd-md.c @@ -1097,7 +1097,7 @@ int servant(const char *diskname, int mode, const void* argp) exit(EXIT_MD_IO_FAIL); } - DBGLOG(LOG_INFO, "Monitoring slot %d on disk %s", mbox, diskname); + cl_log(LOG_NOTICE, "Monitoring slot %d on disk %s", mbox, diskname); if (s_header->minor_version == 0) { set_proc_title("sbd: watcher: %s - slot: %d", diskname, mbox); } else { @@ -1180,7 +1180,7 @@ int servant(const char *diskname, int mode, const void* argp) } if (s_mbox->cmd > 0) { - cl_log(LOG_INFO, + cl_log(LOG_NOTICE, "Received command %s from %s on disk %s", char2cmd(s_mbox->cmd), s_mbox->from, diskname); @@ -1222,7 +1222,7 @@ int servant(const char *diskname, int mode, const void* argp) (int)latency, (int)timeout_watchdog_warn, diskname); } else if (debug) { - DBGLOG(LOG_INFO, "Latency: %d on disk %s", (int)latency, + DBGLOG(LOG_DEBUG, "Latency: %d on disk %s", (int)latency, diskname); } } diff --git a/src/sbd-pacemaker.c b/src/sbd-pacemaker.c index 2f06109..a435d01 100644 --- a/src/sbd-pacemaker.c +++ b/src/sbd-pacemaker.c @@ -416,7 +416,7 @@ servant_pcmk(const char *diskname, int mode, const void* argp) int exit_code = 0; crm_system_name = strdup("sbd:pcmk"); - cl_log(LOG_INFO, "Monitoring Pacemaker health"); + cl_log(LOG_NOTICE, "Monitoring Pacemaker health"); set_proc_title("sbd: watcher: Pacemaker"); setenv("PCMK_watchdog", "true", 1); -- 1.8.3.1