summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/deferred_writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/concurrency/deferred_writer.cpp')
-rw-r--r--src/mongo/db/concurrency/deferred_writer.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/db/concurrency/deferred_writer.cpp b/src/mongo/db/concurrency/deferred_writer.cpp
index 4bedbe1995c..b06d4faa127 100644
--- a/src/mongo/db/concurrency/deferred_writer.cpp
+++ b/src/mongo/db/concurrency/deferred_writer.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/operation_context.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/concurrency/idle_thread_block.h"
#include "mongo/util/concurrency/thread_pool.h"
#include "mongo/util/log.h"
@@ -47,7 +48,10 @@ auto kLogInterval = stdx::chrono::minutes(1);
void DeferredWriter::_logFailure(const Status& status) {
if (TimePoint::clock::now() - _lastLogged > kLogInterval) {
- log() << "Unable to write to collection " << _nss.toString() << ": " << status.toString();
+ LOGV2(20516,
+ "Unable to write to collection {nss}: {status}",
+ "nss"_attr = _nss.toString(),
+ "status"_attr = status.toString());
_lastLogged = stdx::chrono::system_clock::now();
}
}
@@ -55,8 +59,11 @@ void DeferredWriter::_logFailure(const Status& status) {
void DeferredWriter::_logDroppedEntry() {
_droppedEntries += 1;
if (TimePoint::clock::now() - _lastLoggedDrop > kLogInterval) {
- log() << "Deferred write buffer for " << _nss.toString() << " is full. " << _droppedEntries
- << " entries have been dropped.";
+ LOGV2(
+ 20517,
+ "Deferred write buffer for {nss} is full. {droppedEntries} entries have been dropped.",
+ "nss"_attr = _nss.toString(),
+ "droppedEntries"_attr = _droppedEntries);
_lastLoggedDrop = stdx::chrono::system_clock::now();
_droppedEntries = 0;
}