From 71513a08caa8fd80c732d53d97b242e4b3a3f5c6 Mon Sep 17 00:00:00 2001 From: Daniel Cruz Date: Mon, 11 Mar 2019 15:29:14 -0500 Subject: Change LoggerFactoryWrapper to NetLoggerUtil Removed LoggerFactoryWrapper references to use NetLoggerUtil. Issue-ID: POLICY-1499 Change-Id: I6f7066f4523736672e17d2e1e609c38c44852769 Signed-off-by: Daniel Cruz --- .../src/main/java/org/onap/policy/aai/AaiManager.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'controlloop/common/model-impl/aai') diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java index 6136aee93..e609e932e 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java @@ -28,7 +28,9 @@ import java.util.Map; import java.util.UUID; import org.onap.policy.aai.util.Serialization; -import org.onap.policy.common.utils.slf4j.LoggerFactoryWrapper; +import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; +import org.onap.policy.common.endpoints.utils.NetLoggerUtil; +import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType; import org.onap.policy.rest.RestManager; import org.onap.policy.rest.RestManager.Pair; import org.slf4j.Logger; @@ -39,15 +41,9 @@ import org.slf4j.LoggerFactory; */ public final class AaiManager { - /** The Constant LINE_SEPARATOR. */ - private static final String LINE_SEPARATOR = System.lineSeparator(); - /** The Constant logger. */ private static final Logger logger = LoggerFactory.getLogger(AaiManager.class); - /** The Constant netLogger. */ - private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger(); - /** The rest manager. */ // The REST manager used for processing REST calls for this AAI manager private final RestManager restManager; @@ -79,7 +75,7 @@ public final class AaiManager { logger.debug("RestManager.post before"); String requestJson = Serialization.gsonPretty.toJson(request); - netLogger.info("[OUT|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, requestJson); + NetLoggerUtil.log(EventType.OUT, CommInfrastructure.REST, url, requestJson); Pair httpDetails = restManager.post(url, username, password, headers, "application/json", requestJson); logger.debug("RestManager.post after"); @@ -168,7 +164,7 @@ public final class AaiManager { int attemptsLeft = 3; while (attemptsLeft-- > 0) { - netLogger.info("[OUT|{}|{}|]", "AAI", urlGet); + NetLoggerUtil.getNetworkLogger().info("[OUT|{}|{}|]", CommInfrastructure.REST, urlGet); Pair httpDetailsGet = restManager.get(urlGet, username, password, headers); if (httpDetailsGet == null) { logger.info("AAI GET Null Response to {}", urlGet); @@ -228,7 +224,7 @@ public final class AaiManager { final Class classOfResponse) { try { T response = Serialization.gsonPretty.fromJson(httpDetails.second, classOfResponse); - netLogger.info("[IN|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, httpDetails.second); + NetLoggerUtil.log(EventType.IN, CommInfrastructure.REST, url, httpDetails.second); return response; } catch (JsonSyntaxException e) { logger.error("postQuery threw: ", e); -- cgit 1.2.3-korg