From: Sage Weil Date: Thu, 7 Oct 2010 14:52:02 +0000 (-0700) Subject: debug: always append to log X-Git-Tag: v0.22~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2bcb419c403a190329bf2e94cf10c217217ca01;p=ceph.git debug: always append to log 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 --- diff --git a/src/common/debug.cc b/src/common/debug.cc index 4c06a469349d..fa0c407bf970 100644 --- a/src/common/debug.cc +++ b/src/common/debug.cc @@ -152,8 +152,7 @@ void _dout_open_log() } _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; @@ -161,8 +160,7 @@ void _dout_open_log() _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;