summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/client/dbclient.cpp5
-rw-r--r--src/mongo/client/dbclient_rs.cpp6
-rw-r--r--src/mongo/client/dbclientcursor.h5
-rw-r--r--src/mongo/client/parallel.cpp5
-rw-r--r--src/mongo/client/replica_set_monitor.cpp6
-rw-r--r--src/mongo/client/sasl_client_authenticate_impl.cpp5
-rw-r--r--src/mongo/client/syncclusterconnection.cpp5
-rw-r--r--src/mongo/db/auth/authorization_session.cpp4
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.cpp5
-rw-r--r--src/mongo/db/catalog/collection_info_cache.cpp5
-rw-r--r--src/mongo/db/catalog/database.cpp5
-rw-r--r--src/mongo/db/catalog/database_holder.cpp5
-rw-r--r--src/mongo/db/catalog/index_catalog.cpp4
-rw-r--r--src/mongo/db/catalog/index_catalog_entry.cpp6
-rw-r--r--src/mongo/db/catalog/index_create.cpp5
-rw-r--r--src/mongo/db/cloner.cpp4
-rw-r--r--src/mongo/db/commands/cleanup_orphaned_cmd.cpp5
-rw-r--r--src/mongo/db/commands/drop_indexes.cpp5
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp5
-rw-r--r--src/mongo/db/commands/get_last_error.cpp5
-rw-r--r--src/mongo/db/commands/mr.cpp5
-rw-r--r--src/mongo/db/commands/plan_cache_commands.cpp5
-rw-r--r--src/mongo/db/commands/validate.cpp5
-rw-r--r--src/mongo/db/commands/write_commands/batch_executor.cpp5
-rw-r--r--src/mongo/db/db.cpp6
-rw-r--r--src/mongo/db/dbcommands.cpp5
-rw-r--r--src/mongo/db/dbhelpers.cpp5
-rw-r--r--src/mongo/db/exec/multi_plan.cpp5
-rw-r--r--src/mongo/db/fts/fts_command_mongos.cpp6
-rw-r--r--src/mongo/db/geo/r2_region_coverer.cpp5
-rw-r--r--src/mongo/db/index/btree_based_bulk_access_method.cpp5
-rw-r--r--src/mongo/db/index/haystack_access_method.cpp5
-rw-r--r--src/mongo/db/index_builder.cpp5
-rw-r--r--src/mongo/db/index_rebuilder.cpp5
-rw-r--r--src/mongo/db/instance.cpp5
-rw-r--r--src/mongo/db/ops/update.cpp5
-rw-r--r--src/mongo/db/ops/update_result.h2
-rw-r--r--src/mongo/db/prefetch.cpp5
-rw-r--r--src/mongo/db/projection.cpp5
-rw-r--r--src/mongo/db/query/get_executor.cpp5
-rw-r--r--src/mongo/db/query/get_runner.cpp5
-rw-r--r--src/mongo/db/query/new_find.cpp5
-rw-r--r--src/mongo/db/query/plan_cache.cpp5
-rw-r--r--src/mongo/db/query/plan_ranker.cpp5
-rw-r--r--src/mongo/db/query/query_planner.cpp5
-rw-r--r--src/mongo/db/range_deleter.cpp3
-rw-r--r--src/mongo/db/repl/bgsync.cpp6
-rw-r--r--src/mongo/db/repl/consensus.cpp6
-rw-r--r--src/mongo/db/repl/manager.cpp6
-rw-r--r--src/mongo/db/repl/master_slave.cpp6
-rw-r--r--src/mongo/db/repl/multicmd.h3
-rw-r--r--src/mongo/db/repl/oplog.cpp6
-rw-r--r--src/mongo/db/repl/oplog.h3
-rw-r--r--src/mongo/db/repl/oplogreader.cpp5
-rw-r--r--src/mongo/db/repl/repl_coordinator_legacy.cpp4
-rw-r--r--src/mongo/db/repl/repl_set_health_poll_task.cpp6
-rw-r--r--src/mongo/db/repl/repl_set_impl.cpp6
-rw-r--r--src/mongo/db/repl/repl_set_seed_list.cpp5
-rw-r--r--src/mongo/db/repl/rs_config.cpp6
-rw-r--r--src/mongo/db/repl/rs_initialsync.cpp6
-rw-r--r--src/mongo/db/repl/rs_rollback.cpp6
-rw-r--r--src/mongo/db/repl/sync.cpp5
-rw-r--r--src/mongo/db/repl/sync_source_feedback.cpp6
-rw-r--r--src/mongo/db/repl/sync_source_feedback.h3
-rw-r--r--src/mongo/db/repl/sync_tail.cpp6
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl.cpp6
-rw-r--r--src/mongo/db/storage/mmap_v1/repair_database.cpp5
-rw-r--r--src/mongo/db/structure/btree/btree_logic.cpp6
-rw-r--r--src/mongo/db/structure/catalog/namespace_index.cpp5
-rw-r--r--src/mongo/db/ttl.cpp5
-rw-r--r--src/mongo/dbtests/threadedtests.cpp5
-rw-r--r--src/mongo/s/balance.cpp5
-rw-r--r--src/mongo/s/balancer_policy.cpp5
-rw-r--r--src/mongo/s/chunk.cpp5
-rw-r--r--src/mongo/s/chunk_diff-inl.cpp3
-rw-r--r--src/mongo/s/client_info.cpp5
-rw-r--r--src/mongo/s/cluster_client_internal.cpp5
-rw-r--r--src/mongo/s/commands_admin.cpp5
-rw-r--r--src/mongo/s/commands_public.cpp5
-rw-r--r--src/mongo/s/config.cpp5
-rw-r--r--src/mongo/s/cursors.cpp7
-rw-r--r--src/mongo/s/d_logic.cpp5
-rw-r--r--src/mongo/s/d_migrate.cpp5
-rw-r--r--src/mongo/s/d_split.cpp4
-rw-r--r--src/mongo/s/d_state.cpp5
-rw-r--r--src/mongo/s/d_writeback.cpp5
-rw-r--r--src/mongo/s/distlock.cpp5
-rw-r--r--src/mongo/s/distlock_test.cpp5
-rw-r--r--src/mongo/s/grid.cpp5
-rw-r--r--src/mongo/s/metadata_loader.cpp5
-rw-r--r--src/mongo/s/request.cpp5
-rw-r--r--src/mongo/s/server.cpp4
-rw-r--r--src/mongo/s/shard.cpp5
-rw-r--r--src/mongo/s/shardkey.cpp5
-rw-r--r--src/mongo/s/strategy.cpp5
-rw-r--r--src/mongo/s/version_manager.cpp5
-rw-r--r--src/mongo/s/write_ops/batch_downconvert.cpp5
-rw-r--r--src/mongo/s/write_ops/batch_write_exec.cpp5
-rw-r--r--src/mongo/s/writeback_listener.cpp5
-rw-r--r--src/mongo/scripting/engine_v8-3.25.cpp5
-rw-r--r--src/mongo/scripting/engine_v8-3.25.h3
-rw-r--r--src/mongo/scripting/engine_v8.cpp5
-rw-r--r--src/mongo/scripting/engine_v8.h3
-rw-r--r--src/mongo/util/background.cpp6
-rw-r--r--src/mongo/util/net/ssl_manager.cpp10
-rw-r--r--src/mongo/util/net/ssl_manager.h7
-rw-r--r--src/mongo/util/paths.cpp5
107 files changed, 486 insertions, 55 deletions
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp
index cc6a5aea144..d03b7bf4d67 100644
--- a/src/mongo/client/dbclient.cpp
+++ b/src/mongo/client/dbclient.cpp
@@ -27,7 +27,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/bson/util/builder.h"
@@ -41,12 +41,15 @@
#include "mongo/db/namespace_string.h"
#include "mongo/s/stale_exception.h" // for RecvStaleConfigException
#include "mongo/util/assert_util.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/password_digest.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
AtomicInt64 DBClientBase::ConnectionIdSequence;
const char* const saslCommandUserSourceFieldName = "userSource";
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index d360a856503..53e5baaa3ee 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -25,7 +25,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/client/dbclient_rs.h"
@@ -38,8 +38,12 @@
#include "mongo/client/sasl_client_authenticate.h"
#include "mongo/db/dbmessage.h"
#include "mongo/db/jsobj.h"
+#include "mongo/util/log.h"
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
namespace {
/*
diff --git a/src/mongo/client/dbclientcursor.h b/src/mongo/client/dbclientcursor.h
index 527829a42ea..a1e8c1a48fb 100644
--- a/src/mongo/client/dbclientcursor.h
+++ b/src/mongo/client/dbclientcursor.h
@@ -29,7 +29,7 @@
#pragma once
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <stack>
@@ -37,6 +37,7 @@
#include "mongo/client/export_macros.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/json.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/message.h"
namespace mongo {
@@ -88,6 +89,8 @@ namespace mongo {
/** throws AssertionException if get back { $err : ... } */
BSONObj nextSafe() {
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kNetworking);
+
BSONObj o = next();
if( strcmp(o.firstElementFieldName(), "$err") == 0 ) {
std::string s = "nextSafe(): " + o.toString();
diff --git a/src/mongo/client/parallel.cpp b/src/mongo/client/parallel.cpp
index 1db8316bc13..a75164bf386 100644
--- a/src/mongo/client/parallel.cpp
+++ b/src/mongo/client/parallel.cpp
@@ -28,7 +28,7 @@
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/client/parallel.h"
@@ -42,9 +42,12 @@
#include "mongo/s/grid.h"
#include "mongo/s/shard.h"
#include "mongo/s/version_manager.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
LabeledLevel pc( "pcursor", 2 );
void ParallelSortClusteredCursor::init() {
diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp
index 12635aeaa9d..a91a4b159e3 100644
--- a/src/mongo/client/replica_set_monitor.cpp
+++ b/src/mongo/client/replica_set_monitor.cpp
@@ -25,6 +25,8 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/client/replica_set_monitor.h"
#include <algorithm>
@@ -36,6 +38,7 @@
#include "mongo/client/replica_set_monitor_internal.h"
#include "mongo/util/concurrency/mutex.h" // for StaticObserver
#include "mongo/util/background.h"
+#include "mongo/util/log.h"
#include "mongo/util/string_map.h"
#include "mongo/util/timer.h"
@@ -48,6 +51,9 @@
#endif
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
namespace {
// Pull nested types to top-level scope
typedef ReplicaSetMonitor::IsMasterReply IsMasterReply;
diff --git a/src/mongo/client/sasl_client_authenticate_impl.cpp b/src/mongo/client/sasl_client_authenticate_impl.cpp
index f03a9012f60..2c882d2b43e 100644
--- a/src/mongo/client/sasl_client_authenticate_impl.cpp
+++ b/src/mongo/client/sasl_client_authenticate_impl.cpp
@@ -32,6 +32,8 @@
* The primary entry point at runtime is saslClientAuthenticateImpl().
*/
+#include "mongo/platform/basic.h"
+
#include <boost/scoped_ptr.hpp>
#include <string>
@@ -49,6 +51,9 @@
#include "mongo/util/password_digest.h"
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
namespace {
// Default log level on the client for SASL log messages.
diff --git a/src/mongo/client/syncclusterconnection.cpp b/src/mongo/client/syncclusterconnection.cpp
index a06b6c38238..d99c4431e40 100644
--- a/src/mongo/client/syncclusterconnection.cpp
+++ b/src/mongo/client/syncclusterconnection.cpp
@@ -28,7 +28,7 @@
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/client/syncclusterconnection.h"
@@ -36,11 +36,14 @@
#include "mongo/client/dbclientinterface.h"
#include "mongo/db/dbmessage.h"
#include "mongo/db/namespace_string.h"
+#include "mongo/util/log.h"
// error codes 8000-8009
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
SyncClusterConnection::SyncClusterConnection( const list<HostAndPort> & L, double socketTimeout) : _mutex("SyncClusterConnection"), _socketTimeout( socketTimeout ) {
{
stringstream s;
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index f731266721c..45071becf46 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/auth/authorization_session.h"
#include <string>
@@ -47,6 +49,8 @@
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 2079ffb4e42..ebaa1151d7e 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/auth/authz_manager_external_state_d.h"
#include <boost/thread/mutex.hpp>
@@ -42,10 +44,13 @@
#include "mongo/db/operation_context_impl.h"
#include "mongo/db/storage/storage_engine.h"
#include "mongo/util/assert_util.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kAccessControl);
+
AuthzManagerExternalStateMongod::AuthzManagerExternalStateMongod() {}
AuthzManagerExternalStateMongod::~AuthzManagerExternalStateMongod() {}
diff --git a/src/mongo/db/catalog/collection_info_cache.cpp b/src/mongo/db/catalog/collection_info_cache.cpp
index bac3cb9a4e1..85122d0d926 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/collection_info_cache.h"
#include "mongo/db/d_concurrency.h"
@@ -35,10 +37,13 @@
#include "mongo/db/catalog/collection.h"
#include "mongo/db/index/index_descriptor.h"
#include "mongo/util/debug_util.h"
+#include "mongo/util/log.h"
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 d1fbc8c8bd9..cbfd70a1502 100644
--- a/src/mongo/db/catalog/database.cpp
+++ b/src/mongo/db/catalog/database.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/catalog/database.h"
@@ -53,9 +53,12 @@
#include "mongo/db/storage_options.h"
#include "mongo/db/storage/storage_engine.h"
#include "mongo/db/catalog/collection.h"
+#include "mongo/util/log.h"
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 438be2fd6aa..71a62522c53 100644
--- a/src/mongo/db/catalog/database_holder.cpp
+++ b/src/mongo/db/catalog/database_holder.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/auth/auth_index_d.h"
#include "mongo/db/background.h"
@@ -41,9 +41,12 @@
#include "mongo/db/storage/mmap_v1/dur.h"
#include "mongo/db/storage/storage_engine.h"
#include "mongo/util/file_allocator.h"
+#include "mongo/util/log.h"
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 8d70c6b123c..293e80247d2 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/index_catalog.h"
#include <vector>
@@ -60,6 +62,8 @@
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 9764eebdf21..f60fb38dfd5 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/index_catalog_entry.h"
#include "mongo/db/catalog/collection_catalog_entry.h"
@@ -35,9 +37,13 @@
#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/structure/head_manager.h"
+#include "mongo/util/file_allocator.h"
+#include "mongo/util/log.h"
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 d3255c826c6..176939669c4 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/index_create.h"
#include "mongo/base/error_codes.h"
@@ -43,11 +45,14 @@
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/repl/rs.h"
#include "mongo/db/operation_context.h"
+#include "mongo/util/log.h"
#include "mongo/util/processinfo.h"
#include "mongo/util/progress_meter.h"
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/cloner.cpp b/src/mongo/db/cloner.cpp
index 368c986d908..52c96a142c3 100644
--- a/src/mongo/db/cloner.cpp
+++ b/src/mongo/db/cloner.cpp
@@ -51,10 +51,12 @@
#include "mongo/db/repl/oplog.h"
#include "mongo/db/repl/oplogreader.h"
#include "mongo/db/storage_options.h"
-
+#include "mongo/util/log.h"
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 dac324345bd..89e7f49ab4b 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.
*/
+#include "mongo/platform/basic.h"
+
#include <string>
#include <vector>
@@ -42,9 +44,12 @@
#include "mongo/s/collection_metadata.h"
#include "mongo/s/d_logic.h"
#include "mongo/s/range_arithmetic.h"
+#include "mongo/util/log.h"
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 b44708d5c6b..4ee6df82456 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/background.h"
#include "mongo/db/commands.h"
#include "mongo/db/index_builder.h"
@@ -39,9 +41,12 @@
#include "mongo/db/catalog/index_key_validate.h"
#include "mongo/db/repl/oplog.h"
#include "mongo/db/operation_context_impl.h"
+#include "mongo/util/log.h"
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 6de75da79f5..125826760a0 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/commands/find_and_modify.h"
@@ -42,9 +42,12 @@
#include "mongo/db/ops/update_lifecycle_impl.h"
#include "mongo/db/query/get_runner.h"
#include "mongo/db/operation_context_impl.h"
+#include "mongo/util/log.h"
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/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index 139e9204d08..59f1a7c2a8f 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/commands/get_last_error.h"
#include "mongo/db/client.h"
@@ -38,9 +40,12 @@
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/repl/rs.h"
#include "mongo/db/write_concern.h"
+#include "mongo/util/log.h"
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 cd1fcb09658..a55597b58b2 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/commands/mr.h"
@@ -55,10 +55,13 @@
#include "mongo/s/d_logic.h"
#include "mongo/s/grid.h"
#include "mongo/s/stale_exception.h"
+#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+
namespace mr {
AtomicUInt Config::JOB_NUMBER;
diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp
index cd572562f58..7436ecc9eea 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.
*/
+#include "mongo/platform/basic.h"
+
#include <string>
#include <sstream>
@@ -39,6 +41,7 @@
#include "mongo/db/catalog/collection.h"
#include "mongo/db/query/explain_plan.h"
#include "mongo/db/query/plan_ranker.h"
+#include "mongo/util/log.h"
namespace {
@@ -103,6 +106,8 @@ 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 c2363fcae09..7f6a36f2ff5 100644
--- a/src/mongo/db/commands/validate.cpp
+++ b/src/mongo/db/commands/validate.cpp
@@ -28,14 +28,19 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/commands.h"
#include "mongo/db/query/internal_plans.h"
#include "mongo/db/query/runner.h"
#include "mongo/db/operation_context_impl.h"
#include "mongo/db/catalog/collection.h"
+#include "mongo/util/log.h"
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 a35603e7db8..91ab9b8efee 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/commands/write_commands/batch_executor.h"
#include <memory>
@@ -58,10 +60,13 @@
#include "mongo/s/write_ops/batched_upsert_detail.h"
#include "mongo/s/write_ops/write_error_detail.h"
#include "mongo/util/elapsed_tracker.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
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 becde7a04b5..b3ba3020306 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <boost/thread/thread.hpp>
#include <boost/filesystem/operations.hpp>
@@ -94,6 +94,7 @@
#include "mongo/util/exception_filter_win32.h"
#include "mongo/util/exit.h"
#include "mongo/util/file_allocator.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/message_server.h"
#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/ntservice.h"
@@ -112,6 +113,8 @@
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
+
void (*snmpInit)() = NULL;
extern int diagLogging;
@@ -451,6 +454,7 @@ namespace mongo {
void run() {
Client::initThread( name().c_str() );
+
if (storageGlobalParams.syncdelay == 0) {
log() << "warning: --syncdelay 0 is not recommended and can have strange performance" << endl;
}
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 6a8484e68e2..358bd12fb53 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <time.h>
@@ -77,10 +77,13 @@
#include "mongo/scripting/engine.h"
#include "mongo/server.h"
#include "mongo/util/fail_point_service.h"
+#include "mongo/util/log.h"
#include "mongo/util/md5.hpp"
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/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index a587d1084a4..f0ac18ca3bc 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/dbhelpers.h"
@@ -56,6 +56,7 @@
#include "mongo/db/storage_options.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/s/d_logic.h"
+#include "mongo/util/log.h"
namespace mongo {
@@ -307,6 +308,8 @@ namespace mongo {
bool fromMigrate,
bool onlyRemoveOrphanedDocs )
{
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kSharding);
+
Timer rangeRemoveTimer;
const string& ns = range.ns;
diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp
index 70ed5b52b58..29df6121b29 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/exec/multi_plan.h"
#include "mongo/db/exec/working_set_common.h"
#include "mongo/util/mongoutils/str.h"
@@ -40,9 +42,12 @@
#include "mongo/db/query/plan_cache.h"
#include "mongo/db/query/plan_ranker.h"
#include "mongo/db/query/qlog.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
// static
const char* MultiPlanStage::kStageType = "MULTI_PLAN";
diff --git a/src/mongo/db/fts/fts_command_mongos.cpp b/src/mongo/db/fts/fts_command_mongos.cpp
index df152856e2d..a8d36d8ef73 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.
*/
+#include "mongo/platform/basic.h"
+
#include <map>
#include <string>
#include <vector>
@@ -36,10 +38,14 @@
#include "mongo/db/fts/fts_command.h"
#include "mongo/s/strategy.h"
+#include "mongo/util/log.h"
#include "mongo/util/timer.h"
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 e602123d878..cff08c91896 100644
--- a/src/mongo/db/geo/r2_region_coverer.cpp
+++ b/src/mongo/db/geo/r2_region_coverer.cpp
@@ -26,10 +26,15 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/geo/r2_region_coverer.h"
+#include "mongo/util/log.h"
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 d6645c9aca5..3e03a5d0509 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/index/btree_based_bulk_access_method.h"
#include "mongo/db/curop.h"
@@ -33,10 +35,13 @@
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/storage_options.h"
+#include "mongo/util/log.h"
#include "mongo/util/progress_meter.h"
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 02112d39f6f..44492bc87a2 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/index/haystack_access_method.h"
#include "mongo/base/status.h"
@@ -35,9 +37,12 @@
#include "mongo/db/index/haystack_access_method_internal.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/query/internal_plans.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
HaystackAccessMethod::HaystackAccessMethod(IndexCatalogEntry* btreeState, BtreeInterface* btree)
: BtreeBasedAccessMethod(btreeState, btree) {
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index 0486baf8abd..c6112291149 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/index_builder.h"
#include "mongo/db/client.h"
@@ -35,10 +37,13 @@
#include "mongo/db/d_concurrency.h"
#include "mongo/db/repl/rs.h"
#include "mongo/db/operation_context_impl.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
+
AtomicUInt IndexBuilder::_indexBuildCount = 0;
IndexBuilder::IndexBuilder(const BSONObj& index) :
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp
index d85a0379042..29b594dd1e4 100644
--- a/src/mongo/db/index_rebuilder.cpp
+++ b/src/mongo/db/index_rebuilder.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/index_rebuilder.h"
#include "mongo/db/auth/authorization_session.h"
@@ -38,10 +40,13 @@
#include "mongo/db/repl/rs.h"
#include "mongo/db/operation_context_impl.h"
#include "mongo/db/storage/storage_engine.h"
+#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
+
IndexRebuilder indexRebuilder;
IndexRebuilder::IndexRebuilder() {}
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index bd35e4f2bd6..89a198c1ef2 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <boost/filesystem/operations.hpp>
#include <boost/thread/thread.hpp>
@@ -88,11 +88,14 @@
#include "mongo/util/file_allocator.h"
#include "mongo/util/gcov.h"
#include "mongo/util/goodies.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
#include "mongo/util/time_support.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+
// for diaglog
inline void opread(Message& m) { if( _diaglog.getLevel() & 2 ) _diaglog.readop((char *) m.singleData(), m.header()->len); }
inline void opwrite(Message& m) { if( _diaglog.getLevel() & 1 ) _diaglog.writeop((char *) m.singleData(), m.header()->len); }
diff --git a/src/mongo/db/ops/update.cpp b/src/mongo/db/ops/update.cpp
index 8e63b6dc5ee..b39008a1bef 100644
--- a/src/mongo/db/ops/update.cpp
+++ b/src/mongo/db/ops/update.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/ops/update.h"
@@ -51,9 +51,12 @@
#include "mongo/db/operation_context_impl.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/platform/unordered_set.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
namespace mb = mutablebson;
namespace {
diff --git a/src/mongo/db/ops/update_result.h b/src/mongo/db/ops/update_result.h
index 945f3553207..46174da538e 100644
--- a/src/mongo/db/ops/update_result.h
+++ b/src/mongo/db/ops/update_result.h
@@ -31,6 +31,7 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/curop.h"
#include "mongo/db/namespace_string.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -48,6 +49,7 @@ namespace mongo {
, modifiers(modifiers_)
, numDocsModified(numDocsModified_)
, numMatched(numMatched_) {
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kQuery);
BSONElement id = upsertedObject_["_id"];
if ( ! existing && numMatched == 1 && !id.eoo() ) {
diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp
index db5f92c3fdf..88ba08716e7 100644
--- a/src/mongo/db/prefetch.cpp
+++ b/src/mongo/db/prefetch.cpp
@@ -26,7 +26,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/prefetch.h"
@@ -38,9 +38,12 @@
#include "mongo/db/repl/rs.h"
#include "mongo/db/stats/timer_stats.h"
#include "mongo/db/commands/server_status_metric.h"
+#include "mongo/util/log.h"
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 7b10c71cc39..dbbcb170e8e 100644
--- a/src/mongo/db/projection.cpp
+++ b/src/mongo/db/projection.cpp
@@ -27,15 +27,18 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/projection.h"
#include "mongo/db/matcher/matcher.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
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 03ee948817f..74ec3f62f38 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/query/get_executor.h"
#include <limits>
@@ -57,9 +59,12 @@
#include "mongo/db/server_options.h"
#include "mongo/db/server_parameters.h"
#include "mongo/s/d_logic.h"
+#include "mongo/util/log.h"
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/get_runner.cpp b/src/mongo/db/query/get_runner.cpp
index b6cc5bf0710..3e027d60cff 100644
--- a/src/mongo/db/query/get_runner.cpp
+++ b/src/mongo/db/query/get_runner.cpp
@@ -28,6 +28,8 @@
// THIS FILE IS DEPRECATED -- replaced by get_executor.cpp
+#include "mongo/platform/basic.h"
+
#include "mongo/db/query/get_runner.h"
#include <limits>
@@ -61,9 +63,12 @@
#include "mongo/db/server_options.h"
#include "mongo/db/server_parameters.h"
#include "mongo/s/d_logic.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
Status getRunner(Collection* collection,
const std::string& ns,
const BSONObj& unparsedQuery,
diff --git a/src/mongo/db/query/new_find.cpp b/src/mongo/db/query/new_find.cpp
index 3a9ce1ccc56..e79670b0899 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/query/new_find.h"
#include "mongo/client/dbclientinterface.h"
@@ -52,6 +54,7 @@
#include "mongo/s/chunk_version.h"
#include "mongo/s/d_logic.h"
#include "mongo/s/stale_exception.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -109,6 +112,8 @@ namespace {
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
// TODO: Move this and the other command stuff in newRunQuery outta here and up a level.
static bool runCommands(OperationContext* txn,
const char *ns,
diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp
index 3c7144b0b14..d62321bd15c 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/query/plan_cache.h"
#include <algorithm>
@@ -38,10 +40,13 @@
#include "mongo/db/query/query_solution.h"
#include "mongo/db/query/qlog.h"
#include "mongo/db/query/query_knobs.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
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 e965562bc0b..9e65dec1d9f 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.
*/
+#include "mongo/platform/basic.h"
+
#include <algorithm>
#include <math.h>
#include <vector>
@@ -41,6 +43,7 @@
#include "mongo/db/query/qlog.h"
#include "mongo/db/server_options.h"
#include "mongo/db/server_parameters.h"
+#include "mongo/util/log.h"
namespace {
@@ -58,6 +61,8 @@ 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 98e2e723702..9939d13e9ef 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/query/query_planner.h"
#include <vector>
@@ -42,9 +44,12 @@
#include "mongo/db/query/qlog.h"
#include "mongo/db/query/query_planner_common.h"
#include "mongo/db/query/query_solution.h"
+#include "mongo/util/log.h"
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 4659d2c0785..d096cab1219 100644
--- a/src/mongo/db/range_deleter.cpp
+++ b/src/mongo/db/range_deleter.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/write_concern_options.h"
#include "mongo/s/range_arithmetic.h"
#include "mongo/util/concurrency/synchronization.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
#include "mongo/util/time_support.h"
#include "mongo/util/timer.h"
@@ -94,6 +95,8 @@ 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 0922a1cc5e2..c5fd835c650 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -26,7 +26,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/client.h"
#include "mongo/db/commands/fsync.h"
@@ -36,10 +36,14 @@
#include "mongo/db/repl/rs_sync.h"
#include "mongo/db/repl/rs.h"
#include "mongo/util/fail_point_service.h"
+#include "mongo/util/log.h"
#include "mongo/base/counter.h"
#include "mongo/db/stats/timer_stats.h"
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 f47984b2d67..dad5aa3f4fd 100644
--- a/src/mongo/db/repl/consensus.cpp
+++ b/src/mongo/db/repl/consensus.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/consensus.h"
#include "mongo/base/string_data.h"
@@ -33,8 +35,12 @@
#include "mongo/db/repl/multicmd.h"
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/repl/replset_commands.h"
+#include "mongo/util/log.h"
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/manager.cpp b/src/mongo/db/repl/manager.cpp
index b47c9e26a0a..68559ca4ffc 100644
--- a/src/mongo/db/repl/manager.cpp
+++ b/src/mongo/db/repl/manager.cpp
@@ -29,14 +29,18 @@
* it in the license file.
*/
-#include "mongo/db/repl/manager.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/repl/connections.h"
#include "mongo/db/repl/isself.h"
#include "mongo/db/repl/rs.h"
#include "mongo/db/client.h"
+#include "mongo/util/log.h"
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 3199c82d4db..54afae7e969 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 }
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/master_slave.h"
#include <pcrecpp.h>
@@ -57,8 +59,12 @@
#include "mongo/db/operation_context_impl.h"
#include "mongo/db/storage_options.h"
#include "mongo/util/exit.h"
+#include "mongo/util/log.h"
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.h b/src/mongo/db/repl/multicmd.h
index d07337a0074..7848040836a 100644
--- a/src/mongo/db/repl/multicmd.h
+++ b/src/mongo/db/repl/multicmd.h
@@ -32,6 +32,7 @@
#include "mongo/db/repl/connections.h"
#include "mongo/util/background.h"
+#include "mongo/util/log.h"
namespace mongo {
namespace repl {
@@ -61,6 +62,8 @@ namespace repl {
private:
std::string name() const { return "MultiCommandJob"; }
void run() {
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kReplication);
+
try {
ScopedConn c(d.toHost);
LOG(1) << "multiCommand running on host " << d.toHost;
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 5206c3f613b..db1919151e5 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/repl/oplog.h"
@@ -63,9 +63,13 @@
#include "mongo/scripting/engine.h"
#include "mongo/util/elapsed_tracker.h"
#include "mongo/util/file.h"
+#include "mongo/util/log.h"
#include "mongo/util/startup_test.h"
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/oplog.h b/src/mongo/db/repl/oplog.h
index 3aa0eb0ba52..ab9c5faa132 100644
--- a/src/mongo/db/repl/oplog.h
+++ b/src/mongo/db/repl/oplog.h
@@ -28,6 +28,9 @@
#pragma once
+#include <cstddef>
+#include <string>
+
namespace mongo {
class BSONObj;
class Database;
diff --git a/src/mongo/db/repl/oplogreader.cpp b/src/mongo/db/repl/oplogreader.cpp
index 13e1f1519e3..3963fe3a665 100644
--- a/src/mongo/db/repl/oplogreader.cpp
+++ b/src/mongo/db/repl/oplogreader.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/oplogreader.h"
#include <boost/shared_ptr.hpp>
@@ -45,6 +47,9 @@
#include "mongo/util/log.h"
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_legacy.cpp b/src/mongo/db/repl/repl_coordinator_legacy.cpp
index 0fd61d04e27..eb246e9e740 100644
--- a/src/mongo/db/repl/repl_coordinator_legacy.cpp
+++ b/src/mongo/db/repl/repl_coordinator_legacy.cpp
@@ -50,8 +50,12 @@
#include "mongo/db/write_concern_options.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/fail_point_service.h"
+#include "mongo/util/log.h"
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
+
namespace repl {
LegacyReplicationCoordinator::LegacyReplicationCoordinator() {
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 9c2b39c1af4..f1988db61dd 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/repl_set_health_poll_task.h"
#include "mongo/bson/bsonelement.h"
@@ -35,8 +37,12 @@
#include "mongo/db/repl/member.h"
#include "mongo/db/repl/rs.h"
#include "mongo/db/repl/rs_config.h"
+#include "mongo/util/log.h"
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 1cedecf0880..6ede275b985 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/repl_set_impl.h"
#include "mongo/db/client.h"
@@ -43,8 +45,12 @@
#include "mongo/s/d_logic.h"
#include "mongo/util/background.h"
#include "mongo/util/exit.h"
+#include "mongo/util/log.h"
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 29373665f31..dfd1c4f7bda 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/repl_set_seed_list.h"
#include <boost/thread.hpp>
@@ -41,6 +43,9 @@
#include "mongo/util/log.h"
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 b92e665b2b1..d62f32e601f 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.
*/
+#include "mongo/platform/basic.h"
+
#include <boost/algorithm/string.hpp>
#include "mongo/db/dbhelpers.h"
@@ -39,12 +41,16 @@
#include "mongo/db/repl/repl_settings.h" // replSettings
#include "mongo/db/repl/rs.h"
#include "mongo/db/operation_context_impl.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/hostandport.h"
#include "mongo/util/text.h"
using namespace bson;
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 b685325a1c4..e41a22f6064 100644
--- a/src/mongo/db/repl/rs_initialsync.cpp
+++ b/src/mongo/db/repl/rs_initialsync.cpp
@@ -26,7 +26,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/repl/rs.h"
@@ -45,9 +45,13 @@
#include "mongo/db/repl/oplog.h"
#include "mongo/db/repl/oplogreader.h"
#include "mongo/db/repl/repl_settings.h" // replSettings
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
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 b338a9e2c40..321885f60d7 100644
--- a/src/mongo/db/repl/rs_rollback.cpp
+++ b/src/mongo/db/repl/rs_rollback.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/auth/authorization_manager.h"
#include "mongo/db/auth/authorization_manager_global.h"
@@ -43,6 +43,7 @@
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/repl/rs.h"
#include "mongo/db/operation_context_impl.h"
+#include "mongo/util/log.h"
/* Scenarios
*
@@ -83,6 +84,9 @@
*/
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
+
namespace repl {
using namespace bson;
diff --git a/src/mongo/db/repl/sync.cpp b/src/mongo/db/repl/sync.cpp
index a112603aed0..93647531919 100644
--- a/src/mongo/db/repl/sync.cpp
+++ b/src/mongo/db/repl/sync.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/sync.h"
#include <string>
@@ -40,6 +42,9 @@
#include "mongo/util/log.h"
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 0062fe20f20..68d94d1318a 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/sync_source_feedback.h"
#include "mongo/client/constants.h"
@@ -38,8 +40,12 @@
#include "mongo/db/repl/bgsync.h"
#include "mongo/db/repl/rs.h" // theReplSet
#include "mongo/db/operation_context_impl.h"
+#include "mongo/util/log.h"
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
+
namespace repl {
// used in replAuthenticate
diff --git a/src/mongo/db/repl/sync_source_feedback.h b/src/mongo/db/repl/sync_source_feedback.h
index 943d4a14cce..927eeca0428 100644
--- a/src/mongo/db/repl/sync_source_feedback.h
+++ b/src/mongo/db/repl/sync_source_feedback.h
@@ -33,6 +33,7 @@
#include "mongo/client/constants.h"
#include "mongo/client/dbclientcursor.h"
#include "mongo/util/background.h"
+#include "mongo/util/log.h"
namespace mongo {
namespace repl {
@@ -71,6 +72,8 @@ namespace repl {
private:
void _resetConnection() {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
+
LOG(1) << "resetting connection in sync source feedback";
_connection.reset();
}
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index 569ea8f7f0a..7665c995102 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -26,7 +26,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/repl/sync_tail.h"
@@ -42,8 +42,12 @@
#include "mongo/db/stats/timer_stats.h"
#include "mongo/db/operation_context_impl.h"
#include "mongo/util/fail_point_service.h"
+#include "mongo/util/log.h"
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 dfc89bf10f4..126461ca1ad 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/repl/topology_coordinator_impl.h"
#include "mongo/db/operation_context.h"
@@ -34,8 +36,12 @@
#include "mongo/db/repl/repl_settings.h"
#include "mongo/db/repl/replication_executor.h"
#include "mongo/db/repl/rs_sync.h" // maxSyncSourceLagSecs
+#include "mongo/util/log.h"
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kReplication);
+
namespace repl {
TopologyCoordinatorImpl::TopologyCoordinatorImpl() :
diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp
index dc9e50f1f6c..836827a0ee6 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.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/storage/mmap_v1/mmap_v1_engine.h"
#include <boost/filesystem/operations.hpp>
@@ -42,10 +44,13 @@
#include "mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.h"
#include "mongo/util/file.h"
#include "mongo/util/file_allocator.h"
+#include "mongo/util/log.h"
#include "mongo/util/mmap.h"
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/structure/btree/btree_logic.cpp b/src/mongo/db/structure/btree/btree_logic.cpp
index 0cd10393043..04ff9e67301 100644
--- a/src/mongo/db/structure/btree/btree_logic.cpp
+++ b/src/mongo/db/structure/btree/btree_logic.cpp
@@ -26,16 +26,20 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/diskloc.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/structure/btree/btree_logic.h"
#include "mongo/db/structure/btree/key.h"
#include "mongo/db/structure/record_store.h"
-
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
+
//
// Public Builder logic
//
diff --git a/src/mongo/db/structure/catalog/namespace_index.cpp b/src/mongo/db/structure/catalog/namespace_index.cpp
index af61ae68e54..1dd89776015 100644
--- a/src/mongo/db/structure/catalog/namespace_index.cpp
+++ b/src/mongo/db/structure/catalog/namespace_index.cpp
@@ -28,6 +28,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/structure/catalog/namespace_index.h"
#include <boost/filesystem/operations.hpp>
@@ -36,9 +38,12 @@
#include "mongo/db/operation_context.h"
#include "mongo/db/structure/catalog/namespace_details.h"
#include "mongo/util/exit.h"
+#include "mongo/util/log.h"
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/ttl.cpp b/src/mongo/db/ttl.cpp
index 8fb39e89642..51e51d8a3e8 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -28,7 +28,7 @@
* it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/ttl.h"
@@ -45,9 +45,12 @@
#include "mongo/db/server_parameters.h"
#include "mongo/db/operation_context_impl.h"
#include "mongo/util/background.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kIndexing);
+
Counter64 ttlPasses;
Counter64 ttlDeletedDocuments;
diff --git a/src/mongo/dbtests/threadedtests.cpp b/src/mongo/dbtests/threadedtests.cpp
index 8c6f5d7c2fa..2d8d3ebf96b 100644
--- a/src/mongo/dbtests/threadedtests.cpp
+++ b/src/mongo/dbtests/threadedtests.cpp
@@ -29,7 +29,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <boost/thread.hpp>
@@ -47,6 +47,7 @@
#include "mongo/util/concurrency/synchronization.h"
#include "mongo/util/concurrency/qlock.h"
#include "mongo/util/concurrency/ticketholder.h"
+#include "mongo/util/log.h"
#include "mongo/server.h"
namespace mongo {
@@ -55,6 +56,8 @@ namespace mongo {
namespace ThreadedTests {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+
template <int nthreads_param=10>
class ThreadedTest {
public:
diff --git a/src/mongo/s/balance.cpp b/src/mongo/s/balance.cpp
index 2f1177855e4..b2be36d2113 100644
--- a/src/mongo/s/balance.cpp
+++ b/src/mongo/s/balance.cpp
@@ -26,7 +26,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/balance.h"
@@ -46,10 +46,13 @@
#include "mongo/s/type_mongos.h"
#include "mongo/s/type_settings.h"
#include "mongo/s/type_tags.h"
+#include "mongo/util/log.h"
#include "mongo/util/version.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
Balancer balancer;
Balancer::Balancer() : _balancedLastTime(0), _policy( new BalancerPolicy() ) {}
diff --git a/src/mongo/s/balancer_policy.cpp b/src/mongo/s/balancer_policy.cpp
index c252ea8f72b..484a86da9dc 100644
--- a/src/mongo/s/balancer_policy.cpp
+++ b/src/mongo/s/balancer_policy.cpp
@@ -27,18 +27,21 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <algorithm>
#include "mongo/s/balancer_policy.h"
#include "mongo/s/config.h"
+#include "mongo/util/log.h"
#include "mongo/util/stringutils.h"
#include "mongo/util/text.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
string TagRange::toString() const {
return str::stream() << min << " -->> " << max << " on " << tag;
}
diff --git a/src/mongo/s/chunk.cpp b/src/mongo/s/chunk.cpp
index e6b866ebd6c..4aef8141a88 100644
--- a/src/mongo/s/chunk.cpp
+++ b/src/mongo/s/chunk.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/chunk.h"
@@ -49,6 +49,7 @@
#include "mongo/s/type_collection.h"
#include "mongo/s/type_settings.h"
#include "mongo/util/concurrency/ticketholder.h"
+#include "mongo/util/log.h"
#include "mongo/util/startup_test.h"
#include "mongo/util/timer.h"
#include "mongo/db/query/canonical_query.h"
@@ -58,6 +59,8 @@
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
inline bool allOfType(BSONType type, const BSONObj& o) {
BSONObjIterator it(o);
while(it.more()) {
diff --git a/src/mongo/s/chunk_diff-inl.cpp b/src/mongo/s/chunk_diff-inl.cpp
index daa38e08866..d4818dbd107 100644
--- a/src/mongo/s/chunk_diff-inl.cpp
+++ b/src/mongo/s/chunk_diff-inl.cpp
@@ -33,6 +33,7 @@
#include "mongo/s/chunk_diff.h"
#include "mongo/s/chunk_version.h"
#include "mongo/s/type_chunk.h"
+#include "mongo/util/log.h"
namespace mongo {
@@ -121,6 +122,8 @@ namespace mongo {
int ConfigDiffTracker<ValType,ShardType>::
calculateConfigDiff( DBClientCursorInterface& diffCursor )
{
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kSharding);
+
verifyAttached();
// Apply the chunk changes to the ranges and versions
diff --git a/src/mongo/s/client_info.cpp b/src/mongo/s/client_info.cpp
index 900dc70e84a..44038f0a99b 100644
--- a/src/mongo/s/client_info.cpp
+++ b/src/mongo/s/client_info.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/client/connpool.h"
#include "mongo/db/auth/authorization_manager_global.h"
@@ -48,11 +48,14 @@
#include "mongo/s/request.h"
#include "mongo/s/writeback_listener.h"
#include "mongo/server.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
#include "mongo/util/scopeguard.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
ClientInfo::ClientInfo(AbstractMessagingPort* messagingPort) : ClientBasic(messagingPort) {
_cur = &_a;
_prev = &_b;
diff --git a/src/mongo/s/cluster_client_internal.cpp b/src/mongo/s/cluster_client_internal.cpp
index 9b3165c19e4..6013b8290e2 100644
--- a/src/mongo/s/cluster_client_internal.cpp
+++ b/src/mongo/s/cluster_client_internal.cpp
@@ -26,6 +26,8 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/s/cluster_client_internal.h"
#include <string>
@@ -38,10 +40,13 @@
#include "mongo/s/type_changelog.h"
#include "mongo/s/type_mongos.h"
#include "mongo/s/type_shard.h"
+#include "mongo/util/log.h"
#include "mongo/util/stringutils.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
using std::string;
using std::vector;
using mongoutils::str::stream;
diff --git a/src/mongo/s/commands_admin.cpp b/src/mongo/s/commands_admin.cpp
index 62dd47e9d38..79372173622 100644
--- a/src/mongo/s/commands_admin.cpp
+++ b/src/mongo/s/commands_admin.cpp
@@ -26,7 +26,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/db/commands.h"
@@ -63,6 +63,7 @@
#include "mongo/s/write_ops/batch_downconvert.h"
#include "mongo/s/write_ops/batch_write_exec.h"
#include "mongo/s/write_ops/batched_command_request.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/listen.h"
#include "mongo/util/net/message.h"
#include "mongo/util/processinfo.h"
@@ -73,6 +74,8 @@
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+
namespace dbgrid_cmds {
class GridAdminCmd : public Command {
diff --git a/src/mongo/s/commands_public.cpp b/src/mongo/s/commands_public.cpp
index f38821e6861..28bbc09dbfc 100644
--- a/src/mongo/s/commands_public.cpp
+++ b/src/mongo/s/commands_public.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/base/init.h"
#include "mongo/client/connpool.h"
@@ -58,11 +58,14 @@
#include "mongo/s/strategy.h"
#include "mongo/s/version_manager.h"
#include "mongo/scripting/engine.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/message.h"
#include "mongo/util/timer.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+
namespace dbgrid_pub_cmds {
namespace {
diff --git a/src/mongo/s/config.cpp b/src/mongo/s/config.cpp
index 215ce852d59..b1f655c27d0 100644
--- a/src/mongo/s/config.cpp
+++ b/src/mongo/s/config.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "pcrecpp.h"
@@ -52,11 +52,14 @@
#include "mongo/s/type_settings.h"
#include "mongo/s/type_shard.h"
#include "mongo/util/exit.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/message.h"
#include "mongo/util/stringutils.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
int ConfigServer::VERSION = 3;
Shard Shard::EMPTY;
diff --git a/src/mongo/s/cursors.cpp b/src/mongo/s/cursors.cpp
index e13b5be44d3..fbb52de4b91 100644
--- a/src/mongo/s/cursors.cpp
+++ b/src/mongo/s/cursors.cpp
@@ -27,8 +27,7 @@
* then also delete it in the license file.
*/
-
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/cursors.h"
@@ -46,9 +45,13 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/max_time.h"
#include "mongo/util/concurrency/task.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/listen.h"
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
const int ShardedClientCursor::INIT_REPLY_BUFFER_SIZE = 32768;
// -------- ShardedCursor -----------
diff --git a/src/mongo/s/d_logic.cpp b/src/mongo/s/d_logic.cpp
index 9433237a2ac..e183e97d523 100644
--- a/src/mongo/s/d_logic.cpp
+++ b/src/mongo/s/d_logic.cpp
@@ -34,7 +34,7 @@
mostly around shard management and checking
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/d_logic.h"
@@ -48,12 +48,15 @@
#include "mongo/db/jsobj.h"
#include "mongo/s/d_writeback.h"
#include "mongo/s/shard.h"
+#include "mongo/util/log.h"
#include "mongo/util/queue.h"
using namespace std;
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
bool _handlePossibleShardedMessage( Message &m, DbResponse* dbresponse ) {
DEV verify( shardingState.enabled() );
diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp
index fef22237850..2d4cc1eacca 100644
--- a/src/mongo/s/d_migrate.cpp
+++ b/src/mongo/s/d_migrate.cpp
@@ -34,7 +34,7 @@
mostly around shard management and checking
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <algorithm>
#include <boost/thread/thread.hpp>
@@ -78,6 +78,7 @@
#include "mongo/util/elapsed_tracker.h"
#include "mongo/util/exit.h"
#include "mongo/util/fail_point_service.h"
+#include "mongo/util/log.h"
#include "mongo/util/processinfo.h"
#include "mongo/util/queue.h"
#include "mongo/util/startup_test.h"
@@ -89,6 +90,8 @@ using namespace std;
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
MONGO_FP_DECLARE(failMigrationCommit);
MONGO_FP_DECLARE(failMigrationConfigWritePrepare);
diff --git a/src/mongo/s/d_split.cpp b/src/mongo/s/d_split.cpp
index aad554d5265..7dde165002c 100644
--- a/src/mongo/s/d_split.cpp
+++ b/src/mongo/s/d_split.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <map>
#include <string>
@@ -54,10 +54,12 @@
#include "mongo/s/d_logic.h"
#include "mongo/s/distlock.h"
#include "mongo/s/type_chunk.h"
+#include "mongo/util/log.h"
#include "mongo/util/timer.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
class CmdMedianKey : public Command {
public:
diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp
index 767e894ab58..1faff77d5f2 100644
--- a/src/mongo/s/d_state.cpp
+++ b/src/mongo/s/d_state.cpp
@@ -34,7 +34,7 @@
mostly around shard management and checking
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include <map>
#include <string>
@@ -60,10 +60,13 @@
#include "mongo/util/queue.h"
#include "mongo/util/concurrency/mutex.h"
#include "mongo/util/concurrency/ticketholder.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
// -----ShardingState START ----
ShardingState::ShardingState()
diff --git a/src/mongo/s/d_writeback.cpp b/src/mongo/s/d_writeback.cpp
index 20f5819a9fb..61d2c102e80 100644
--- a/src/mongo/s/d_writeback.cpp
+++ b/src/mongo/s/d_writeback.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/d_writeback.h"
@@ -45,6 +45,7 @@
#include "mongo/db/curop.h"
#include "mongo/db/jsobj.h"
#include "mongo/platform/random.h"
+#include "mongo/util/log.h"
#include "mongo/util/net/listen.h"
#include "mongo/util/queue.h"
#include "mongo/util/stacktrace.h"
@@ -53,6 +54,8 @@ using namespace std;
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
// ---------- WriteBackManager class ----------
// TODO init at mongod startup
diff --git a/src/mongo/s/distlock.cpp b/src/mongo/s/distlock.cpp
index 8150a8cfdf5..7e2ccb5e7b0 100644
--- a/src/mongo/s/distlock.cpp
+++ b/src/mongo/s/distlock.cpp
@@ -27,7 +27,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/distlock.h"
@@ -38,10 +38,13 @@
#include "mongo/s/type_locks.h"
#include "mongo/s/type_lockpings.h"
#include "mongo/util/concurrency/thread_name.h"
+#include "mongo/util/log.h"
#include "mongo/util/timer.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
LabeledLevel DistributedLock::logLvl( 1 );
DistributedLock::LastPings DistributedLock::lastPings;
diff --git a/src/mongo/s/distlock_test.cpp b/src/mongo/s/distlock_test.cpp
index 0cd58148f3a..8d2e7f014fd 100644
--- a/src/mongo/s/distlock_test.cpp
+++ b/src/mongo/s/distlock_test.cpp
@@ -27,7 +27,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/distlock.h"
@@ -43,6 +43,7 @@
#include "mongo/db/commands.h"
#include "mongo/util/bson_util.h"
#include "mongo/util/concurrency/thread_name.h"
+#include "mongo/util/log.h"
#include "mongo/util/timer.h"
// Modify some config options for the RNG, since they cause MSVC to fail
@@ -72,6 +73,8 @@
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
class TestDistLockWithSync: public Command {
public:
TestDistLockWithSync() :
diff --git a/src/mongo/s/grid.cpp b/src/mongo/s/grid.cpp
index c249a5aaef1..49804a42359 100644
--- a/src/mongo/s/grid.cpp
+++ b/src/mongo/s/grid.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/grid.h"
@@ -49,11 +49,14 @@
#include "mongo/s/type_settings.h"
#include "mongo/s/type_shard.h"
#include "mongo/util/fail_point_service.h"
+#include "mongo/util/log.h"
#include "mongo/util/startup_test.h"
#include "mongo/util/stringutils.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
MONGO_FP_DECLARE(neverBalance);
DBConfigPtr Grid::getDBConfig( const StringData& ns , bool create , const string& shardNameHint ) {
diff --git a/src/mongo/s/metadata_loader.cpp b/src/mongo/s/metadata_loader.cpp
index a6dad3a8fdf..d735d15e584 100644
--- a/src/mongo/s/metadata_loader.cpp
+++ b/src/mongo/s/metadata_loader.cpp
@@ -26,6 +26,8 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/s/metadata_loader.h"
#include "mongo/client/connpool.h"
@@ -37,9 +39,12 @@
#include "mongo/s/range_arithmetic.h"
#include "mongo/s/type_chunk.h"
#include "mongo/s/type_collection.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
/**
* This is an adapter so we can use config diffs - mongos and mongod do them slightly
* differently.
diff --git a/src/mongo/s/request.cpp b/src/mongo/s/request.cpp
index c4916fc2438..984bfdfabe9 100644
--- a/src/mongo/s/request.cpp
+++ b/src/mongo/s/request.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/request.h"
@@ -44,9 +44,12 @@
#include "mongo/s/cursors.h"
#include "mongo/s/grid.h"
#include "mongo/s/server.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
Request::Request( Message& m, AbstractMessagingPort* p ) :
_m(m) , _d( m ) , _p(p) , _didInit(false) {
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp
index ae41ca08c97..ba488db4408 100644
--- a/src/mongo/s/server.cpp
+++ b/src/mongo/s/server.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/server.h"
@@ -89,6 +89,8 @@
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
#if defined(_WIN32)
ntservice::NtServiceDefaultStrings defaultServiceStrings = {
L"MongoS",
diff --git a/src/mongo/s/shard.cpp b/src/mongo/s/shard.cpp
index 5fdfca9e98a..48d4ad969ee 100644
--- a/src/mongo/s/shard.cpp
+++ b/src/mongo/s/shard.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/shard.h"
@@ -52,9 +52,12 @@
#include "mongo/s/scc_fast_query_handler.h"
#include "mongo/s/type_shard.h"
#include "mongo/s/version_manager.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
static bool initWireVersion( DBClientBase* conn, std::string* errMsg ) {
BSONObj response;
if ( !conn->runCommand( "admin", BSON("isMaster" << 1), response )) {
diff --git a/src/mongo/s/shardkey.cpp b/src/mongo/s/shardkey.cpp
index 027de1bc2fa..4cdf4e17d3c 100644
--- a/src/mongo/s/shardkey.cpp
+++ b/src/mongo/s/shardkey.cpp
@@ -28,17 +28,20 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/s/chunk.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/json.h"
+#include "mongo/util/log.h"
#include "mongo/util/startup_test.h"
#include "mongo/util/timer.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
ShardKeyPattern::ShardKeyPattern( BSONObj p ) : pattern( p.getOwned() ) {
pattern.toBSON().getFieldNames( patternfields );
diff --git a/src/mongo/s/strategy.cpp b/src/mongo/s/strategy.cpp
index 880b2355388..1ba416426b5 100644
--- a/src/mongo/s/strategy.cpp
+++ b/src/mongo/s/strategy.cpp
@@ -28,7 +28,7 @@
// strategy_sharded.cpp
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/base/status.h"
#include "mongo/base/owned_pointer_vector.h"
@@ -54,12 +54,15 @@
#include "mongo/s/request.h"
#include "mongo/s/version_manager.h"
#include "mongo/s/write_ops/batch_upconvert.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
// error codes 8010-8040
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
static bool _isSystemIndexes( const char* ns ) {
return nsToCollectionSubstring(ns) == "system.indexes";
}
diff --git a/src/mongo/s/version_manager.cpp b/src/mongo/s/version_manager.cpp
index f966be02983..4c1b85fd08a 100644
--- a/src/mongo/s/version_manager.cpp
+++ b/src/mongo/s/version_manager.cpp
@@ -28,6 +28,8 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/s/version_manager.h"
#include "mongo/s/chunk.h"
@@ -37,9 +39,12 @@
#include "mongo/s/shard.h"
#include "mongo/s/stale_exception.h" // for SendStaleConfigException
#include "mongo/s/writeback_listener.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
// Global version manager
VersionManager versionManager;
diff --git a/src/mongo/s/write_ops/batch_downconvert.cpp b/src/mongo/s/write_ops/batch_downconvert.cpp
index d76591df5e8..6d1aa5e7b23 100644
--- a/src/mongo/s/write_ops/batch_downconvert.cpp
+++ b/src/mongo/s/write_ops/batch_downconvert.cpp
@@ -26,14 +26,19 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/s/write_ops/batch_downconvert.h"
#include "mongo/bson/util/builder.h"
#include "mongo/db/write_concern_options.h"
#include "mongo/util/assert_util.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
Status BatchSafeWriter::extractGLEErrors( const BSONObj& gleResponse, GLEErrors* errors ) {
// DRAGONS
diff --git a/src/mongo/s/write_ops/batch_write_exec.cpp b/src/mongo/s/write_ops/batch_write_exec.cpp
index 0069a2788de..c34e6716097 100644
--- a/src/mongo/s/write_ops/batch_write_exec.cpp
+++ b/src/mongo/s/write_ops/batch_write_exec.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/s/write_ops/batch_write_exec.h"
#include "mongo/base/error_codes.h"
@@ -35,9 +37,12 @@
#include "mongo/client/dbclientinterface.h" // ConnectionString (header-only)
#include "mongo/s/write_ops/batch_write_op.h"
#include "mongo/s/write_ops/write_error_detail.h"
+#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
BatchWriteExec::BatchWriteExec( NSTargeter* targeter,
ShardResolver* resolver,
MultiCommandDispatch* dispatcher ) :
diff --git a/src/mongo/s/writeback_listener.cpp b/src/mongo/s/writeback_listener.cpp
index 4fe9d394232..3dcb983bd45 100644
--- a/src/mongo/s/writeback_listener.cpp
+++ b/src/mongo/s/writeback_listener.cpp
@@ -28,7 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "writeback_listener.h"
@@ -42,10 +42,13 @@
#include "mongo/s/server.h"
#include "mongo/s/shard.h"
#include "mongo/s/version_manager.h"
+#include "mongo/util/log.h"
#include "mongo/util/timer.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kSharding);
+
unordered_map<string,WriteBackListener*> WriteBackListener::_cache;
unordered_set<string> WriteBackListener::_seenSets;
mongo::mutex WriteBackListener::_cacheLock("WriteBackListener");
diff --git a/src/mongo/scripting/engine_v8-3.25.cpp b/src/mongo/scripting/engine_v8-3.25.cpp
index 20f234c32bd..627fa1340a9 100644
--- a/src/mongo/scripting/engine_v8-3.25.cpp
+++ b/src/mongo/scripting/engine_v8-3.25.cpp
@@ -27,6 +27,8 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/scripting/engine_v8-3.25.h"
#include "mongo/base/init.h"
@@ -34,12 +36,15 @@
#include "mongo/scripting/v8-3.25_db.h"
#include "mongo/scripting/v8-3.25_utils.h"
#include "mongo/util/base64.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
using namespace mongoutils;
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
#ifndef _MSC_EXTENSIONS
const int V8Scope::objectDepthLimit;
#endif
diff --git a/src/mongo/scripting/engine_v8-3.25.h b/src/mongo/scripting/engine_v8-3.25.h
index db41e9c5fc6..87d1f78ddbf 100644
--- a/src/mongo/scripting/engine_v8-3.25.h
+++ b/src/mongo/scripting/engine_v8-3.25.h
@@ -41,6 +41,7 @@
#include "mongo/scripting/engine.h"
#include "mongo/scripting/v8_deadline_monitor.h"
#include "mongo/scripting/v8-3.25_profiler.h"
+#include "mongo/util/log.h"
/**
* V8_SIMPLE_HEADER must be placed in any function called from a public API
@@ -92,6 +93,8 @@ namespace mongo {
* V8Scope is destructed.
*/
~ObjTracker() {
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kQuery);
+
if (!_container.empty()) {
LOG(1) << "freeing " << _container.size() << " uncollected "
<< typeid(_ObjType).name() << " objects" << endl;
diff --git a/src/mongo/scripting/engine_v8.cpp b/src/mongo/scripting/engine_v8.cpp
index 8eec6ba3360..2932f48253d 100644
--- a/src/mongo/scripting/engine_v8.cpp
+++ b/src/mongo/scripting/engine_v8.cpp
@@ -27,6 +27,8 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/scripting/engine_v8.h"
#include "mongo/base/init.h"
@@ -34,12 +36,15 @@
#include "mongo/scripting/v8_db.h"
#include "mongo/scripting/v8_utils.h"
#include "mongo/util/base64.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
using namespace mongoutils;
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kQuery);
+
#ifndef _MSC_EXTENSIONS
const int V8Scope::objectDepthLimit;
#endif
diff --git a/src/mongo/scripting/engine_v8.h b/src/mongo/scripting/engine_v8.h
index 6f7f1019e1f..463ab734b8e 100644
--- a/src/mongo/scripting/engine_v8.h
+++ b/src/mongo/scripting/engine_v8.h
@@ -41,6 +41,7 @@
#include "mongo/scripting/engine.h"
#include "mongo/scripting/v8_deadline_monitor.h"
#include "mongo/scripting/v8_profiler.h"
+#include "mongo/util/log.h"
/**
* V8_SIMPLE_HEADER must be placed in any function called from a public API
@@ -89,6 +90,8 @@ namespace mongo {
* V8Scope is destructed.
*/
~ObjTracker() {
+ MONGO_LOG_DEFAULT_COMPONENT_LOCAL(::mongo::logger::LogComponent::kQuery);
+
if (!_container.empty()) {
LOG(1) << "freeing " << _container.size() << " uncollected "
<< typeid(_ObjType).name() << " objects" << std::endl;
diff --git a/src/mongo/util/background.cpp b/src/mongo/util/background.cpp
index 21231162cff..748ffdf818c 100644
--- a/src/mongo/util/background.cpp
+++ b/src/mongo/util/background.cpp
@@ -27,7 +27,7 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/util/background.h"
@@ -39,6 +39,8 @@
#include "mongo/util/concurrency/mutex.h"
#include "mongo/util/concurrency/spin_lock.h"
#include "mongo/util/concurrency/thread_name.h"
+#include "mongo/util/debug_util.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/time_support.h"
@@ -47,6 +49,8 @@
using namespace std;
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kCommands);
+
namespace {
class PeriodicTaskRunner : public BackgroundJob {
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index 95e1e109751..81cf5610ef5 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -25,18 +25,21 @@
* then also delete it in the license file.
*/
-#include "mongo/pch.h"
+#include "mongo/platform/basic.h"
#include "mongo/util/net/ssl_manager.h"
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/tss.hpp>
+#include <ostream>
#include <string>
#include <vector>
#include "mongo/base/init.h"
#include "mongo/platform/atomic_word.h"
#include "mongo/util/concurrency/mutex.h"
+#include "mongo/util/debug_util.h"
+#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/sock.h"
#include "mongo/util/net/ssl_options.h"
@@ -47,7 +50,12 @@
#include <openssl/x509v3.h>
#endif
+using std::endl;
+
namespace mongo {
+
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kNetworking);
+
SSLGlobalParams sslGlobalParams;
#ifndef MONGO_SSL
diff --git a/src/mongo/util/net/ssl_manager.h b/src/mongo/util/net/ssl_manager.h
index 8e8419e1894..82698dd18ac 100644
--- a/src/mongo/util/net/ssl_manager.h
+++ b/src/mongo/util/net/ssl_manager.h
@@ -25,18 +25,19 @@
* then also delete it in the license file.
*/
-#ifdef MONGO_SSL
-
#pragma once
#include <string>
+
+#ifdef MONGO_SSL
+
#include "mongo/base/disallow_copying.h"
#include "mongo/util/net/sock.h"
#include <openssl/err.h>
#include <openssl/ssl.h>
-#endif
+#endif // #ifdef MONGO_SSL
namespace mongo {
/*
diff --git a/src/mongo/util/paths.cpp b/src/mongo/util/paths.cpp
index 9be10b73353..56ac3a68b59 100644
--- a/src/mongo/util/paths.cpp
+++ b/src/mongo/util/paths.cpp
@@ -25,13 +25,16 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/util/paths.h"
-#include "mongo/platform/basic.h"
#include "mongo/util/log.h"
namespace mongo {
+ MONGO_LOG_DEFAULT_COMPONENT_FILE(::mongo::logger::LogComponent::kStorage);
+
void flushMyDirectory(const boost::filesystem::path& file) {
#ifdef __linux__ // this isn't needed elsewhere
static bool _warnedAboutFilesystem = false;