Sometime it is important and useful to see the logs from the bootstrap
phase where we are getting the initial configs from the monitors. Add
a command-line option --log-early to do that.
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit
933d5084cb66f299a7bf60f0a2a6382c0bd3cb2f)
else if (ceph_argparse_flag(args, i, "--no-mon-config", (char*)NULL)) {
values.no_mon_config = true;
}
+ else if (ceph_argparse_flag(args, i, "--log-early", (char*)NULL)) {
+ values.log_early = true;
+ }
else if (ceph_argparse_flag(args, i, "--mon-config", (char*)NULL)) {
values.no_mon_config = false;
}
string cluster;
ceph::logging::SubsystemMap subsys;
bool no_mon_config = false;
+ bool log_early = false;
// Set of configuration options that have changed since the last
// apply_changes
using changed_set_t = std::set<std::string>;
// command line (as passed by caller)
conf.parse_argv(args);
+ if (conf->log_early &&
+ !cct->_log->is_started()) {
+ cct->_log->start();
+ }
+
if (!conf->no_mon_config) {
// make sure our mini-session gets legacy values
conf.apply_changes(nullptr);
_exit(1);
}
}
- cct->_log->start();
+ if (!cct->_log->is_started()) {
+ cct->_log->start();
+ }
+
// do the --show-config[-val], if present in argv
conf.do_argv_commands();
{
int ret;
+ if (cct->_conf->log_early &&
+ !cct->_log->is_started()) {
+ cct->_log->start();
+ }
+
{
MonClient mc_bootstrap(cct);
ret = mc_bootstrap.get_monmap_and_config();
return -EISCONN;
state = CONNECTING;
+ if (cct->_conf->log_early &&
+ !cct->_log->is_started()) {
+ cct->_log->start();
+ }
+
{
MonClient mc_bootstrap(cct);
err = mc_bootstrap.get_monmap_and_config();