summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbwebserver.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-07-12 18:05:35 -0400
committerAndy Schwerin <schwerin@10gen.com>2013-07-12 18:08:19 -0400
commit6e3ccc5649d16fd9940bc8fd1b490556d5767bf8 (patch)
tree6485289521af46ae932edb12a54c39737bea03f4 /src/mongo/db/dbwebserver.cpp
parent15333b2a308fd26c28448810780b06407328a795 (diff)
downloadmongo-6e3ccc5649d16fd9940bc8fd1b490556d5767bf8.tar.gz
SERVER-10172 Refactor RamLog to make it thread-safe.
Also prevent accidental creation of duplicate ramlogs of the same name.
Diffstat (limited to 'src/mongo/db/dbwebserver.cpp')
-rw-r--r--src/mongo/db/dbwebserver.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp
index 4754d2a57ad..506945575fe 100644
--- a/src/mongo/db/dbwebserver.cpp
+++ b/src/mongo/db/dbwebserver.cpp
@@ -324,21 +324,15 @@ namespace mongo {
vector<WebStatusPlugin*> * WebStatusPlugin::_plugins = 0;
- // -- basic statuc plugins --
+ // -- basic status plugins --
class LogPlugin : public WebStatusPlugin {
public:
LogPlugin() : WebStatusPlugin( "Log" , 100 ), _log(0) {
_log = RamLog::get( "global" );
- if ( ! _log ) {
- _log = new RamLog("global");
- logger::globalLogDomain()->attachAppender(logger::MessageLogDomain::AppenderAutoPtr(
- new RamLogAppender(_log)));
- }
}
- virtual void init() {
- }
+ virtual void init() {}
virtual void run( stringstream& ss ) {
_log->toHTML( ss );
@@ -346,9 +340,7 @@ namespace mongo {
RamLog * _log;
};
- MONGO_INITIALIZER_GENERAL(WebStatusLogPlugin, ("ServerLogRedirection"), ("default"))(
- InitializerContext*) {
-
+ MONGO_INITIALIZER(WebStatusLogPlugin)(InitializerContext*) {
if (cmdLine.isHttpInterfaceEnabled) {
new LogPlugin;
}