diff options
-rw-r--r-- | src/mongo/db/curop.cpp | 17 | ||||
-rw-r--r-- | src/mongo/db/instance.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/ops/write_ops_exec.cpp | 2 | ||||
-rw-r--r-- | src/mongo/logger/redaction.cpp | 1 |
4 files changed, 11 insertions, 11 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; } diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp index 130d32dc594..352114161f9 100644 --- a/src/mongo/db/instance.cpp +++ b/src/mongo/db/instance.cpp @@ -695,7 +695,7 @@ void assembleResponse(OperationContext* txn, if (shouldLogOpDebug || debug.executionTime > logThreshold) { Locker::LockerInfo lockerInfo; txn->lockState()->getLockerInfo(&lockerInfo); - log() << redact(debug.report(&c, currentOp, lockerInfo.stats)); + log() << debug.report(&c, currentOp, lockerInfo.stats); } if (currentOp.shouldDBProfile(debug.executionTime)) { diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index 1dc30e1aae4..cba843c9315 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -112,7 +112,7 @@ void finishCurOp(OperationContext* txn, CurOp* curOp) { if (logAll || logSlow) { Locker::LockerInfo lockerInfo; txn->lockState()->getLockerInfo(&lockerInfo); - log() << redact(curOp->debug().report(txn->getClient(), *curOp, lockerInfo.stats)); + log() << curOp->debug().report(txn->getClient(), *curOp, lockerInfo.stats); } if (curOp->shouldDBProfile(executionTimeMs)) { diff --git a/src/mongo/logger/redaction.cpp b/src/mongo/logger/redaction.cpp index c66d50fdb83..1ec2d1e7cf9 100644 --- a/src/mongo/logger/redaction.cpp +++ b/src/mongo/logger/redaction.cpp @@ -33,7 +33,6 @@ #include "mongo/base/status.h" #include "mongo/bson/bsonobj.h" -#include "mongo/bson/mutable/document.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" |