From c4e0b2609650f80dfd8aee0d4b34e1343e1b9d11 Mon Sep 17 00:00:00 2001 From: Henry Avetisyan Date: Wed, 21 Jun 2017 09:40:17 -0700 Subject: [PATCH] #157 domain updates in ZTS should be logged with INFO level --- .../java/com/yahoo/athenz/zts/store/DataStore.java | 12 ++++++------ .../athenz/zts/store/impl/S3ChangeLogStore.java | 4 ++-- .../athenz/zts/store/impl/ZMSFileChangeLogStore.java | 8 ++++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/servers/zts/src/main/java/com/yahoo/athenz/zts/store/DataStore.java b/servers/zts/src/main/java/com/yahoo/athenz/zts/store/DataStore.java index 6a93d4f7e5a..36c972c10be 100644 --- a/servers/zts/src/main/java/com/yahoo/athenz/zts/store/DataStore.java +++ b/servers/zts/src/main/java/com/yahoo/athenz/zts/store/DataStore.java @@ -338,8 +338,8 @@ public boolean processDomain(SignedDomain signedDomain, boolean saveInStore) { DomainData domainData = signedDomain.getDomain(); String domainName = domainData.getName(); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Processing domain: {}", domainName); + if (LOGGER.isInfoEnabled()) { + LOGGER.info("Processing domain: {}", domainName); } /* if the domain is disabled we're going to skip @@ -473,8 +473,8 @@ boolean processSignedDomains(SignedDomains signedDomains) { * from ZMS Server */ if (signedDomains == null) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("No updates received from ZMS Server"); + if (LOGGER.isInfoEnabled()) { + LOGGER.info("No updates received from ZMS Server"); } return true; } @@ -483,8 +483,8 @@ boolean processSignedDomains(SignedDomains signedDomains) { List domains = signedDomains.getDomains(); if (domains == null || domains.isEmpty()) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("No updates received from ZMS Server"); + if (LOGGER.isInfoEnabled()) { + LOGGER.info("No updates received from ZMS Server"); } return true; } diff --git a/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/S3ChangeLogStore.java b/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/S3ChangeLogStore.java index 0e909ce41ae..a513aa25954 100644 --- a/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/S3ChangeLogStore.java +++ b/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/S3ChangeLogStore.java @@ -216,8 +216,8 @@ public SignedDomains getUpdatedSignedDomains(StringBuilder lastModTimeBuffer) { ArrayList domains = new ArrayList<>(); listObjects(s3, domains, lastModTime); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("getUpdatedSignedDomains: {} updated domains", domains.size()); + if (LOGGER.isInfoEnabled()) { + LOGGER.info("getUpdatedSignedDomains: {} updated domains", domains.size()); } ArrayList signedDomainList = new ArrayList<>(); diff --git a/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/ZMSFileChangeLogStore.java b/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/ZMSFileChangeLogStore.java index ee26b439d4f..579598e75d3 100644 --- a/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/ZMSFileChangeLogStore.java +++ b/servers/zts/src/main/java/com/yahoo/athenz/zts/store/impl/ZMSFileChangeLogStore.java @@ -295,7 +295,7 @@ List getSignedDomainList(ZMSClient zmsClient, SignedDomains domain final String domainName = domain.getDomain().getName(); if (LOGGER.isDebugEnabled()) { - LOGGER.debug("getUpdatedSignedDomains: fetching domain {}", domainName); + LOGGER.debug("getSignedDomainList: fetching domain {}", domainName); } try { @@ -304,7 +304,7 @@ List getSignedDomainList(ZMSClient zmsClient, SignedDomains domain if (singleDomain == null || singleDomain.getDomains().isEmpty()) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("getUpdatedSignedDomains: unable to fetch domain {}", + LOGGER.debug("getSignedDomainList: unable to fetch domain {}", domainName); } continue; @@ -350,6 +350,10 @@ public SignedDomains getUpdatedSignedDomains(StringBuilder lastModTimeBuffer) { return null; } + if (LOGGER.isInfoEnabled()) { + LOGGER.info("getUpdatedSignedDomains: {} updated domains", domainList.getDomains().size()); + } + List domains = getSignedDomainList(zmsClient, domainList); return new SignedDomains().setDomains(domains);