Skip to content

Commit

Permalink
Fix syslog for SERVER-6706
Browse files Browse the repository at this point in the history
  • Loading branch information
ak2196 committed Aug 3, 2012
1 parent a267fce commit 2069338
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/mongo/util/log.cpp
Expand Up @@ -315,7 +315,9 @@ namespace mongo {
bufSize += 128;

BufBuilder b(bufSize);
time_t_to_String( time(0) , b.grow(20) );
if ( !isSyslog ) {
time_t_to_String( time(0) , b.grow(20) );
}
if (!threadName.empty()) {
b.appendChar( '[' );
b.appendStr( threadName , false );
Expand Down
4 changes: 2 additions & 2 deletions src/mongo/util/log.h
Expand Up @@ -71,7 +71,7 @@ namespace mongo {
case LL_ERROR:
return LOG_ERR;
case LL_SEVERE:
return LOG_CRIT;
return LOG_EMERG;
default:
return LL_INFO;
}
Expand Down Expand Up @@ -248,7 +248,7 @@ namespace mongo {

char * newName = (char *) malloc( strlen(name) + 1 );
strcpy( newName , name);
openlog( newName , LOG_ODELAY , LOG_USER );
openlog( newName , LOG_PID | LOG_CONS | LOG_ODELAY , LOG_USER );
isSyslog = true;
}
#endif
Expand Down

0 comments on commit 2069338

Please sign in to comment.