]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
debug: always append to log
authorSage Weil <sage@newdream.net>
Thu, 7 Oct 2010 14:52:02 +0000 (07:52 -0700)
committerSage Weil <sage@newdream.net>
Thu, 7 Oct 2010 14:52:02 +0000 (07:52 -0700)
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>
src/common/debug.cc

index 4c06a469349d06dd27ab88a32ea2fe0713d4e128..fa0c407bf9703fb511263b822744c07492d837da 100644 (file)
@@ -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;