]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/LogMonitor: add mon_cluster_log_to_stderr 19385/head
authorSage Weil <sage@redhat.com>
Thu, 7 Dec 2017 22:40:04 +0000 (16:40 -0600)
committerSage Weil <sage@redhat.com>
Tue, 12 Dec 2017 15:09:28 +0000 (09:09 -0600)
Optionally send cluster log messages to stderr (prefixed by the
channel).

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/options.cc
src/mon/LogMonitor.cc

index 91f48dcee2bb73202ccd82335cc87af763128f11..d1b1e4fc6e9704e65fd3192d8f6a212f19a02605 100644 (file)
@@ -430,6 +430,10 @@ std::vector<Option> get_global_options() {
     .set_default("12201")
     .set_description(""),
 
+    Option("mon_cluster_log_to_stderr", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("Send cluster log messages to stderr (prefixed by channel)"),
+
     Option("mon_cluster_log_to_syslog", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("default=false")
     .set_description(""),
index 9c9541933bca972f32d31de577ebe5737cbcc225..ffd50ba5050d6f7cfd54d3efbf73c231c443ce8d 100644 (file)
@@ -116,6 +116,10 @@ void LogMonitor::update_from_paxos(bool *need_bootstrap)
       if (channel.empty()) // keep retrocompatibility
         channel = CLOG_CHANNEL_CLUSTER;
 
+      if (g_conf->get_val<bool>("mon_cluster_log_to_stderr")) {
+       cerr << channel << " " << le << std::endl;
+      }
+
       if (channels.do_log_to_syslog(channel)) {
         string level = channels.get_level(channel);
         string facility = channels.get_facility(channel);