Skip to content

Commit bdb4e48

Browse files
ikhoontrustin
authored andcommitted
Add Central Dogma to client's warn, error messages (#466)
Motivation: We have been informed that Central Dogma message itself is indistinguishable from other messages. ``` Failed to watch a file (/path/to/file); trying again ``` Modification: * Add `Central Dogma` to client warn and error messages Result: A user can easily distinguish Central Dogma client warn and error log messages from other messages
1 parent 5b2dc02 commit bdb4e48

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/CentralDogmaEndpointGroup.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ private void registerWatcher() {
106106
}
107107
setEndpoints(newEndpoints);
108108
} catch (Exception e) {
109-
logger.warn("Failed to refresh the endpoint list.", e);
109+
logger.warn("Failed to re-retrieve the endpoint list from Central Dogma.", e);
110110
}
111111
});
112112
instanceListWatcher.initialValueFuture().exceptionally(e -> {
113-
logger.warn("Failed to initialize instance list.", e);
113+
logger.warn("Failed to retrieve the initial instance list from Central Dogma.", e);
114114
return null;
115115
});
116116
}

client/java/src/main/java/com/linecorp/centraldogma/internal/client/AbstractWatcher.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ private void doWatch(int numAttemptsSoFar) {
265265
}
266266

267267
if (!logged) {
268-
logger.warn("Failed to watch a file ({}/{}{}); trying again",
268+
logger.warn("Failed to watch a file ({}/{}{}) at Central Dogma; trying again",
269269
projectName, repositoryName, pathPattern, cause);
270270
}
271271

272272
scheduleWatch(numAttemptsSoFar + 1);
273273
} catch (Throwable t) {
274-
logger.error("Unexpected exception while watching a file:", t);
274+
logger.error("Unexpected exception while watching a file at Central Dogma:", t);
275275
}
276276
return null;
277277
});

client/java/src/main/java/com/linecorp/centraldogma/internal/client/ReplicationLagTolerantCentralDogma.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,12 @@ private <T> CompletableFuture<T> executeWithRetries(
621621
if (!retryRequired || nextAttemptsSoFar > maxRetries) {
622622
if (retryRequired) {
623623
if (currentReplicaHint != null) {
624-
logger.warn("[{}] Failed to retrieve the up-to-date data after {} retries: {} => {}",
624+
logger.warn("[{}] Failed to retrieve the up-to-date data from Central Dogma " +
625+
"after {} retries: {} => {}",
625626
currentReplicaHint, attemptsSoFar, taskRunner, resultOrCause(res, cause));
626627
} else {
627-
logger.warn("Failed to retrieve the up-to-date data after {} retries: {} => {}",
628+
logger.warn("Failed to retrieve the up-to-date data from Central Dogma " +
629+
"after {} retries: {} => {}",
628630
attemptsSoFar, taskRunner, resultOrCause(res, cause));
629631
}
630632
} else if (logger.isDebugEnabled()) {

0 commit comments

Comments
 (0)