summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2018-07-02 20:48:22 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-07-03 14:29:33 +0000
commit524c869976c837c2ef13b5ef50020e7769188e4d (patch)
tree5e8e3e39e2735855861eff7074326926de0afa2c /xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
parent362762b35635b6fb5cbd7c394c63c08973ec3993 (diff)
glusterd: Introduce daemon-log-level cluster wide option
This option, applicable to the node level daemons can be very helpful in controlling the log level of these services. Please note any daemon which is started prior to setting the specific value of this option (if not INFO) will need to go through a restart to have this change into effect. Change-Id: I7f6d2620bab2b094c737f5cc816bc093e9c9c4c9 fixes: bz#1597473 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
index ba948b4c6f6..ebb288c7191 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
@@ -151,6 +151,8 @@ glusterd_svc_start (glusterd_svc_t *svc, int flags, dict_t *cmdline)
xlator_t *this = NULL;
char valgrind_logfile[PATH_MAX] = {0};
char *localtime_logging = NULL;
+ char *log_level = NULL;
+ char daemon_log_level[30] = {0};
this = THIS;
GF_ASSERT (this);
@@ -196,6 +198,12 @@ glusterd_svc_start (glusterd_svc_t *svc, int flags, dict_t *cmdline)
if (strcmp (localtime_logging, "enable") == 0)
runner_add_arg (&runner, "--localtime-logging");
}
+ if (dict_get_str (priv->opts, GLUSTERD_DAEMON_LOG_LEVEL_KEY,
+ &log_level) == 0) {
+ snprintf (daemon_log_level, 30, "--log-level=%s", log_level);
+ runner_add_arg (&runner, daemon_log_level);
+ }
+
if (cmdline)
dict_foreach (cmdline, svc_add_args, (void *) &runner);