From 654c18fd695d167ba5b24af75c94db77fff6d856 Mon Sep 17 00:00:00 2001 From: Miles Matthias Date: Mon, 10 Jun 2019 11:51:59 -0600 Subject: [PATCH] refactor(clouddriver): Add accountName to several startup logs for better debugging (#3769) --- .../v2/security/KubernetesV2Credentials.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/security/KubernetesV2Credentials.java b/clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/security/KubernetesV2Credentials.java index 757267822dc..0168a7ae127 100644 --- a/clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/security/KubernetesV2Credentials.java +++ b/clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/security/KubernetesV2Credentials.java @@ -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; } } @@ -318,14 +321,14 @@ 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; } } @@ -333,7 +336,7 @@ private void determineOmitKinds() { 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 { @@ -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; } }