]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/LogMonitor: add mon_cluster_log_to_stderr 19849/head
authorSage Weil <sage@redhat.com>
Thu, 7 Dec 2017 22:40:04 +0000 (16:40 -0600)
committerSage Weil <sage@redhat.com>
Mon, 8 Jan 2018 22:39:24 +0000 (16:39 -0600)
Optionally send cluster log messages to stderr (prefixed by the
channel).

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 49b327e8657695a359ea63e427b5de2e4525f480)

src/common/options.cc
src/mon/LogMonitor.cc

index b47300a4fb6a61689b7d80c31c2556700ae46f30..edeca57f914afc4038b309cb40a06d08268c445b 100644 (file)
@@ -405,6 +405,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 b52767f9bceb8563dda0a866a16c568e8b623653..178f78589df5fb80c74becba716dd72b6f976689 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);