diff --git a/libstuff/SLog.cpp b/libstuff/SLog.cpp index 107269ef0..bb3943082 100644 --- a/libstuff/SLog.cpp +++ b/libstuff/SLog.cpp @@ -41,57 +41,17 @@ void SLogStackTrace(int level) { } // If the param name is not in this whitelist, we will log in addLogParams. -static const set PARAMS_WHITELIST = { - "accountID", - "authEmail", - "accountIDs", - "attendees", - "bankAccountID", - "cardData", - "cardID", - "clientUpdateID", +static set PARAMS_WHITELIST = { "command", - "companyName", - "companyWebsite", "Connection", "Content-Length", "count", - "currentTime", - "domainAccountID", - "domainName", - "email", - "errorMessage", - "feed", - "feedCountry", - "feedID", - "feedName", - "field", - "index", "indexName", - "invoice", "isUnique", - "key", - "lastIP", "logParam", - "nvpName", - "policyAccountID", - "policyID", - "reimbursementEntryID", - "reportID", "requestID", - "requestTimestamp", - "secondaryLogin", - "shouldCompleteOnboarding", - "shouldDismissHybridAppOnboarding", "status", - "step", - "timeDiff", - "token", - "transactionID", - "type", "userID", - "secondaryLogin", - "walletBankAccountID" }; string addLogParams(string&& message, const STable& params) { @@ -114,3 +74,7 @@ string addLogParams(string&& message, const STable& params) { return message; } + +void SWhitelistLogParams(set params) { + PARAMS_WHITELIST.insert(params.begin(), params.end()); +} diff --git a/libstuff/libstuff.h b/libstuff/libstuff.h index 1d8bddc91..c4dcf084f 100644 --- a/libstuff/libstuff.h +++ b/libstuff/libstuff.h @@ -233,6 +233,9 @@ void SLogLevel(int level); // Stack trace logging void SLogStackTrace(int level = LOG_WARNING); +// This method will allow plugins to whitelist log params they need to log. +void SWhitelistLogParams(set params); + // This is a drop-in replacement for syslog that directly logs to `/run/systemd/journal/syslog` bypassing journald. void SSyslogSocketDirect(int priority, const char* format, ...); diff --git a/sqlitecluster/SQLite.cpp b/sqlitecluster/SQLite.cpp index 5ea59ced0..e4f63acb2 100644 --- a/sqlitecluster/SQLite.cpp +++ b/sqlitecluster/SQLite.cpp @@ -806,7 +806,7 @@ int SQLite::commit(const string& description, function* preCheckpointCal } _sharedData.checkpointInProgress.clear(); } - SINFO(description << " COMMIT complete in " << time << ". Wrote " << (endPages - startPages) + SINFO(description << " COMMIT " << SToStr(_sharedData.commitCount) << " complete in " << time << ". Wrote " << (endPages - startPages) << " pages. WAL file size is " << sz << " bytes. " << _queryCount << " queries attempted, " << _cacheHits << " served from cache. Used journal " << _journalName); _queryCount = 0; diff --git a/test/clustertest/tests/ForkedNodeApprovalTest.cpp b/test/clustertest/tests/ForkedNodeApprovalTest.cpp index 1b3f982c4..197b883cc 100644 --- a/test/clustertest/tests/ForkedNodeApprovalTest.cpp +++ b/test/clustertest/tests/ForkedNodeApprovalTest.cpp @@ -152,5 +152,10 @@ struct ForkedNodeApprovalTest : tpunit::TestFixture { // Ok, now we can start the second follower back up and secondary leader should be able to lead. tester.getTester(2).startServer(false); ASSERT_TRUE(tester.getTester(1).waitForState("LEADING")); + + // We call stopServer on the forked leader because it crashed, but the cluster tester doesn't realize, so shutting down + // normally will time out after a minute. Calling `stopServer` explicitly will clear the server PID, and we won't need + // to wait for this timeout. + tester.getTester(0).stopServer(); } } __ForkedNodeApprovalTest;