diff options
author | Amirsaman Memaripour <amirsaman.memaripour@mongodb.com> | 2020-03-31 10:22:14 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-31 14:38:13 +0000 |
commit | 49e9747069d526816310629f713f00f9934fcb5b (patch) | |
tree | b781e516c14f5cae09006e16ead8336524dd8cec /src/mongo | |
parent | 2da53ac5de3efb67d07e8ffba692b90cde954bba (diff) | |
download | mongo-49e9747069d526816310629f713f00f9934fcb5b.tar.gz |
Revert "SERVER-47077 Clean up log lines in 'mongo/db'"
This reverts commit bc67d9be07b35da807ae854960e24f9ed61e5d43.
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/commands.cpp | 46 | ||||
-rw-r--r-- | src/mongo/db/initialize_server_global_state.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/log_process_details.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/operation_killer.cpp | 2 |
5 files changed, 36 insertions, 41 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 3085027db40..57b65cca648 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -614,9 +614,9 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx, if (closeConnection) { opCtx->getClient()->session()->end(); LOGV2(20431, - "Failing {command} via 'failCommand' failpoint: closing connection", - "Failing command via 'failCommand' failpoint: closing connection", - "command"_attr = cmd->getName()); + "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: " + "closing connection.", + "cmd_getName"_attr = cmd->getName()); uasserted(50985, "Failing command due to 'failCommand' failpoint"); } @@ -631,35 +631,32 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx, blockTimeMS >= 0); LOGV2(20432, - "Blocking {command} via 'failCommand' failpoint for {blockTime}", - "Blocking command via 'failCommand' failpoint", - "command"_attr = cmd->getName(), - "blockTime"_attr = Milliseconds{blockTimeMS}); + "Blocking command '{cmd_getName}' via 'failCommand' failpoint for " + "{blockTimeMS} milliseconds", + "cmd_getName"_attr = cmd->getName(), + "blockTimeMS"_attr = blockTimeMS); opCtx->sleepFor(Milliseconds{blockTimeMS}); LOGV2(20433, - "Unblocking {command} via 'failCommand' failpoint", - "Unblocking command via 'failCommand' failpoint", - "command"_attr = cmd->getName()); + "Unblocking command '{cmd_getName}' via 'failCommand' failpoint", + "cmd_getName"_attr = cmd->getName()); } if (hasExtraInfo) { LOGV2(20434, - "Failing {command} via 'failCommand' failpoint: returning {errorCode} and " - "{errorExtraInfo}", - "Failing command via 'failCommand' failpoint", - "command"_attr = cmd->getName(), + "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: " + "returning error code {errorCode} and {errorExtraInfo}.", + "cmd_getName"_attr = cmd->getName(), "errorCode"_attr = errorCode, "errorExtraInfo"_attr = errorExtraInfo); uassertStatusOK(Status(ErrorCodes::Error(errorCode), "Failing command due to 'failCommand' failpoint", errorExtraInfo.Obj())); } else if (hasErrorCode) { - LOGV2( - 20435, - "Failing command {command} via 'failCommand' failpoint: returning {errorCode}", - "Failing command via 'failCommand' failpoint", - "command"_attr = cmd->getName(), - "errorCode"_attr = errorCode); + LOGV2(20435, + "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: " + "returning error code {errorCode}.", + "cmd_getName"_attr = cmd->getName(), + "errorCode"_attr = errorCode); uasserted(ErrorCodes::Error(errorCode), "Failing command due to 'failCommand' failpoint"); } @@ -744,11 +741,10 @@ void CommandInvocation::checkAuthorization(OperationContext* opCtx, } } } catch (const DBException& e) { - LOGV2_ERROR_OPTIONS(20436, - {logComponentV1toV2(LogComponent::kAccessControl)}, - "Checking authorization failed: {error}", - "Checking authorization failed", - "error"_attr = e.toStatus()); + LOGV2_OPTIONS(20436, + {logComponentV1toV2(LogComponent::kAccessControl)}, + "{e_toStatus}", + "e_toStatus"_attr = e.toStatus()); CommandHelpers::auditLogAuthEvent(opCtx, this, request, e.code()); throw; } diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp index dbcfb3623f8..9fb791ecc30 100644 --- a/src/mongo/db/initialize_server_global_state.cpp +++ b/src/mongo/db/initialize_server_global_state.cpp @@ -111,7 +111,7 @@ void signalForkSuccess() { if (close(*f) == -1) { int savedErr = errno; LOGV2_WARNING(4656301, - "Closing write pipe failed", + "closing write pipe failed", "errno"_attr = savedErr, "errnoDesc"_attr = errnoWithDescription(savedErr)); } @@ -378,10 +378,9 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection, boost::filesystem::rename(absoluteLogpath, renameTarget, ec); if (!ec) { LOGV2(20697, - "Moving existing log file \"{oldLogPath}\" to \"{newLogPath}\"", - "Renamed existing log file", - "oldLogPath"_attr = absoluteLogpath, - "newLogPath"_attr = renameTarget); + "log file \"{absoluteLogpath}\" exists; moved to \"{renameTarget}\".", + "absoluteLogpath"_attr = absoluteLogpath, + "renameTarget"_attr = renameTarget); } else { return Status(ErrorCodes::FileRenameFailed, str::stream() @@ -428,8 +427,7 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection, javascriptAppender = std::make_unique<RotatableFileAppender<MessageEventEphemeral>>( std::make_unique<MessageEventDetailsEncoder>(), writer.getValue()); if (serverGlobalParams.logAppend && exists) { - LOGV2_WARNING_OPTIONS( - 20699, {logv2::LogTag::kStartupWarnings}, "***** SERVER RESTARTED *****"); + LOGV2(20699, "***** SERVER RESTARTED *****"); Status status = logger::RotatableFileWriter::Use(writer.getValue()).status(); if (!status.isOK()) return status; @@ -466,8 +464,7 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection, lv2Config.timestampFormat = serverGlobalParams.logTimestampFormat; Status result = lv2Manager.getGlobalDomainInternal().configure(lv2Config); if (result.isOK() && writeServerRestartedAfterLogConfig) - LOGV2_WARNING_OPTIONS( - 20698, {logv2::LogTag::kStartupWarnings}, "***** SERVER RESTARTED *****"); + LOGV2(20698, "***** SERVER RESTARTED *****"); return result; } diff --git a/src/mongo/db/log_process_details.cpp b/src/mongo/db/log_process_details.cpp index 744c478d6ca..f63401df6fd 100644 --- a/src/mongo/db/log_process_details.cpp +++ b/src/mongo/db/log_process_details.cpp @@ -95,11 +95,11 @@ void logProcessDetailsForLogRotate(ServiceContext* serviceContext) { if (rsConfig.isInitialized()) { LOGV2(20722, - "Node is a member of a replica set", + "Replica Set Config", "config"_attr = rsConfig, "memberState"_attr = replCoord->getMemberState()); } else { - LOGV2(20724, "Node currently has no replica set config"); + LOGV2(20724, "Node currently has no Replica Set Config."); } } diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index e0d4cf05cd5..5087f08864a 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -568,9 +568,11 @@ Status storeMongodOptions(const moe::Environment& params) { if (params.count("replication.enableMajorityReadConcern") && !params["replication.enableMajorityReadConcern"].as<bool>()) { - LOGV2_WARNING(20879, - "Ignoring read concern override as config server requires majority " - "read concern"); + LOGV2_WARNING( + 20879, + "Config servers require majority read concern, but it was explicitly " + "disabled. The override is being ignored and the process is continuing " + "with majority read concern enabled."); } serverGlobalParams.enableMajorityReadConcern = true; @@ -628,7 +630,7 @@ Status storeMongodOptions(const moe::Environment& params) { LOGV2(20877, ""); LOGV2_WARNING(20880, "32-bit servers don't have journaling enabled by default. Please use " - "--journal if you want durability"); + "--journal if you want durability."); LOGV2(20878, ""); } diff --git a/src/mongo/db/operation_killer.cpp b/src/mongo/db/operation_killer.cpp index 0cfa250504a..971b789e806 100644 --- a/src/mongo/db/operation_killer.cpp +++ b/src/mongo/db/operation_killer.cpp @@ -82,7 +82,7 @@ void OperationKiller::killOperation(OperationId opId) { serviceContext->killOperation(target, target->getOperationContext()); - LOGV2(20884, "Killed operation: {opId}", "Killed operation", "opId"_attr = opId); + LOGV2(20884, "Killed operation: {opId}", "opId"_attr = opId); } void OperationKiller::killOperation(const OperationKey& opKey) { |