summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index 9d14fbd44c5..0ac989e3d20 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+// CHECK_LOG_REDACTION
+
#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault
#include "mongo/platform/basic.h"
@@ -441,28 +443,27 @@ string OpDebug::report(Client* client,
mutablebson::Document cmdToLog(query, mutablebson::Document::kInPlaceDisabled);
curCommand->redactForLogging(&cmdToLog);
s << curCommand->getName() << " ";
- s << cmdToLog.toString();
+ s << redact(cmdToLog.getObject());
} else { // Should not happen but we need to handle curCommand == NULL gracefully.
- s << query.toString();
+ s << redact(query);
}
} else {
s << " query: ";
- s << query.toString();
+ s << redact(query);
}
}
auto originatingCommand = curop.originatingCommand();
if (!originatingCommand.isEmpty()) {
- s << " originatingCommand: " << originatingCommand;
+ s << " originatingCommand: " << redact(originatingCommand);
}
if (!curop.getPlanSummary().empty()) {
- s << " planSummary: " << curop.getPlanSummary();
+ s << " planSummary: " << redact(curop.getPlanSummary().toString());
}
if (!updateobj.isEmpty()) {
- s << " update: ";
- updateobj.toString(s);
+ s << " update: " << redact(updateobj);
}
auto collation = curop.collation();
@@ -506,7 +507,7 @@ string OpDebug::report(Client* client,
}
if (!exceptionInfo.empty()) {
- s << " exception: " << exceptionInfo.msg;
+ s << " exception: " << redact(exceptionInfo.msg);
if (exceptionInfo.code)
s << " code:" << exceptionInfo.code;
}