Add log message when gson used
Added code to log a message when gson is used instead of jackson.
Change-Id: I8cbb8ad8461cc364c3419aaa174cef2680c5a672
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
diff --git a/gson/pom.xml b/gson/pom.xml
index 81b9549..8f6272a 100644
--- a/gson/pom.xml
+++ b/gson/pom.xml
@@ -38,6 +38,11 @@
<dependencies>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
diff --git a/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java b/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java
index d48649e..a1c54af 100644
--- a/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java
+++ b/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java
@@ -21,6 +21,8 @@
package org.onap.policy.common.gson;
import com.google.gson.GsonBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Provider used to serialize and deserialize policy objects via gson using jackson
@@ -28,6 +30,8 @@
*/
public class JacksonHandler extends GsonMessageBodyHandler {
+ public static final Logger logger = LoggerFactory.getLogger(JacksonHandler.class);
+
/**
* Constructs the object.
*/
@@ -45,6 +49,8 @@
.registerTypeAdapterFactory(new JacksonMethodAdapterFactory())
.setExclusionStrategies(new JacksonExclusionStrategy())
.create());
+
+ logger.info("Using GSON for REST calls");
}
}