diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-07-17 12:38:48 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-07-17 12:38:48 -0400 |
commit | f8489f4b0cd04756fae3786975441fb4aa8a70d9 (patch) | |
tree | 6bc32b49143daac9024acd72253a82545b0d8794 /util/log.h | |
parent | 2d0ed7733a13646d9f644aac0adcdccbfbf6ce1a (diff) | |
download | mongo-f8489f4b0cd04756fae3786975441fb4aa8a70d9.tar.gz |
make a global RamLog and display in webserver
Diffstat (limited to 'util/log.h')
-rw-r--r-- | util/log.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util/log.h b/util/log.h index 146dfe5647a..4c0b555bfa4 100644 --- a/util/log.h +++ b/util/log.h @@ -152,6 +152,7 @@ namespace mongo { LogLevel logLevel; static boost::scoped_ptr<ostream> stream; static FILE* logfile; + static vector<Tee*> globalTees; public: static void setLogFile(FILE* f){ @@ -185,6 +186,8 @@ namespace mongo { scoped_lock lk(mutex); if( t ) t->write(logLevel,s); + for ( unsigned i=0; i<globalTees.size(); i++ ) + globalTees[i]->write(logLevel,s); #ifndef _WIN32 //syslog( LOG_INFO , "%s" , cc ); @@ -248,6 +251,10 @@ namespace mongo { Logstream& prolog() { return *this; } + + void addGlobalTee( Tee * t ){ + globalTees.push_back( t ); + } private: static thread_specific_ptr<Logstream> tsp; |