summaryrefslogtreecommitdiffstats
path: root/glusterfsd
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 /glusterfsd
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 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c8
-rw-r--r--glusterfsd/src/glusterfsd.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 204c617be6c..ebf58706107 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -240,6 +240,8 @@ static struct argp_option gf_options[] = {
" [default: \"yes\"]"},
{"secure-mgmt", ARGP_SECURE_MGMT_KEY, "BOOL", OPTION_ARG_OPTIONAL,
"Override default for secure (SSL) management connections"},
+ {"localtime-logging", ARGP_LOCALTIME_LOGGING_KEY, 0, 0,
+ "Enable localtime logging"},
{0, 0, 0, 0, "Miscellaneous Options:"},
{0, }
};
@@ -1271,6 +1273,10 @@ no_oom_api:
argp_failure (state, -1, 0,
"unknown secure-mgmt setting \"%s\"", arg);
break;
+
+ case ARGP_LOCALTIME_LOGGING_KEY:
+ cmd_args->localtime_logging = 1;
+ break;
}
return 0;
@@ -1635,6 +1641,8 @@ logging_init (glusterfs_ctx_t *ctx, const char *progpath)
/* finish log set parameters before init */
gf_log_set_loglevel (cmd_args->log_level);
+ gf_log_set_localtime (cmd_args->localtime_logging);
+
gf_log_set_logger (cmd_args->logger);
gf_log_set_logformat (cmd_args->log_format);
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index 3461d6d01f0..c1d5dc08405 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -96,6 +96,7 @@ enum argp_option_keys {
#ifdef GF_LINUX_HOST_OS
ARGP_OOM_SCORE_ADJ_KEY = 176,
#endif
+ ARGP_LOCALTIME_LOGGING_KEY = 177,
};
struct _gfd_vol_top_priv {