]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
log: add log flush, dump_recent, reopen admin socket commands
authorSage Weil <sage@inktank.com>
Tue, 29 May 2012 19:10:22 +0000 (12:10 -0700)
committerSage Weil <sage@inktank.com>
Tue, 29 May 2012 23:31:39 +0000 (16:31 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/ceph_context.cc

index 9287aa6102e1436ae585170acce7debb1968407e..d0ecc3ee54df47ca980170cec73667635e83a0d8 100644 (file)
@@ -196,6 +196,15 @@ void CephContext::do_command(std::string command, bufferlist *out)
       out->append(ss.str());
     }
   }
+  else if (command == "log_flush") {
+    _log->flush();
+  }
+  else if (command == "log_dump_recent") {
+    _log->dump_recent();
+  }
+  else if (command == "log_reopen") {
+    _log->reopen_log_file();
+  }
   else {
     assert(0 == "registered under wrong command?");    
   }
@@ -233,6 +242,9 @@ CephContext::CephContext(uint32_t module_type_)
   _admin_socket->register_command("2", _admin_hook, "");
   _admin_socket->register_command("show_config", _admin_hook, "dump current config settings");
   _admin_socket->register_command("set_config", _admin_hook, "set_config <field> <val>: set a config settings");
+  _admin_socket->register_command("log_flush", _admin_hook, "flush log entries to log file");
+  _admin_socket->register_command("log_dump_recent", _admin_hook, "dump recent log entries to log file");
+  _admin_socket->register_command("log_reopen", _admin_hook, "reopen log file");
 }
 
 CephContext::~CephContext()
@@ -245,6 +257,9 @@ CephContext::~CephContext()
   _admin_socket->unregister_command("2");
   _admin_socket->unregister_command("show_config");
   _admin_socket->unregister_command("set_config");
+  _admin_socket->unregister_command("log_flush");
+  _admin_socket->unregister_command("log_dump_recent");
+  _admin_socket->unregister_command("log_reopen");
   delete _admin_hook;
 
   delete _heartbeat_map;