From 29e6f8c5a49741d9e00cfb606974ce78350d9fc0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 29 May 2012 12:10:22 -0700 Subject: [PATCH] log: add log flush, dump_recent, reopen admin socket commands Signed-off-by: Sage Weil --- src/common/ceph_context.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 9287aa6102e14..d0ecc3ee54df4 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -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 : 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; -- 2.39.5