package org.onap.aai.restclient;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URISyntaxException;
public abstract class RestClient {
- private static EELFLogger log = EELFManager.getInstance().getLogger(RestClient.class);
+ private static Logger log = LoggerFactory.getLogger(RestClient.class);
@Value("${spring.application.name}")
protected String appName;
/**
* Execute the given http method against the uri with passed headers
- *
+ *
* @param uri properly encoded, can include query params also properly encoded
* @param method http method of the request
* @param headers headers for the request
throws RestClientException {
HttpEntity<String> httpEntity;
- log.debug("Headers: {}", headers);
+ log.debug("Request Headers: {}", headers);
if (body == null) {
httpEntity = new HttpEntity<>(getHeaders(headers));
} else {
log.error("URL syntax error with url {}{}", getBaseUrl(), uri);
throw new RestClientException(e.getMessage());
}
- log.debug("METHOD={},URL={},HEADERS={}", method, url, httpEntity);
-
+ log.debug("METHOD={}, URL={}, BODY={}", method, url, httpEntity.getBody());
ResponseEntity responseEntity = getRestTemplate().exchange(url, method, httpEntity, String.class);
- log.debug("RESPONSE={}", responseEntity);
+ log.trace("RESPONSE={}", responseEntity);
return responseEntity;
}
/**
* Execute the given http method against the uri with passed headers
- *
+ *
* @param uri properly encoded, can include query params also properly encoded
* @param method http method of the request
* @param headers headers for the request
/**
* Execute the given http method against the uri with passed headers
- *
+ *
* @param uri properly encoded, can include query params also properly encoded
* @param method http method of the request
* @param headers headers for the request
/**
* Execute the given http method against the uri with passed headers
- *
+ *
* @param uri properly encoded, can include query params also properly encoded
* @param method http method of the request
* @param headers headers for the request