summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/util/log.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp
index 980bb6a5490..840ec57dd47 100644
--- a/src/mongo/util/log.cpp
+++ b/src/mongo/util/log.cpp
@@ -90,10 +90,13 @@ namespace mongo {
string s = ss.str();
if ( ! rename( lp.c_str() , s.c_str() ) ) {
- cout << "log file [" << lp << "] exists; copied to temporary file [" << s << "]" << endl;
+ cout << "log file [" << lp
+ << "] exists; copied to temporary file [" << s << "]" << endl;
} else {
- cout << "log file [" << lp << "] exists and couldn't make backup; run with --logappend or manually remove file (" << strerror(errno) << ")" << endl;
-
+ cout << "log file [" << lp
+ << "] exists and couldn't make backup [" << s
+ << "]; run with --logappend or manually remove file: "
+ << errnoWithDescription() << endl;
return false;
}
}
@@ -137,7 +140,9 @@ namespace mongo {
ss << _path << "." << terseCurrentTime( false );
string s = ss.str();
if (0 != rename(_path.c_str(), s.c_str())) {
- error() << "Failed to rename " << _path << " to " << s;
+ error() << "Failed to rename '" << _path
+ << "' to '" << s
+ << "': " << errnoWithDescription() << endl;
return false;
}
}