summaryrefslogtreecommitdiff
path: root/src/mongo/db/ftdc/file_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/ftdc/file_manager.cpp')
-rw-r--r--src/mongo/db/ftdc/file_manager.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/mongo/db/ftdc/file_manager.cpp b/src/mongo/db/ftdc/file_manager.cpp
index 61ac60fcc48..783e9793c55 100644
--- a/src/mongo/db/ftdc/file_manager.cpp
+++ b/src/mongo/db/ftdc/file_manager.cpp
@@ -43,6 +43,7 @@
#include "mongo/db/ftdc/constants.h"
#include "mongo/db/ftdc/file_reader.h"
#include "mongo/db/jsobj.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
#include "mongo/util/str.h"
@@ -227,8 +228,12 @@ Status FTDCFileManager::trimDirectory(std::vector<boost::filesystem::path>& file
size += fileSize;
if (size >= maxSize) {
- LOG(1) << "Cleaning file over full-time diagnostic data capture quota, file: "
- << (*it).generic_string() << " with size " << fileSize;
+ LOGV2_DEBUG(20628,
+ 1,
+ "Cleaning file over full-time diagnostic data capture quota, file: "
+ "{it_generic_string} with size {fileSize}",
+ "it_generic_string"_attr = (*it).generic_string(),
+ "fileSize"_attr = fileSize);
boost::filesystem::remove(*it, ec);
if (ec) {
@@ -257,8 +262,9 @@ FTDCFileManager::recoverInterimFile() {
boost::system::error_code ec;
size_t size = boost::filesystem::file_size(interimFile, ec);
if (ec) {
- log() << "Recover interim file failed as the file size could not be checked: "
- << ec.message();
+ LOGV2(20629,
+ "Recover interim file failed as the file size could not be checked: {ec_message}",
+ "ec_message"_attr = ec.message());
return docs;
}
@@ -269,11 +275,12 @@ FTDCFileManager::recoverInterimFile() {
FTDCFileReader read;
auto s = read.open(interimFile);
if (!s.isOK()) {
- log() << "Unclean full-time diagnostic data capture shutdown detected, found interim file, "
- "but failed "
- "to open it, some "
- "metrics may have been lost. "
- << s;
+ LOGV2(20630,
+ "Unclean full-time diagnostic data capture shutdown detected, found interim file, "
+ "but failed "
+ "to open it, some "
+ "metrics may have been lost. {s}",
+ "s"_attr = s);
// Note: We ignore any actual errors as reading from the interim files is a best-effort
return docs;
@@ -288,10 +295,11 @@ FTDCFileManager::recoverInterimFile() {
// Warn if the interim file was corrupt or we had an unclean shutdown
if (!m.isOK() || !docs.empty()) {
- log() << "Unclean full-time diagnostic data capture shutdown detected, found interim file, "
- "some "
- "metrics may have been lost. "
- << m.getStatus();
+ LOGV2(20631,
+ "Unclean full-time diagnostic data capture shutdown detected, found interim file, "
+ "some "
+ "metrics may have been lost. {m_getStatus}",
+ "m_getStatus"_attr = m.getStatus());
}
// Note: We ignore any actual errors as reading from the interim files is a best-effort