From 498164fa45309bd314ff2fcc282b140edf72bc22 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 24 Jul 2017 17:48:47 +0530 Subject: 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 Backport from master https://review.gluster.org/#/c/16911/ Change-Id: I5fbf2c3eedd9eb128fb3f851dd67b2f4081c8bba Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: https://review.gluster.org/17928 CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- glusterfsd/src/glusterfsd.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'glusterfsd/src/glusterfsd.c') 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); -- cgit