summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2017-08-01 08:04:48 -0400
committerShyamsundar Ranganathan <srangana@redhat.com>2017-08-03 12:03:18 +0000
commitf68887999e89d894c3125e3b26517221ad1543fc (patch)
tree36a9371653aaa939d2781735103182fd6081387b /xlators/mgmt/glusterd/src/glusterd-volgen.c
parentc7e5741f938e24b85976bf78ea7d84984a4e1e61 (diff)
logging: localtime logging, cmdline, volume set option
Despite the fact that appliances generally use UTC, some users really want log entries in localtime. fixes gluster/glusterfs#272 feature page: https://review.gluster.org/17807 Change-Id: I5fbf2c3eedd9eb128fb3f851dd67b2f4081c8bba Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: https://review.gluster.org/16911 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 1ada723..d82e0f1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1310,6 +1310,25 @@ log_format_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
}
static int
+log_localtime_logging_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
+ void *param)
+{
+ char *role = NULL;
+ struct volopt_map_entry vme2 = {0,};
+
+ role = (char *) param;
+
+ if (strcmp (vme->option, "!cluster.localtime-logging") != 0 ||
+ !strstr (vme->key, role))
+ return 0;
+
+ memcpy (&vme2, vme, sizeof (vme2));
+ vme2.option = GLUSTERD_LOCALTIME_LOGGING_KEY;
+
+ return basic_option_handler (graph, &vme2, NULL);
+}
+
+static int
log_buf_size_option_handler (volgen_graph_t *graph,
struct volopt_map_entry *vme,
void *param)
@@ -1414,6 +1433,9 @@ server_spec_option_handler (volgen_graph_t *graph,
if (!ret)
ret = log_flush_timeout_option_handler (graph, vme, "brick");
+ if (!ret)
+ ret = log_localtime_logging_option_handler (graph, vme, "brick");
+
return ret;
}
@@ -3974,6 +3996,14 @@ graph_set_generic_options (xlator_t *this, volgen_graph_t *graph,
GD_MSG_GRAPH_SET_OPT_FAIL,
"Failed to change "
"log-flush-timeout option");
+
+ ret = volgen_graph_set_options_generic (graph, set_dict, "client",
+ &log_localtime_logging_option_handler);
+ if (ret)
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ GD_MSG_GRAPH_SET_OPT_FAIL,
+ "Failed to change "
+ "log-localtime-logging option");
return 0;
}