Commit 57c7e85e by Pierre Padovani Committed by apoorvnaik

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

parent 45bf48e6
...@@ -327,12 +327,14 @@ public abstract class AtlasBaseClient { ...@@ -327,12 +327,14 @@ public abstract class AtlasBaseClient {
ClientResponse clientResponse = null; ClientResponse clientResponse = null;
int i = 0; int i = 0;
do { do {
LOG.info("------------------------------------------------------"); if (LOG.isDebugEnabled()) {
LOG.info("Call : {} {}", api.getMethod(), api.getNormalizedPath()); LOG.debug("------------------------------------------------------");
LOG.info("Content-type : {} ", api.getConsumes()); LOG.debug("Call : {} {}", api.getMethod(), api.getNormalizedPath());
LOG.info("Accept : {} ", api.getProduces()); LOG.debug("Content-type : {} ", api.getConsumes());
if (requestObject != null) { LOG.debug("Accept : {} ", api.getProduces());
LOG.info("Request : {}", requestObject); if (requestObject != null) {
LOG.debug("Request : {}", requestObject);
}
} }
WebResource.Builder requestBuilder = resource.getRequestBuilder(); WebResource.Builder requestBuilder = resource.getRequestBuilder();
...@@ -349,7 +351,12 @@ public abstract class AtlasBaseClient { ...@@ -349,7 +351,12 @@ public abstract class AtlasBaseClient {
clientResponse = requestBuilder.method(api.getMethod(), ClientResponse.class, requestObject); 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 (clientResponse.getStatus() == api.getExpectedStatus().getStatusCode()) {
if (responseType == null) { if (responseType == null) {
...@@ -360,16 +367,16 @@ public abstract class AtlasBaseClient { ...@@ -360,16 +367,16 @@ public abstract class AtlasBaseClient {
String stringEntity = clientResponse.getEntity(String.class); String stringEntity = clientResponse.getEntity(String.class);
try { try {
JsonNode jsonObject = AtlasJson.parseToV1JsonNode(stringEntity); JsonNode jsonObject = AtlasJson.parseToV1JsonNode(stringEntity);
LOG.info("Response : {}", jsonObject); LOG.debug("Response : {}", jsonObject);
LOG.info("------------------------------------------------------"); LOG.debug("------------------------------------------------------");
return (T) jsonObject; return (T) jsonObject;
} catch (IOException e) { } catch (IOException e) {
throw new AtlasServiceException(api, e); throw new AtlasServiceException(api, e);
} }
} else { } else {
T entity = clientResponse.getEntity(responseType); T entity = clientResponse.getEntity(responseType);
LOG.info("Response : {}", entity); LOG.debug("Response : {}", entity);
LOG.info("------------------------------------------------------"); LOG.debug("------------------------------------------------------");
return entity; return entity;
} }
} catch (ClientHandlerException e) { } catch (ClientHandlerException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment