Skip to content

Commit

Permalink
refactor(clouddriver): Add accountName to several startup logs for be…
Browse files Browse the repository at this point in the history
…tter debugging (#3769)
  • Loading branch information
Miles Matthias authored and ezimanyi committed Jun 10, 2019
1 parent 96a4835 commit 654c18f
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ public String lookupDefaultNamespace() {
}
} catch (Exception e) {
log.debug(
"Error encountered looking up default namespace, defaulting to {}", DEFAULT_NAMESPACE, e);
"Error encountered looking up default namespace in account '{}', defaulting to {}",
accountName,
DEFAULT_NAMESPACE,
e);
return DEFAULT_NAMESPACE;
}
}
Expand Down Expand Up @@ -318,22 +321,22 @@ private void determineOmitKinds() {

if (metrics) {
try {
log.info("Checking if pod metrics are readable...");
log.info("Checking if pod metrics are readable for account {}...", accountName);
topPod(checkNamespace, null);
} catch (Exception e) {
log.warn(
"Could not read pod metrics in account '{}' for reason: {}",
accountName,
e.getMessage());
log.debug("Reading logs failed with exception: ", e);
log.debug("Reading logs for account '{}' failed with exception: ", accountName, e);
metrics = false;
}
}
}

private boolean canReadKind(KubernetesKind kind, String checkNamespace) {
try {
log.info("Checking if {} is readable...", kind);
log.info("Checking if {} is readable in account '{}'...", kind, accountName);
if (kind.isNamespaced()) {
list(kind, checkNamespace);
} else {
Expand All @@ -346,7 +349,7 @@ private boolean canReadKind(KubernetesKind kind, String checkNamespace) {
kind,
accountName,
e.getMessage());
log.debug("Reading kind '{}' failed with exception: ", kind, e);
log.debug("Reading kind '{}' in account '{}' failed with exception: ", kind, accountName, e);
return false;
}
}
Expand Down

0 comments on commit 654c18f

Please sign in to comment.