summaryrefslogtreecommitdiff
path: root/src/mongo/db/system_index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/system_index.cpp')
-rw-r--r--src/mongo/db/system_index.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mongo/db/system_index.cpp b/src/mongo/db/system_index.cpp
index dfafa0e46a1..45fa2c2c457 100644
--- a/src/mongo/db/system_index.cpp
+++ b/src/mongo/db/system_index.cpp
@@ -46,6 +46,7 @@
#include "mongo/db/index_builds_coordinator.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/storage/storage_options.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
@@ -106,15 +107,21 @@ void generateSystemIndexForExistingCollection(OperationContext* opCtx,
opCtx, spec.toBSON(), serverGlobalParams.featureCompatibility);
BSONObj indexSpec = fassert(40452, indexSpecStatus);
- log() << "No authorization index detected on " << ns
- << " collection. Attempting to recover by creating an index with spec: " << indexSpec;
+ LOGV2(22488,
+ "No authorization index detected on {ns} collection. Attempting to recover by "
+ "creating an index with spec: {indexSpec}",
+ "ns"_attr = ns,
+ "indexSpec"_attr = indexSpec);
auto indexConstraints = IndexBuildsManager::IndexConstraints::kEnforce;
auto fromMigrate = false;
IndexBuildsCoordinator::get(opCtx)->createIndexes(
opCtx, collectionUUID, {indexSpec}, indexConstraints, fromMigrate);
} catch (const DBException& e) {
- severe() << "Failed to regenerate index for " << ns << ". Exception: " << e.what();
+ LOGV2_FATAL(22490,
+ "Failed to regenerate index for {ns}. Exception: {e_what}",
+ "ns"_attr = ns,
+ "e_what"_attr = e.what());
throw;
}
}
@@ -124,7 +131,8 @@ void generateSystemIndexForExistingCollection(OperationContext* opCtx,
Status verifySystemIndexes(OperationContext* opCtx) {
// Do not try and generate any system indexes in read only mode.
if (storageGlobalParams.readOnly) {
- warning() << "Running in queryable backup mode. Unable to create authorization indexes";
+ LOGV2_WARNING(22489,
+ "Running in queryable backup mode. Unable to create authorization indexes");
return Status::OK();
}