You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ap...@apache.org on 2018/04/23 19:55:19 UTC

atlas git commit: ATLAS-2564: Change logging levels within the client to reduce verbosity

Repository: atlas
Updated Branches:
  refs/heads/master 45bf48e6e -> 57c7e85ec


ATLAS-2564: Change logging levels within the client to reduce verbosity

Signed-off-by: apoorvnaik <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/57c7e85e
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/57c7e85e
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/57c7e85e

Branch: refs/heads/master
Commit: 57c7e85ec126f7f4cb6df0edcd6076dd2266667a
Parents: 45bf48e
Author: Pierre Padovani <pi...@civitaslearning.com>
Authored: Thu Apr 12 12:38:38 2018 -0500
Committer: apoorvnaik <ap...@apache.org>
Committed: Mon Apr 23 12:55:08 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/atlas/AtlasBaseClient.java  | 29 ++++++++++++--------
 1 file changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/57c7e85e/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
----------------------------------------------------------------------
diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
index 551b7b6..5144b25 100644
--- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
+++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
@@ -327,12 +327,14 @@ public abstract class AtlasBaseClient {
         ClientResponse clientResponse = null;
         int i = 0;
         do {
-            LOG.info("------------------------------------------------------");
-            LOG.info("Call         : {} {}", api.getMethod(), api.getNormalizedPath());
-            LOG.info("Content-type : {} ", api.getConsumes());
-            LOG.info("Accept       : {} ", api.getProduces());
-            if (requestObject != null) {
-                LOG.info("Request      : {}", requestObject);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("------------------------------------------------------");
+                LOG.debug("Call         : {} {}", api.getMethod(), api.getNormalizedPath());
+                LOG.debug("Content-type : {} ", api.getConsumes());
+                LOG.debug("Accept       : {} ", api.getProduces());
+                if (requestObject != null) {
+                    LOG.debug("Request      : {}", requestObject);
+                }
             }
 
             WebResource.Builder requestBuilder = resource.getRequestBuilder();
@@ -349,7 +351,12 @@ public abstract class AtlasBaseClient {
 
             clientResponse = requestBuilder.method(api.getMethod(), ClientResponse.class, requestObject);
 
-            LOG.info("HTTP Status  : {}", clientResponse.getStatus());
+            LOG.debug("HTTP Status  : {}", clientResponse.getStatus());
+
+            if (!LOG.isDebugEnabled()) {
+                LOG.info("method={} path={} contentType={} accept={} status={}", api.getMethod(),
+                    api.getNormalizedPath(), api.getConsumes(), api.getProduces(), clientResponse.getStatus());
+            }
 
             if (clientResponse.getStatus() == api.getExpectedStatus().getStatusCode()) {
                 if (responseType == null) {
@@ -360,16 +367,16 @@ public abstract class AtlasBaseClient {
                         String stringEntity = clientResponse.getEntity(String.class);
                         try {
                             JsonNode jsonObject = AtlasJson.parseToV1JsonNode(stringEntity);
-                            LOG.info("Response     : {}", jsonObject);
-                            LOG.info("------------------------------------------------------");
+                            LOG.debug("Response     : {}", jsonObject);
+                            LOG.debug("------------------------------------------------------");
                             return (T) jsonObject;
                         } catch (IOException e) {
                             throw new AtlasServiceException(api, e);
                         }
                     } else {
                         T entity = clientResponse.getEntity(responseType);
-                        LOG.info("Response     : {}", entity);
-                        LOG.info("------------------------------------------------------");
+                        LOG.debug("Response     : {}", entity);
+                        LOG.debug("------------------------------------------------------");
                         return entity;
                     }
                 } catch (ClientHandlerException e) {