Skip to content

Commit

Permalink
GEODE-10127: Reduces verbosity of log messages.
Browse files Browse the repository at this point in the history
Removes SSLConfig from toString.
Logs with original toString/marshalForClient string.
  • Loading branch information
jake-at-work committed Apr 8, 2022
1 parent 73f3dfd commit c71b70d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ public long getTimeStamp() {

@Override
public String toString() {
// Intentionally excludes sslConfig to avoid logging security sensitive values.

return "DistributionLocatorId{" +
"host=" + host +
", port=" + port +
", bindAddress='" + bindAddress + '\'' +
", sslConfig=" + sslConfig +
", hostnameForClients='" + hostnameForClients + '\'' +
", hostname='" + hostname + '\'' +
", memberName='" + memberName + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ private void exchangeLocalLocators() {
addExchangedLocators(response);
logger.info(
"Locator discovery task for locator {} exchanged locator information with {}: {}.",
request.getLocator(), locatorId, response.getLocators());
request.getLocator().marshalForClients(), locatorId.marshalForClients(),
response.getLocators());
break;
}
} catch (IOException ioe) {
Expand All @@ -178,13 +179,15 @@ private void exchangeLocalLocators() {
+ WAN_LOCATOR_CONNECTION_RETRY_ATTEMPT + " retry attempts", ioe);
logger.fatal(
"Locator discovery task for locator {} could not exchange locator information with {} after {} retry attempts.",
request.getLocator(), locatorId, retryAttempt, coe);
request.getLocator().marshalForClients(), locatorId.marshalForClients(), retryAttempt,
coe);
break;
}
if (skipFailureLogging(locatorId)) {
logger.warn(
"Locator discovery task for locator {} could not exchange locator information with {} after {} retry attempts. Retrying in {} ms.",
request.getLocator(), locatorId, retryAttempt, WAN_LOCATOR_CONNECTION_INTERVAL);
request.getLocator().marshalForClients(), locatorId.marshalForClients(), retryAttempt,
WAN_LOCATOR_CONNECTION_INTERVAL);
}
try {
if (!skipWaiting) {
Expand All @@ -211,7 +214,8 @@ public void exchangeRemoteLocators() {
addExchangedLocators(response);
logger.info(
"Locator discovery task for locator {} exchanged locator information with {}: {}.",
request.getLocator(), locatorId, response.getLocators());
request.getLocator().marshalForClients(), locatorId.marshalForClients(),
response.getLocators());
RemoteLocatorPingRequest pingRequest = new RemoteLocatorPingRequest("");
while (true) {
if (!skipWaiting) {
Expand All @@ -230,14 +234,15 @@ public void exchangeRemoteLocators() {
if (retryAttempt == WAN_LOCATOR_CONNECTION_RETRY_ATTEMPT) {
logger.fatal(
"Locator discovery task for locator {} could not exchange locator information with {} after {} retry attempts.",
request.getLocator(), locatorId, retryAttempt, ioe);
request.getLocator().marshalForClients(), locatorId.marshalForClients(), retryAttempt,
ioe);
break;
}
if (skipFailureLogging(locatorId)) {
logger.warn(
"Locator discovery task for locator {} could not exchange locator information with {} after {} retry attempts. Retrying in {} ms.",
new Object[] {request.getLocator(), locatorId, retryAttempt,
WAN_LOCATOR_CONNECTION_INTERVAL});
request.getLocator().marshalForClients(), locatorId.marshalForClients(), retryAttempt,
WAN_LOCATOR_CONNECTION_INTERVAL);
}
try {
if (!skipWaiting) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void setUp() {
discoverer = mock(WanLocatorDiscoverer.class);
locatorId = mock(DistributionLocatorId.class);
request = mock(RemoteLocatorJoinRequest.class);
when(request.getLocator()).thenReturn(mock(DistributionLocatorId.class));
LocatorMembershipListener listener = mock(LocatorMembershipListener.class);
locatorClient = mock(TcpClient.class);
locatorDiscovery =
Expand Down

0 comments on commit c71b70d

Please sign in to comment.