diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2020-02-13 11:49:46 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-13 18:16:35 +0000 |
commit | a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761 (patch) | |
tree | 85ac46cd5f4ea6d5134560bf764fb9e6cf11fe4e /src/mongo/db/log_process_details.cpp | |
parent | 6df40e01f7b6899affc4536e7e73a35802cabf98 (diff) | |
download | mongo-a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761.tar.gz |
SERVER-45869 automatically converted structured logging
Diffstat (limited to 'src/mongo/db/log_process_details.cpp')
-rw-r--r-- | src/mongo/db/log_process_details.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/mongo/db/log_process_details.cpp b/src/mongo/db/log_process_details.cpp index 9e30fc04822..140f0f51495 100644 --- a/src/mongo/db/log_process_details.cpp +++ b/src/mongo/db/log_process_details.cpp @@ -51,7 +51,7 @@ bool is32bit() { void logProcessDetails() { auto&& vii = VersionInfoInterface::instance(); - log() << mongodVersion(vii); + LOGV2(20719, "{mongodVersion_vii}", "mongodVersion_vii"_attr = mongodVersion(vii)); vii.logBuildInfo(); ProcessInfo p; @@ -61,17 +61,24 @@ void logProcessDetails() { "version"_attr = p.getOsVersion()); if (ProcessInfo::getMemSizeMB() < ProcessInfo::getSystemMemSizeMB()) { - log() << ProcessInfo::getMemSizeMB() << " MB of memory available to the process out of " - << ProcessInfo::getSystemMemSizeMB() << " MB total system memory"; + LOGV2(20720, + "{ProcessInfo_getMemSizeMB} MB of memory available to the process out of " + "{ProcessInfo_getSystemMemSizeMB} MB total system memory", + "ProcessInfo_getMemSizeMB"_attr = ProcessInfo::getMemSizeMB(), + "ProcessInfo_getSystemMemSizeMB"_attr = ProcessInfo::getSystemMemSizeMB()); } printCommandLineOpts(); } void logProcessDetailsForLogRotate(ServiceContext* serviceContext) { - log() << "pid=" << ProcessId::getCurrent() << " port=" << serverGlobalParams.port - << (is32bit() ? " 32" : " 64") << "-bit " - << "host=" << getHostNameCached(); + LOGV2(20721, + "pid={ProcessId_getCurrent} port={serverGlobalParams_port}{is32bit_32_64}-bit " + "host={getHostNameCached}", + "ProcessId_getCurrent"_attr = ProcessId::getCurrent(), + "serverGlobalParams_port"_attr = serverGlobalParams.port, + "is32bit_32_64"_attr = (is32bit() ? " 32" : " 64"), + "getHostNameCached"_attr = getHostNameCached()); auto replCoord = repl::ReplicationCoordinator::get(serviceContext); if (replCoord != nullptr && @@ -79,10 +86,12 @@ void logProcessDetailsForLogRotate(ServiceContext* serviceContext) { auto rsConfig = replCoord->getConfig(); if (rsConfig.isInitialized()) { - log() << "Replica Set Config: " << rsConfig.toBSON(); - log() << "Replica Set Member State: " << (replCoord->getMemberState()).toString(); + LOGV2(20722, "Replica Set Config: {rsConfig}", "rsConfig"_attr = rsConfig.toBSON()); + LOGV2(20723, + "Replica Set Member State: {replCoord_getMemberState}", + "replCoord_getMemberState"_attr = (replCoord->getMemberState()).toString()); } else { - log() << "Node currently has no Replica Set Config."; + LOGV2(20724, "Node currently has no Replica Set Config."); } } |