summaryrefslogtreecommitdiffstats
path: root/xlators/debug/io-stats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-10-04 06:47:35 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-04 07:05:39 -0700
commitf02499e16624f29ac2be5531f1c4c298a12f33a8 (patch)
treeb295ba5c0cbd7c7707c662ba0bd3e8521a14120b /xlators/debug/io-stats
parent408c164d0adf67d0ab636d3f617fc48c896d33a6 (diff)
Add log-level option to command volume set
log-level option to set brick's log-level client-log-level to set client's log-level Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1789 (add log-level options to volume set) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1789
Diffstat (limited to 'xlators/debug/io-stats')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index bf513184025..0fdefd1e201 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -20,6 +20,7 @@
#ifndef _CONFIG_H
#define _CONFIG_H
#include "config.h"
+#include "xlator.h"
#endif
/**
@@ -1549,6 +1550,8 @@ reconfigure (xlator_t *this, dict_t *options)
struct ios_conf *conf = NULL;
char *str = NULL;
int ret = 0;
+ char *log_str = NULL;
+ glusterfs_ctx_t *ctx = NULL;
if (!this || !this->private)
return -1;
@@ -1579,6 +1582,21 @@ reconfigure (xlator_t *this, dict_t *options)
}
conf->measure_latency = ret;
}
+ ctx = glusterfs_ctx_get ();
+ if (!ctx)
+ return -1;
+
+ if (ctx->cmd_args.brick_name)
+ ret = dict_get_str (options, "log-level", &log_str);
+ else
+ ret = dict_get_str (options, "client-log-level", &log_str);
+
+ if (!ret) {
+ if (!is_gf_log_command(this, "trusted.glusterfs*set-log-level", log_str)) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "changing log-level to %s", log_str);
+ }
+ }
return 0;
}
@@ -1737,5 +1755,11 @@ struct volume_options options[] = {
{ .key = { "latency-measurement" },
.type = GF_OPTION_TYPE_BOOL,
},
+ { .key = {"log-level"},
+ .type = GF_OPTION_TYPE_STR,
+ },
+ { .key = {"client-log-level"},
+ .type = GF_OPTION_TYPE_STR,
+ },
{ .key = {NULL} },
};