We were truncating if we were in log_per_instance mode. But normally those
logs don't exist. And if they do, we probably don't want to truncate
them. This is particularly true if we respawn ourselves (e.g. after being
marked down) and restart with the same pid.
Signed-off-by: Sage Weil <sage@newdream.net>
}
_dout_out.close();
- // only truncate if log_per_instance is set.
- _dout_out.open(_dout_path, g_conf.log_per_instance ? (ios::trunc | ios::out) : (ios::out | ios::app));
+ _dout_out.open(_dout_path, ios::out | ios::app);
if (!_dout_out.is_open()) {
std::cerr << "error opening output file " << _dout_path << std::endl;
_dout = &std::cout;
_dout_need_open = false;
_dout_is_open = true;
_dout = &_dout_out;
- *_dout << g_clock.now() << " --- " << getpid()
- << (g_conf.log_per_instance ? " created new log " : " appending to log ")
+ *_dout << g_clock.now() << " --- " << getpid() << " opened log "
<< _dout_path << " ---" << std::endl;
}
*_dout << "ceph version " << VERSION << " (" << STRINGIFY(CEPH_GIT_VER) << ")" << std::endl;