diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-04-09 18:31:51 -0400 |
---|---|---|
committer | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-04-09 18:31:51 -0400 |
commit | 408888993045ebf65e05f3fe6070d58580b774f8 (patch) | |
tree | 36f5d06311a7346905bd5b119c4bf348d23469a3 /src/mongo/db/transaction_participant.cpp | |
parent | dc87a07c682d5a0f143c924bd12e771a6453c507 (diff) | |
download | mongo-408888993045ebf65e05f3fe6070d58580b774f8.tar.gz |
SERVER-40329: Log all transactions at TXN verbosity levels >= 1
Diffstat (limited to 'src/mongo/db/transaction_participant.cpp')
-rw-r--r-- | src/mongo/db/transaction_participant.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp index 190fe6a09a7..3c8c8353ca7 100644 --- a/src/mongo/db/transaction_participant.cpp +++ b/src/mongo/db/transaction_participant.cpp @@ -1805,8 +1805,10 @@ void TransactionParticipant::Participant::_logSlowTransaction( // Only log multi-document transactions. if (!o().txnState.isInRetryableWriteMode()) { const auto tickSource = opCtx->getServiceContext()->getTickSource(); - // Log the transaction if its duration is longer than the slowMS command threshold. - if (o().transactionMetricsObserver.getSingleTransactionStats().getDuration( + // Log the transaction if log message verbosity for transaction component is >= 1 or its + // duration is longer than the slowMS command threshold. + if (shouldLog(logger::LogComponent::kTransaction, logger::LogSeverity::Debug(1)) || + o().transactionMetricsObserver.getSingleTransactionStats().getDuration( tickSource, tickSource->getTicks()) > Milliseconds(serverGlobalParams.slowMS)) { log(logger::LogComponent::kTransaction) << "transaction " |