summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2014-08-08 11:08:17 -0400
committerBenety Goh <benety@mongodb.com>2014-08-12 18:56:41 -0400
commit8a523f3bfd6e32cb6882d38e4eeff6adb6ea27c1 (patch)
treed934dad83af8d8564f98732d26eeb0a69404e361 /src/mongo/db
parent850d2d0912e519e544f0c896583a6fbd5cceabce (diff)
downloadmongo-8a523f3bfd6e32cb6882d38e4eeff6adb6ea27c1.tar.gz
SERVER-14729 assign default log component MONGO_LOG_DEFAULT_COMPONENT
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/auth/authorization_session.cpp4
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.cpp4
-rw-r--r--src/mongo/db/catalog/collection.cpp8
-rw-r--r--src/mongo/db/catalog/collection_info_cache.cpp4
-rw-r--r--src/mongo/db/catalog/database.cpp4
-rw-r--r--src/mongo/db/catalog/database_holder.cpp4
-rw-r--r--src/mongo/db/catalog/index_catalog.cpp4
-rw-r--r--src/mongo/db/catalog/index_catalog_entry.cpp4
-rw-r--r--src/mongo/db/catalog/index_create.cpp4
-rw-r--r--src/mongo/db/client.cpp8
-rw-r--r--src/mongo/db/cloner.cpp4
-rw-r--r--src/mongo/db/commands/cleanup_orphaned_cmd.cpp4
-rw-r--r--src/mongo/db/commands/drop_indexes.cpp4
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp4
-rw-r--r--src/mongo/db/commands/fsync.cpp2
-rw-r--r--src/mongo/db/commands/get_last_error.cpp4
-rw-r--r--src/mongo/db/commands/mr.cpp4
-rw-r--r--src/mongo/db/commands/plan_cache_commands.cpp4
-rw-r--r--src/mongo/db/commands/validate.cpp4
-rw-r--r--src/mongo/db/commands/write_commands/batch_executor.cpp4
-rw-r--r--src/mongo/db/db.cpp12
-rw-r--r--src/mongo/db/dbcommands.cpp4
-rw-r--r--src/mongo/db/exec/multi_plan.cpp4
-rw-r--r--src/mongo/db/exec/update.cpp3
-rw-r--r--src/mongo/db/fts/fts_command_mongos.cpp4
-rw-r--r--src/mongo/db/geo/r2_region_coverer.cpp4
-rw-r--r--src/mongo/db/index/btree_based_bulk_access_method.cpp4
-rw-r--r--src/mongo/db/index/haystack_access_method.cpp4
-rw-r--r--src/mongo/db/index_builder.cpp4
-rw-r--r--src/mongo/db/index_rebuilder.cpp4
-rw-r--r--src/mongo/db/instance.cpp10
-rw-r--r--src/mongo/db/ops/update.cpp4
-rw-r--r--src/mongo/db/ops/update_result.cpp4
-rw-r--r--src/mongo/db/prefetch.cpp4
-rw-r--r--src/mongo/db/projection.cpp4
-rw-r--r--src/mongo/db/query/get_executor.cpp4
-rw-r--r--src/mongo/db/query/new_find.cpp4
-rw-r--r--src/mongo/db/query/plan_cache.cpp4
-rw-r--r--src/mongo/db/query/plan_ranker.cpp4
-rw-r--r--src/mongo/db/query/query_planner.cpp4
-rw-r--r--src/mongo/db/range_deleter.cpp4
-rw-r--r--src/mongo/db/repl/bgsync.cpp4
-rw-r--r--src/mongo/db/repl/consensus.cpp4
-rw-r--r--src/mongo/db/repl/heartbeat.cpp2
-rw-r--r--src/mongo/db/repl/manager.cpp4
-rw-r--r--src/mongo/db/repl/master_slave.cpp4
-rw-r--r--src/mongo/db/repl/multicmd.cpp4
-rw-r--r--src/mongo/db/repl/oplog.cpp4
-rw-r--r--src/mongo/db/repl/oplogreader.cpp4
-rw-r--r--src/mongo/db/repl/repl_coordinator_hybrid.cpp4
-rw-r--r--src/mongo/db/repl/repl_coordinator_impl_test.cpp3
-rw-r--r--src/mongo/db/repl/repl_coordinator_legacy.cpp4
-rw-r--r--src/mongo/db/repl/repl_set_health_poll_task.cpp4
-rw-r--r--src/mongo/db/repl/repl_set_impl.cpp4
-rw-r--r--src/mongo/db/repl/repl_set_seed_list.cpp4
-rw-r--r--src/mongo/db/repl/rs_config.cpp4
-rw-r--r--src/mongo/db/repl/rs_initialsync.cpp4
-rw-r--r--src/mongo/db/repl/rs_rollback.cpp4
-rw-r--r--src/mongo/db/repl/state_box.cpp4
-rw-r--r--src/mongo/db/repl/sync.cpp4
-rw-r--r--src/mongo/db/repl/sync_source_feedback.cpp4
-rw-r--r--src/mongo/db/repl/sync_tail.cpp4
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/data_file.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/dur.cpp5
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_journal.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_recover.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/durop.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/repair_database.cpp4
-rw-r--r--src/mongo/db/storage/rocks/rocks_engine.cpp2
-rw-r--r--src/mongo/db/ttl.cpp4
79 files changed, 178 insertions, 147 deletions
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index c6da7ce8935..7173ca17a75 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kAccessControl
+
#include "mongo/platform/basic.h"
#include "mongo/db/auth/authorization_session.h"
@@ -49,8 +51,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kAccessControl);
-
namespace {
const std::string ADMIN_DBNAME = "admin";
} // namespace
diff --git a/src/mongo/db/auth/authz_manager_external_state_d.cpp b/src/mongo/db/auth/authz_manager_external_state_d.cpp
index a589e1a6998..63c5d9b9409 100644
--- a/src/mongo/db/auth/authz_manager_external_state_d.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_d.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kAccessControl
+
#include "mongo/platform/basic.h"
#include "mongo/db/auth/authz_manager_external_state_d.h"
@@ -50,8 +52,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kAccessControl);
-
AuthzManagerExternalStateMongod::AuthzManagerExternalStateMongod() {}
AuthzManagerExternalStateMongod::~AuthzManagerExternalStateMongod() {}
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp
index fd4e54b8dfd..c4c6787c133 100644
--- a/src/mongo/db/catalog/collection.cpp
+++ b/src/mongo/db/catalog/collection.cpp
@@ -28,6 +28,10 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/collection.h"
#include "mongo/base/counter.h"
@@ -49,6 +53,8 @@
namespace mongo {
+ using logger::LogComponent;
+
std::string CompactOptions::toString() const {
std::stringstream ss;
ss << "paddingMode: ";
@@ -526,7 +532,7 @@ namespace mongo {
IndexCatalog::IndexIterator i = _indexCatalog.getIndexIterator(false);
while( i.more() ) {
const IndexDescriptor* descriptor = i.next();
- log() << "validating index " << descriptor->indexNamespace() << endl;
+ log(LogComponent::kIndexing) << "validating index " << descriptor->indexNamespace() << endl;
IndexAccessMethod* iam = _indexCatalog.getIndex( descriptor );
invariant( iam );
diff --git a/src/mongo/db/catalog/collection_info_cache.cpp b/src/mongo/db/catalog/collection_info_cache.cpp
index aea1af88c42..63bf44e80db 100644
--- a/src/mongo/db/catalog/collection_info_cache.cpp
+++ b/src/mongo/db/catalog/collection_info_cache.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/catalog/collection_info_cache.h"
@@ -44,8 +46,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
CollectionInfoCache::CollectionInfoCache( Collection* collection )
: _collection( collection ),
_keysComputed( false ),
diff --git a/src/mongo/db/catalog/database.cpp b/src/mongo/db/catalog/database.cpp
index 7cc4f600ce2..f4fb419f30f 100644
--- a/src/mongo/db/catalog/database.cpp
+++ b/src/mongo/db/catalog/database.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/catalog/database.h"
@@ -59,8 +61,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
void massertNamespaceNotIndex( const StringData& ns, const StringData& caller ) {
massert( 17320,
str::stream() << "cannot do " << caller
diff --git a/src/mongo/db/catalog/database_holder.cpp b/src/mongo/db/catalog/database_holder.cpp
index 9e19275a7bf..12ee303a6e8 100644
--- a/src/mongo/db/catalog/database_holder.cpp
+++ b/src/mongo/db/catalog/database_holder.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/auth/auth_index_d.h"
@@ -46,8 +48,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
static DatabaseHolder _dbHolder;
DatabaseHolder& dbHolder() {
diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp
index 51594059293..dd4bd0814f7 100644
--- a/src/mongo/db/catalog/index_catalog.cpp
+++ b/src/mongo/db/catalog/index_catalog.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/catalog/index_catalog.h"
@@ -62,8 +64,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
static const int INDEX_CATALOG_INIT = 283711;
static const int INDEX_CATALOG_UNINIT = 654321;
diff --git a/src/mongo/db/catalog/index_catalog_entry.cpp b/src/mongo/db/catalog/index_catalog_entry.cpp
index 0271549681a..511bddf7cb0 100644
--- a/src/mongo/db/catalog/index_catalog_entry.cpp
+++ b/src/mongo/db/catalog/index_catalog_entry.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/catalog/index_catalog_entry.h"
@@ -42,8 +44,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
class HeadManagerImpl : public HeadManager {
public:
HeadManagerImpl(IndexCatalogEntry* ice) : _catalogEntry(ice) { }
diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp
index b369b98ca61..a483be3981b 100644
--- a/src/mongo/db/catalog/index_create.cpp
+++ b/src/mongo/db/catalog/index_create.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/catalog/index_create.h"
@@ -51,8 +53,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
/**
* Add the provided (obj, dl) pair to the provided index.
*/
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp
index 35e2bd30f04..d626766de21 100644
--- a/src/mongo/db/client.cpp
+++ b/src/mongo/db/client.cpp
@@ -71,6 +71,8 @@
namespace mongo {
+ using logger::LogComponent;
+
mongo::mutex& Client::clientsMutex = *(new mutex("clientsMutex"));
set<Client*>& Client::clients = *(new set<Client*>); // always be in clientsMutex when manipulating this
@@ -204,11 +206,13 @@ namespace mongo {
// we usually don't get here, so doesn't matter how fast this part is
{
- DEV log() << "_DEBUG ReadContext db wasn't open, will try to open " << ns << endl;
+ DEV log(LogComponent::kStorage)
+ << "_DEBUG ReadContext db wasn't open, will try to open " << ns << endl;
if (txn->lockState()->isW()) {
// write locked already
WriteUnitOfWork wunit(txn->recoveryUnit());
- DEV RARELY log() << "write locked on ReadContext construction " << ns << endl;
+ DEV RARELY log(LogComponent::kStorage)
+ << "write locked on ReadContext construction " << ns << endl;
_c.reset(new Context(txn, ns, doVersion));
wunit.commit();
}
diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp
index 1c21a550830..7bf725ca60b 100644
--- a/src/mongo/db/cloner.cpp
+++ b/src/mongo/db/cloner.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/base/init.h"
@@ -55,8 +57,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
BSONElement getErrField(const BSONObj& o);
/* for index info object:
diff --git a/src/mongo/db/commands/cleanup_orphaned_cmd.cpp b/src/mongo/db/commands/cleanup_orphaned_cmd.cpp
index 3bea4d2ee60..4087f090fc5 100644
--- a/src/mongo/db/commands/cleanup_orphaned_cmd.cpp
+++ b/src/mongo/db/commands/cleanup_orphaned_cmd.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include <string>
@@ -59,8 +61,6 @@ namespace {
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
using mongoutils::str::stream;
enum CleanupResult {
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp
index 363e38b9d33..834bfee0d92 100644
--- a/src/mongo/db/commands/drop_indexes.cpp
+++ b/src/mongo/db/commands/drop_indexes.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include "mongo/db/background.h"
@@ -46,8 +48,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
/* "dropIndexes" is now the preferred form - "deleteIndexes" deprecated */
class CmdDropIndexes : public Command {
public:
diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp
index 13ec1680ee2..9d84859b5e3 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include "mongo/db/commands/find_and_modify.h"
@@ -46,8 +48,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
/* Find and Modify an object returning either the old (default) or new value*/
class CmdFindAndModify : public Command {
public:
diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp
index 8db840c2338..df304429935 100644
--- a/src/mongo/db/commands/fsync.cpp
+++ b/src/mongo/db/commands/fsync.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/db/commands/fsync.h"
#include <string>
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index 4b3d87dfde9..773d2483172 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include "mongo/db/client.h"
@@ -42,8 +44,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
/* reset any errors so that getlasterror comes back clean.
useful before performing a long series of operations where we want to
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index dd9feb4a351..2d7bd76e485 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include "mongo/db/commands/mr.h"
@@ -60,8 +62,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
namespace mr {
AtomicUInt32 Config::JOB_NUMBER;
diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp
index 6eb0e68de1d..6d859118e28 100644
--- a/src/mongo/db/commands/plan_cache_commands.cpp
+++ b/src/mongo/db/commands/plan_cache_commands.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include <string>
@@ -107,8 +109,6 @@ namespace {
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
using std::string;
using std::stringstream;
using std::vector;
diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp
index 91c44de6424..bbddae56505 100644
--- a/src/mongo/db/commands/validate.cpp
+++ b/src/mongo/db/commands/validate.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include "mongo/db/commands.h"
@@ -38,8 +40,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
class ValidateCmd : public Command {
public:
ValidateCmd() : Command( "validate" ) {}
diff --git a/src/mongo/db/commands/write_commands/batch_executor.cpp b/src/mongo/db/commands/write_commands/batch_executor.cpp
index 759a5bed992..211aeafd00e 100644
--- a/src/mongo/db/commands/write_commands/batch_executor.cpp
+++ b/src/mongo/db/commands/write_commands/batch_executor.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include "mongo/db/commands/write_commands/batch_executor.h"
@@ -65,8 +67,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
namespace {
/**
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 531e8df648d..45b3dff01c2 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include <boost/thread/thread.hpp>
@@ -111,7 +113,7 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
+ using logger::LogComponent;
void (*snmpInit)() = NULL;
@@ -549,7 +551,7 @@ namespace mongo {
repl::getGlobalReplicationCoordinator()->getSettings();
{
ProcessId pid = ProcessId::getCurrent();
- LogstreamBuilder l = log();
+ LogstreamBuilder l = log(LogComponent::kDefault);
l << "MongoDB starting : pid=" << pid
<< " port=" << serverGlobalParams.port
<< " dbpath=" << storageGlobalParams.dbpath;
@@ -557,7 +559,7 @@ namespace mongo {
if( replSettings.slave ) l << " slave=" << (int) replSettings.slave;
l << ( is32bit ? " 32" : " 64" ) << "-bit host=" << getHostNameCached() << endl;
}
- DEV log() << "_DEBUG build (which is slower)" << endl;
+ DEV log(LogComponent::kDefault) << "_DEBUG build (which is slower)" << endl;
logStartupWarnings();
#if defined(_WIN32)
printTargetMinOS();
@@ -901,7 +903,7 @@ static int mongoDbMain(int argc, char* argv[], char **envp) {
unsigned x = 0x12345678;
unsigned char& b = (unsigned char&) x;
if ( b != 0x78 ) {
- log() << "big endian cpus not yet supported" << endl;
+ mongo::log(LogComponent::kDefault) << "big endian cpus not yet supported" << endl;
return 33;
}
}
@@ -911,7 +913,7 @@ static int mongoDbMain(int argc, char* argv[], char **envp) {
Status status = mongo::runGlobalInitializers(argc, argv, envp);
if (!status.isOK()) {
- severe() << "Failed global initialization: " << status;
+ severe(LogComponent::kDefault) << "Failed global initialization: " << status;
::_exit(EXIT_FAILURE);
}
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 8ff1931a8a2..4949d79bdff 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include <time.h>
@@ -83,8 +85,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
-
CmdShutdown cmdShutdown;
void CmdShutdown::help( stringstream& help ) const {
diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp
index a0edd058e1d..d2a27f2511c 100644
--- a/src/mongo/db/exec/multi_plan.cpp
+++ b/src/mongo/db/exec/multi_plan.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/exec/multi_plan.h"
@@ -47,8 +49,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
// static
const char* MultiPlanStage::kStageType = "MULTI_PLAN";
diff --git a/src/mongo/db/exec/update.cpp b/src/mongo/db/exec/update.cpp
index 83a89262f46..5f12324fffe 100644
--- a/src/mongo/db/exec/update.cpp
+++ b/src/mongo/db/exec/update.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/exec/update.h"
@@ -35,6 +37,7 @@
#include "mongo/db/ops/update_lifecycle.h"
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/repl/oplog.h"
+#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/db/fts/fts_command_mongos.cpp b/src/mongo/db/fts/fts_command_mongos.cpp
index a8d36d8ef73..23d27e9d4b9 100644
--- a/src/mongo/db/fts/fts_command_mongos.cpp
+++ b/src/mongo/db/fts/fts_command_mongos.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include <map>
@@ -44,8 +46,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
namespace fts {
struct Scored {
diff --git a/src/mongo/db/geo/r2_region_coverer.cpp b/src/mongo/db/geo/r2_region_coverer.cpp
index cff08c91896..b63bee21331 100644
--- a/src/mongo/db/geo/r2_region_coverer.cpp
+++ b/src/mongo/db/geo/r2_region_coverer.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/geo/r2_region_coverer.h"
@@ -33,8 +35,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
// Definition
int const R2RegionCoverer::kDefaultMaxCells = 8;
diff --git a/src/mongo/db/index/btree_based_bulk_access_method.cpp b/src/mongo/db/index/btree_based_bulk_access_method.cpp
index a770cc51e68..6139853c86e 100644
--- a/src/mongo/db/index/btree_based_bulk_access_method.cpp
+++ b/src/mongo/db/index/btree_based_bulk_access_method.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/index/btree_based_bulk_access_method.h"
@@ -40,8 +42,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
//
// Comparison for external sorter interface
//
diff --git a/src/mongo/db/index/haystack_access_method.cpp b/src/mongo/db/index/haystack_access_method.cpp
index 57a0ac6d4f0..62afc01bd11 100644
--- a/src/mongo/db/index/haystack_access_method.cpp
+++ b/src/mongo/db/index/haystack_access_method.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/index/haystack_access_method.h"
@@ -41,8 +43,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
HaystackAccessMethod::HaystackAccessMethod(IndexCatalogEntry* btreeState, SortedDataInterface* btree)
: BtreeBasedAccessMethod(btreeState, btree) {
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index 78af3691d3c..14b153f098f 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/index_builder.h"
@@ -42,8 +44,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
AtomicUInt32 IndexBuilder::_indexBuildCount;
IndexBuilder::IndexBuilder(const BSONObj& index) :
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp
index f8854feae14..328a5b62078 100644
--- a/src/mongo/db/index_rebuilder.cpp
+++ b/src/mongo/db/index_rebuilder.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/index_rebuilder.h"
@@ -45,8 +47,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
IndexRebuilder indexRebuilder;
IndexRebuilder::IndexRebuilder() {}
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 411ee1cf85a..85c41708bfe 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommands
+
#include "mongo/platform/basic.h"
#include <boost/thread/thread.hpp>
@@ -84,7 +86,7 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+ using logger::LogComponent;
// for diaglog
inline void opread(Message& m) {
@@ -1001,14 +1003,14 @@ namespace {
// Must hold global lock to get to here
invariant(txn->lockState()->isW());
- log() << "shutdown: going to close listening sockets..." << endl;
+ log(LogComponent::kNetworking) << "shutdown: going to close listening sockets..." << endl;
ListeningSockets::get()->closeAll();
- log() << "shutdown: going to flush diaglog..." << endl;
+ log(LogComponent::kNetworking) << "shutdown: going to flush diaglog..." << endl;
_diaglog.flush();
/* must do this before unmapping mem or you may get a seg fault */
- log() << "shutdown: going to close sockets..." << endl;
+ log(LogComponent::kNetworking) << "shutdown: going to close sockets..." << endl;
boost::thread close_socket_thread( stdx::bind(MessagingPort::closeAllSockets, 0) );
StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
diff --git a/src/mongo/db/ops/update.cpp b/src/mongo/db/ops/update.cpp
index f1af1023d86..2a3f9a5e549 100644
--- a/src/mongo/db/ops/update.cpp
+++ b/src/mongo/db/ops/update.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/ops/update.h"
@@ -48,8 +50,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
namespace {
// TODO: Make this a function on NamespaceString, or make it cleaner.
diff --git a/src/mongo/db/ops/update_result.cpp b/src/mongo/db/ops/update_result.cpp
index be3d39abe3f..e20dc451089 100644
--- a/src/mongo/db/ops/update_result.cpp
+++ b/src/mongo/db/ops/update_result.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/ops/update_result.h"
@@ -36,8 +38,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
UpdateResult::UpdateResult(bool existing_,
bool modifiers_,
unsigned long long numDocsModified_,
diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp
index fe2500f4b16..f0b948fcd3c 100644
--- a/src/mongo/db/prefetch.cpp
+++ b/src/mongo/db/prefetch.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/prefetch.h"
@@ -42,8 +44,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
// todo / idea: the prefetcher, when it fetches _id, on an upsert, will see if the record exists. if it does not,
// at write time, we can just do an insert, which will be faster.
diff --git a/src/mongo/db/projection.cpp b/src/mongo/db/projection.cpp
index dbbcb170e8e..d34557f37a2 100644
--- a/src/mongo/db/projection.cpp
+++ b/src/mongo/db/projection.cpp
@@ -27,6 +27,8 @@
* then also delete it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/projection.h"
@@ -37,8 +39,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
void Projection::init(const BSONObj& o,
const MatchExpressionParser::WhereCallback& whereCallback) {
massert( 10371 , "can only add to Projection once", _source.isEmpty());
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index b2a84a18eb0..29480e463db 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/query/get_executor.h"
@@ -65,8 +67,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
// static
void filterAllowedIndexEntries(const AllowedIndices& allowedIndices,
std::vector<IndexEntry>* indexEntries) {
diff --git a/src/mongo/db/query/new_find.cpp b/src/mongo/db/query/new_find.cpp
index 8c5ae0a3fb7..f34d097aa58 100644
--- a/src/mongo/db/query/new_find.cpp
+++ b/src/mongo/db/query/new_find.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/query/new_find.h"
@@ -110,8 +112,6 @@ namespace {
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
// Failpoint for checking whether we've received a getmore.
MONGO_FP_DECLARE(failReceivedGetmore);
diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp
index d62321bd15c..0950a93aee9 100644
--- a/src/mongo/db/query/plan_cache.cpp
+++ b/src/mongo/db/query/plan_cache.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/query/plan_cache.h"
@@ -45,8 +47,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
//
// Cache-related functions for CanonicalQuery
//
diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp
index 4ee9da8a1b6..12c9bfef5b7 100644
--- a/src/mongo/db/query/plan_ranker.cpp
+++ b/src/mongo/db/query/plan_ranker.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include <algorithm>
@@ -61,8 +63,6 @@ namespace {
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
using std::vector;
// static
diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp
index c5ca34d850d..a57da254b78 100644
--- a/src/mongo/db/query/query_planner.cpp
+++ b/src/mongo/db/query/query_planner.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
+
#include "mongo/platform/basic.h"
#include "mongo/db/query/query_planner.h"
@@ -48,8 +50,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
-
// Copied verbatim from db/index.h
static bool isIdIndex( const BSONObj &pattern ) {
BSONObjIterator i(pattern);
diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp
index e75ce96f0bd..ac6469f3cf1 100644
--- a/src/mongo/db/range_deleter.cpp
+++ b/src/mongo/db/range_deleter.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kSharding
+
#include "mongo/platform/basic.h"
#include "mongo/db/range_deleter.h"
@@ -95,8 +97,6 @@ namespace {
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
-
namespace duration = boost::posix_time;
struct RangeDeleter::NSMinMax {
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index ee27bfb2f74..f887621a742 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/client.h"
@@ -44,8 +46,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
int SleepToAllowBatchingMillis = 2;
diff --git a/src/mongo/db/repl/consensus.cpp b/src/mongo/db/repl/consensus.cpp
index 1e2cd524110..e9c58d64608 100644
--- a/src/mongo/db/repl/consensus.cpp
+++ b/src/mongo/db/repl/consensus.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/consensus.h"
@@ -39,8 +41,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
/** the first cmd called by a node seeking election and it's a basic sanity
diff --git a/src/mongo/db/repl/heartbeat.cpp b/src/mongo/db/repl/heartbeat.cpp
index f9ae91d7ef2..3ef57c25955 100644
--- a/src/mongo/db/repl/heartbeat.cpp
+++ b/src/mongo/db/repl/heartbeat.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include <boost/thread/thread.hpp>
#include "mongo/bson/util/bson_extract.h"
diff --git a/src/mongo/db/repl/manager.cpp b/src/mongo/db/repl/manager.cpp
index 79b76ac8dfb..a8e1d7f993a 100644
--- a/src/mongo/db/repl/manager.cpp
+++ b/src/mongo/db/repl/manager.cpp
@@ -29,6 +29,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/operation_context_impl.h"
@@ -40,8 +42,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
/* check members OTHER THAN US to see if they think they are primary */
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
index 6bc9364db8f..4748e68b410 100644
--- a/src/mongo/db/repl/master_slave.cpp
+++ b/src/mongo/db/repl/master_slave.cpp
@@ -36,6 +36,8 @@
local.pair.sync - [deprecated] { initialsynccomplete: 1 }
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/master_slave.h"
@@ -63,8 +65,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
void pretouchOperation(OperationContext* txn, const BSONObj& op);
diff --git a/src/mongo/db/repl/multicmd.cpp b/src/mongo/db/repl/multicmd.cpp
index 7889696e809..815a4b6bb7b 100644
--- a/src/mongo/db/repl/multicmd.cpp
+++ b/src/mongo/db/repl/multicmd.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/multicmd.h"
@@ -34,8 +36,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
void _MultiCommandJob::run() {
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index d2769da2f36..dca80acef6f 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/oplog.h"
@@ -69,8 +71,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
// cached copies of these...so don't rename them, drop them, etc.!!!
diff --git a/src/mongo/db/repl/oplogreader.cpp b/src/mongo/db/repl/oplogreader.cpp
index 82e45cbb164..5037438b6f3 100644
--- a/src/mongo/db/repl/oplogreader.cpp
+++ b/src/mongo/db/repl/oplogreader.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/oplogreader.h"
@@ -48,8 +50,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
//number of readers created;
diff --git a/src/mongo/db/repl/repl_coordinator_hybrid.cpp b/src/mongo/db/repl/repl_coordinator_hybrid.cpp
index f8d508aaa68..b1e45897002 100644
--- a/src/mongo/db/repl/repl_coordinator_hybrid.cpp
+++ b/src/mongo/db/repl/repl_coordinator_hybrid.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/repl_coordinator_hybrid.h"
@@ -37,8 +39,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
HybridReplicationCoordinator::HybridReplicationCoordinator(const ReplSettings& settings) :
diff --git a/src/mongo/db/repl/repl_coordinator_impl_test.cpp b/src/mongo/db/repl/repl_coordinator_impl_test.cpp
index 4c7906572ff..37524ff6902 100644
--- a/src/mongo/db/repl/repl_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/repl_coordinator_impl_test.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include <boost/scoped_ptr.hpp>
@@ -45,6 +47,7 @@
#include "mongo/stdx/functional.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/assert_util.h"
+#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/db/repl/repl_coordinator_legacy.cpp b/src/mongo/db/repl/repl_coordinator_legacy.cpp
index 9e1f188ec12..f1d20741a76 100644
--- a/src/mongo/db/repl/repl_coordinator_legacy.cpp
+++ b/src/mongo/db/repl/repl_coordinator_legacy.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/repl_coordinator_legacy.h"
@@ -60,8 +62,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
LegacyReplicationCoordinator::LegacyReplicationCoordinator(const ReplSettings& settings) :
diff --git a/src/mongo/db/repl/repl_set_health_poll_task.cpp b/src/mongo/db/repl/repl_set_health_poll_task.cpp
index f1988db61dd..10a104cb21e 100644
--- a/src/mongo/db/repl/repl_set_health_poll_task.cpp
+++ b/src/mongo/db/repl/repl_set_health_poll_task.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/repl_set_health_poll_task.h"
@@ -41,8 +43,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
int ReplSetHealthPollTask::s_try_offset = 0;
diff --git a/src/mongo/db/repl/repl_set_impl.cpp b/src/mongo/db/repl/repl_set_impl.cpp
index 949506f3f61..2d1eb935fac 100644
--- a/src/mongo/db/repl/repl_set_impl.cpp
+++ b/src/mongo/db/repl/repl_set_impl.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/repl_set_impl.h"
@@ -51,8 +53,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
#ifdef MONGO_PLATFORM_64
const int ReplSetImpl::replWriterThreadCount = 16;
diff --git a/src/mongo/db/repl/repl_set_seed_list.cpp b/src/mongo/db/repl/repl_set_seed_list.cpp
index 27f922eabdf..a19d04bce49 100644
--- a/src/mongo/db/repl/repl_set_seed_list.cpp
+++ b/src/mongo/db/repl/repl_set_seed_list.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/repl_set_seed_list.h"
@@ -36,8 +38,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
/** @param cfgString <setname>/<seedhost1>,<seedhost2> */
diff --git a/src/mongo/db/repl/rs_config.cpp b/src/mongo/db/repl/rs_config.cpp
index f177761a3ff..0ef87194f3c 100644
--- a/src/mongo/db/repl/rs_config.cpp
+++ b/src/mongo/db/repl/rs_config.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include <boost/algorithm/string.hpp>
@@ -47,8 +49,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
mongo::mutex ReplSetConfig::groupMx("RS tag group");
diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp
index 17daadbabca..bbdb3585ec1 100644
--- a/src/mongo/db/repl/rs_initialsync.cpp
+++ b/src/mongo/db/repl/rs_initialsync.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/rs.h"
@@ -50,8 +52,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
using namespace mongoutils;
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp
index 21b66ac8381..9b5c2af8e78 100644
--- a/src/mongo/db/repl/rs_rollback.cpp
+++ b/src/mongo/db/repl/rs_rollback.cpp
@@ -27,6 +27,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/auth/authorization_manager.h"
@@ -85,8 +87,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
class RSFatalException : public std::exception {
diff --git a/src/mongo/db/repl/state_box.cpp b/src/mongo/db/repl/state_box.cpp
index eb04d3e2d4e..b9e98816ab1 100644
--- a/src/mongo/db/repl/state_box.cpp
+++ b/src/mongo/db/repl/state_box.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/state_box.h"
@@ -34,8 +36,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
void StateBox::change(MemberState s, const Member *self) {
diff --git a/src/mongo/db/repl/sync.cpp b/src/mongo/db/repl/sync.cpp
index 93647531919..9999774d1d7 100644
--- a/src/mongo/db/repl/sync.cpp
+++ b/src/mongo/db/repl/sync.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/sync.h"
@@ -43,8 +45,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
void Sync::setHostname(const string& hostname) {
diff --git a/src/mongo/db/repl/sync_source_feedback.cpp b/src/mongo/db/repl/sync_source_feedback.cpp
index 2b47c5a3f53..e8a6e7efe03 100644
--- a/src/mongo/db/repl/sync_source_feedback.cpp
+++ b/src/mongo/db/repl/sync_source_feedback.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/sync_source_feedback.h"
@@ -45,8 +47,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
// used in replAuthenticate
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index 345a2c60d2e..cfbbefe16a7 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/sync_tail.h"
@@ -46,8 +48,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
static Counter64 opsAppliedStats;
diff --git a/src/mongo/db/repl/topology_coordinator_impl.cpp b/src/mongo/db/repl/topology_coordinator_impl.cpp
index 67296ce228f..45d030c4fa0 100644
--- a/src/mongo/db/repl/topology_coordinator_impl.cpp
+++ b/src/mongo/db/repl/topology_coordinator_impl.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
+
#include "mongo/platform/basic.h"
#include "mongo/db/repl/topology_coordinator_impl.h"
@@ -43,8 +45,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
-
namespace repl {
PingStats::PingStats() : count(0), value(std::numeric_limits<unsigned int>::max()) {
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
index 338bafb964b..12551b4193b 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/diskloc.h"
@@ -39,8 +41,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
// BtreeLogic::Builder algorithm
//
// Phase 1:
diff --git a/src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp b/src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp
index 0f5691ce783..aaf5498c76a 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/catalog/hashtab.h"
@@ -36,8 +38,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
int NamespaceHashTable::_find(const Key& k, bool& found) {
found = false;
int h = k.hash();
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp
index 1324b2c7b36..795082b26b5 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/catalog/namespace_index.h"
@@ -41,8 +43,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
NamespaceDetails* NamespaceIndex::details(const StringData& ns) {
Namespace n(ns);
return details(n);
diff --git a/src/mongo/db/storage/mmap_v1/data_file.cpp b/src/mongo/db/storage/mmap_v1/data_file.cpp
index 422ca1c6ce0..521589c6c95 100644
--- a/src/mongo/db/storage/mmap_v1/data_file.cpp
+++ b/src/mongo/db/storage/mmap_v1/data_file.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/pch.h"
#include "mongo/db/storage/mmap_v1/data_file.h"
diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp
index c903b2e8bb3..438e1ca9a72 100644
--- a/src/mongo/db/storage/mmap_v1/dur.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur.cpp
@@ -69,6 +69,8 @@
@see https://docs.google.com/drawings/edit?id=1TklsmZzm7ohIZkwgeK6rMvsdaR13KjtJYMsfLr175Zc
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kJournaling
+
#include "mongo/platform/basic.h"
#include <boost/thread/thread.hpp>
@@ -93,9 +95,6 @@
using namespace mongoutils;
namespace mongo {
-
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kJournaling);
-
namespace dur {
void PREPLOGBUFFER(JSectHeader& outParm, AlignedBuilder&);
diff --git a/src/mongo/db/storage/mmap_v1/dur_journal.cpp b/src/mongo/db/storage/mmap_v1/dur_journal.cpp
index c48afef8660..722b7829d41 100644
--- a/src/mongo/db/storage/mmap_v1/dur_journal.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_journal.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kJournaling
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/dur_journal.h"
@@ -60,8 +62,6 @@ using namespace mongoutils;
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kJournaling);
-
class AlignedBuilder;
diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp
index e552a32c868..96c07ec0f63 100644
--- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kJournaling
+
#include "mongo/pch.h"
#include "mongo/db/storage/mmap_v1/dur_recover.h"
diff --git a/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp b/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp
index b582bea8c4f..22769a5392b 100644
--- a/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kJournaling
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/dur_commitjob.h"
@@ -39,8 +41,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
namespace dur {
void debugValidateAllMapsMatch();
diff --git a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
index e717ce47638..b9d6231f8fa 100644
--- a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
+++ b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
@@ -32,6 +32,8 @@
if you don't care about journaling/durability (temp sort files & such) use MemoryMappedFile class, not this.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/durable_mapped_file.h"
@@ -48,8 +50,6 @@ using namespace mongoutils;
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
void DurableMappedFile::remapThePrivateView() {
verify(storageGlobalParams.dur);
diff --git a/src/mongo/db/storage/mmap_v1/durop.cpp b/src/mongo/db/storage/mmap_v1/durop.cpp
index b1c778fa459..494cd4bca5a 100644
--- a/src/mongo/db/storage/mmap_v1/durop.cpp
+++ b/src/mongo/db/storage/mmap_v1/durop.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/durop.h"
@@ -47,8 +49,6 @@ using namespace mongoutils;
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
namespace dur {
/** read a durop from journal file referenced by br.
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
index 14217369464..29d52b21802 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/db/storage/mmap_v1/mmap_v1_engine.h"
#include <boost/filesystem/path.hpp>
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp
index fc856f4856a..3a09d6d4eab 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include <boost/filesystem/operations.hpp>
#include "mongo/db/storage/mmap_v1/mmap_v1_extent_manager.h"
@@ -45,8 +47,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
MmapV1ExtentManager::MmapV1ExtentManager( const StringData& dbname,
const StringData& path,
bool directoryPerDB )
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
index 7a9d17974eb..07151ce7cbb 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/record_store_v1_simple.h"
@@ -48,8 +50,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
static Counter64 freelistAllocs;
static Counter64 freelistBucketExhausted;
static Counter64 freelistIterations;
diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp
index 8704f6d1783..7b1acdd4a83 100644
--- a/src/mongo/db/storage/mmap_v1/repair_database.cpp
+++ b/src/mongo/db/storage/mmap_v1/repair_database.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/platform/basic.h"
#include "mongo/db/storage/mmap_v1/mmap_v1_engine.h"
@@ -49,8 +51,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
-
typedef boost::filesystem::path Path;
// TODO SERVER-4328
diff --git a/src/mongo/db/storage/rocks/rocks_engine.cpp b/src/mongo/db/storage/rocks/rocks_engine.cpp
index 2c5917644b5..4308900622a 100644
--- a/src/mongo/db/storage/rocks/rocks_engine.cpp
+++ b/src/mongo/db/storage/rocks/rocks_engine.cpp
@@ -29,6 +29,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
+
#include "mongo/db/storage/rocks/rocks_engine.h"
#include <boost/filesystem/operations.hpp>
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index 654dea7f5ff..a90c78d29a1 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kIndexing
+
#include "mongo/platform/basic.h"
#include "mongo/db/ttl.h"
@@ -49,8 +51,6 @@
namespace mongo {
- MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
-
Counter64 ttlPasses;
Counter64 ttlDeletedDocuments;