Swap Logger to SLF4J 07/75007/1
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>
Thu, 20 Dec 2018 16:33:30 +0000 (11:33 -0500)
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>
Thu, 20 Dec 2018 16:37:52 +0000 (11:37 -0500)
Issue-ID: SO-1346

Change-Id: Ia0d7cd7f66e6f5d6976e19e5c56efbe7d02aa98f
Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
openstack-client-connectors/http-connector/pom.xml
openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java
openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java

index 6481b2e..c62be3a 100644 (file)
@@ -1,30 +1,34 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
-    <artifactId>client-connectors</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-  </parent>
-
-  <groupId>org.onap.so.libs.openstack-java-sdk.client-connectors</groupId>
-  <artifactId>http-connector</artifactId>
-  <name>OpenStack HTTP-Client Connector</name>
-  <description>OpenStack HTTP-Client Connector</description>
-  <dependencies>
-       <dependency>
-               <groupId>org.apache.httpcomponents</groupId>
-               <artifactId>httpclient</artifactId>
-       </dependency>
-       <!-- bwj: added httpcore -->
-       <dependency>
-               <groupId>org.apache.httpcomponents</groupId>
-               <artifactId>httpcore</artifactId>
-       </dependency>
-       <dependency>
-               <groupId>log4j</groupId>
-               <artifactId>log4j</artifactId>
-               <version>1.2.17</version>
-       </dependency>
-  </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
+               <artifactId>client-connectors</artifactId>
+               <version>1.4.0-SNAPSHOT</version>
+       </parent>
 
+       <groupId>org.onap.so.libs.openstack-java-sdk.client-connectors</groupId>
+       <artifactId>http-connector</artifactId>
+       <name>OpenStack HTTP-Client Connector</name>
+       <description>OpenStack HTTP-Client Connector</description>
+       <dependencies>
+               <dependency>
+                       <groupId>org.apache.httpcomponents</groupId>
+                       <artifactId>httpclient</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.httpcomponents</groupId>
+                       <artifactId>httpcore</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>slf4j-api</artifactId>
+                       <version>1.7.25</version>
+               </dependency>
+               <dependency>
+                       <groupId>ch.qos.logback</groupId>
+                       <artifactId>logback-classic</artifactId>
+                       <version>1.2.3</version>
+               </dependency>
+       </dependencies>
 </project>
index 85ac96c..5a78b30 100644 (file)
@@ -46,7 +46,8 @@ import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.annotation.JsonRootName;
@@ -65,7 +66,7 @@ public class HttpClientConnector implements OpenStackClientConnector {
     public static ObjectMapper DEFAULT_MAPPER;
     public static ObjectMapper WRAPPED_MAPPER;
     
-    private static Logger LOGGER = Logger.getLogger(HttpClientConnector.class);
+    private static Logger LOGGER = LoggerFactory.getLogger(HttpClientConnector.class);
 
     static {
         DEFAULT_MAPPER = new ObjectMapper();
@@ -123,7 +124,6 @@ public class HttpClientConnector implements OpenStackClientConnector {
                 String entityJson = mapper.writeValueAsString (request.entity().getEntity());
                 entity = new StringEntity(entityJson, ContentType.create(request.entity().getContentType()));
 
-                LOGGER.debug("Openstack query JSON:"+entityJson);
                 LOGGER.debug ("Request JSON Body: " + entityJson.replaceAll("\"password\":\"[^\"]*\"", "\"password\":\"***\""));
 
             } catch (JsonProcessingException e) {
index 711d4e5..41466a6 100644 (file)
@@ -41,7 +41,8 @@ package com.woorea.openstack.connector;
 
 import org.apache.http.Header;
 import org.apache.http.HttpResponse;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.woorea.openstack.base.client.OpenStackResponse;
@@ -55,7 +56,7 @@ import java.util.Map;
 
 public class HttpClientResponse implements OpenStackResponse {
 
-    private static Logger LOGGER = Logger.getLogger(HttpClientConnector.class);
+    private static Logger LOGGER = LoggerFactory.getLogger(HttpClientConnector.class);
     
     private HttpResponse response = null;
     private String entityBody = null;