summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.cpp
diff options
context:
space:
mode:
authorAmirsaman Memaripour <amirsaman.memaripour@mongodb.com>2020-03-26 10:45:50 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-27 05:03:52 +0000
commitbc67d9be07b35da807ae854960e24f9ed61e5d43 (patch)
treec72fb86eefad808b0f641c06b40326799f8a2924 /src/mongo/db/commands.cpp
parent019afd89c77629a3cabf93803314dd77f451276b (diff)
downloadmongo-bc67d9be07b35da807ae854960e24f9ed61e5d43.tar.gz
SERVER-47077 Clean up log lines in 'mongo/db'
Cleaning up log lines to adhere to the LOGV2 style guide.
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r--src/mongo/db/commands.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index 57b65cca648..3085027db40 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 '{cmd_getName}' via 'failCommand' failpoint. Action: "
- "closing connection.",
- "cmd_getName"_attr = cmd->getName());
+ "Failing {command} via 'failCommand' failpoint: closing connection",
+ "Failing command via 'failCommand' failpoint: closing connection",
+ "command"_attr = cmd->getName());
uasserted(50985, "Failing command due to 'failCommand' failpoint");
}
@@ -631,32 +631,35 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx,
blockTimeMS >= 0);
LOGV2(20432,
- "Blocking command '{cmd_getName}' via 'failCommand' failpoint for "
- "{blockTimeMS} milliseconds",
- "cmd_getName"_attr = cmd->getName(),
- "blockTimeMS"_attr = blockTimeMS);
+ "Blocking {command} via 'failCommand' failpoint for {blockTime}",
+ "Blocking command via 'failCommand' failpoint",
+ "command"_attr = cmd->getName(),
+ "blockTime"_attr = Milliseconds{blockTimeMS});
opCtx->sleepFor(Milliseconds{blockTimeMS});
LOGV2(20433,
- "Unblocking command '{cmd_getName}' via 'failCommand' failpoint",
- "cmd_getName"_attr = cmd->getName());
+ "Unblocking {command} via 'failCommand' failpoint",
+ "Unblocking command via 'failCommand' failpoint",
+ "command"_attr = cmd->getName());
}
if (hasExtraInfo) {
LOGV2(20434,
- "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: "
- "returning error code {errorCode} and {errorExtraInfo}.",
- "cmd_getName"_attr = cmd->getName(),
+ "Failing {command} via 'failCommand' failpoint: returning {errorCode} and "
+ "{errorExtraInfo}",
+ "Failing command via 'failCommand' failpoint",
+ "command"_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 '{cmd_getName}' via 'failCommand' failpoint. Action: "
- "returning error code {errorCode}.",
- "cmd_getName"_attr = cmd->getName(),
- "errorCode"_attr = errorCode);
+ LOGV2(
+ 20435,
+ "Failing command {command} via 'failCommand' failpoint: returning {errorCode}",
+ "Failing command via 'failCommand' failpoint",
+ "command"_attr = cmd->getName(),
+ "errorCode"_attr = errorCode);
uasserted(ErrorCodes::Error(errorCode),
"Failing command due to 'failCommand' failpoint");
}
@@ -741,10 +744,11 @@ void CommandInvocation::checkAuthorization(OperationContext* opCtx,
}
}
} catch (const DBException& e) {
- LOGV2_OPTIONS(20436,
- {logComponentV1toV2(LogComponent::kAccessControl)},
- "{e_toStatus}",
- "e_toStatus"_attr = e.toStatus());
+ LOGV2_ERROR_OPTIONS(20436,
+ {logComponentV1toV2(LogComponent::kAccessControl)},
+ "Checking authorization failed: {error}",
+ "Checking authorization failed",
+ "error"_attr = e.toStatus());
CommandHelpers::auditLogAuthEvent(opCtx, this, request, e.code());
throw;
}