summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-09-03 15:06:50 -0400
committerMathias Stearn <mathias@10gen.com>2010-09-03 15:10:06 -0400
commit8567338619100d160767d95933185874b26912b1 (patch)
tree4a262b1af7df9b4b95f19d531625364ea68cda2c
parent3c8722269e8d49100babb969f07251d84dd54794 (diff)
downloadmongo-8567338619100d160767d95933185874b26912b1.tar.gz
Replace stdout with logfile SERVER-1727
-rw-r--r--util/log.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/util/log.cpp b/util/log.cpp
index bfd9154b456..334c66b4cb9 100644
--- a/util/log.cpp
+++ b/util/log.cpp
@@ -83,7 +83,7 @@ namespace mongo {
}
- FILE* tmp = fopen(_path.c_str(), (_append ? "a" : "w"));
+ FILE* tmp = freopen(_path.c_str(), (_append ? "a" : "w"), stdout);
if (!tmp){
cerr << "can't open: " << _path.c_str() << " for log file" << endl;
dbexit( EXIT_BADOPTIONS );
@@ -92,10 +92,6 @@ namespace mongo {
Logstream::setLogFile(tmp); // after this point no thread will be using old file
- if (_file){
- fclose(_file);
- }
-
_file = tmp;
_opened = time(0);
}