cleaning diag log names and make sure to flush periodically SERVER-1814

This commit is contained in:
Eliot Horowitz
2010-09-21 00:23:33 -04:00
parent bfb2e63461
commit 8b8e4882af
3 changed files with 8 additions and 9 deletions

View File

@@ -62,9 +62,9 @@ namespace mongo {
bool useCursors = true;
bool useHints = true;
void flushOpLog( stringstream &ss ) {
void flushDiagLog() {
if( _diaglog.f && _diaglog.f->is_open() ) {
ss << "flushing op log and files\n";
log() << "flushing diag log" << endl;
_diaglog.flush();
}
}
@@ -745,9 +745,7 @@ namespace mongo {
ListeningSockets::get()->closeAll();
log() << "shutdown: going to flush oplog..." << endl;
stringstream ss2;
flushOpLog( ss2 );
rawOut( ss2.str() );
flushDiagLog();
/* must do this before unmapping mem or you may get a seg fault */
log() << "shutdown: going to close sockets..." << endl;