Replace the FlexLogger with SLF4J in forward plugins.
Change-Id: I20077f1a400cd1a28b4b32f877d20d5628af881c
Issue-ID: POLICY-1346
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Intel Corp. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 import org.apache.commons.io.IOUtils;
 import org.onap.policy.apex.core.deployment.EngineServiceFacade;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.common.parameters.ParameterService;
 import org.onap.policy.distribution.forwarding.PolicyForwarder;
 import org.onap.policy.distribution.forwarding.PolicyForwardingException;
 import org.onap.policy.distribution.model.Policy;
 import org.onap.policy.distribution.model.PolicyAsString;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * This class provides an implementation of {@link PolicyForwarder} interface for forwarding the given policies to
  * apex-pdp.
  */
 public class ApexPdpPolicyForwarder implements PolicyForwarder {
 
-    private static final Logger LOGGER = FlexLogger.getLogger(XacmlPdpPolicyForwarder.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(XacmlPdpPolicyForwarder.class);
     private static final String POLICY_TYPE = "APEX";
 
     private ApexPdpPolicyForwarderParameterGroup apexForwarderParameters;
             engineServiceFacade.deployModel(apexPolicy.getPolicyName(), policyInputStream,
                     apexForwarderParameters.isIgnoreConflicts(), apexForwarderParameters.isForceUpdate());
 
-            LOGGER.debug("Sucessfully forwarded the policy to apex-pdp egine at "
-                    + apexForwarderParameters.getHostname() + ":" + apexForwarderParameters.getPort());
+            LOGGER.debug("Sucessfully forwarded the policy to apex-pdp egine at {}:{}",
+                    apexForwarderParameters.getHostname(), apexForwarderParameters.getPort());
 
         } catch (final ApexException | IOException exp) {
             final String message = "Error sending policy to apex-pdp engine at" + apexForwarderParameters.getHostname()
 
 import java.nio.file.Paths;
 import java.util.Collection;
 
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.common.parameters.ParameterService;
 import org.onap.policy.distribution.forwarding.PolicyForwarder;
 import org.onap.policy.distribution.forwarding.PolicyForwardingException;
 import org.onap.policy.distribution.model.OptimizationPolicy;
 import org.onap.policy.distribution.model.Policy;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * This class provides an implementation of {@link PolicyForwarder} interface for forwarding the given policies to
  * a file directory.
  */
 public class FilePolicyForwarder implements PolicyForwarder {
 
-    private static final Logger LOGGER = FlexLogger.getLogger(FilePolicyForwarder.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(FilePolicyForwarder.class);
     private FilePolicyForwarderParameterGroup fileForwarderParameters;
 
     /**
                 Files.createDirectories(path);
             }
         } catch (final InvalidPathException | IOException e) {
-            LOGGER.error(e.toString());
+            LOGGER.error("Configuring FilePolicyForwarder failed!", e);
         }
     }
 
                 writer.write("riskType: " + pol.getRiskType());
             }
             writer.close();
-            LOGGER.debug("Sucessfully forwarded the policy to store into file: " + path.toString());
+            LOGGER.debug("Sucessfully forwarded the policy to store into file {}.", path);
         } catch (final InvalidPathException | IOException exp) {
             final String message = "Error sending policy to file under path:" + fileForwarderParameters.getPath();
             LOGGER.error(message, exp);
 
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Intel Corp. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 import org.onap.policy.api.PushPolicyParameters;
 import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.endpoints.http.client.HttpClient;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.common.parameters.ParameterService;
 import org.onap.policy.distribution.forwarding.PolicyForwarder;
 import org.onap.policy.distribution.forwarding.xacml.pdp.adapters.XacmlPdpOptimizationPolicyAdapter;
 import org.onap.policy.distribution.model.OptimizationPolicy;
 import org.onap.policy.distribution.model.Policy;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.http.HttpStatus;
 
 /**
  */
 public class XacmlPdpPolicyForwarder implements PolicyForwarder {
 
-    private static final Logger LOGGER = FlexLogger.getLogger(XacmlPdpPolicyForwarder.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(XacmlPdpPolicyForwarder.class);
     private static final String BASE_PATH = "pdp/api/";
 
     private XacmlPdpPolicyForwarderParameterGroup configurationParameters = null;
         XacmlPdpPolicyAdapter<?> policyAdapter = getXacmlPdpPolicyAdapter(policy);
 
         if (policyAdapter == null) {
-            LOGGER.error("Cannot forward policy " + policy + ". Unsupported policy type "
-                    + policy.getClass().getSimpleName());
+            LOGGER.error("Cannot forward policy {}. Unsupported policy type {}",
+                    policy, policy.getClass().getSimpleName());
             return;
         }
 
 
             if (response.getStatus() != HttpStatus.OK.value()) {
                 LOGGER.error(
-                        "Invocation of method " + method + " failed for policy " + policyName + ". Response status: "
-                                + response.getStatus() + ", Response status info: " + response.getStatusInfo());
+                        "Invocation of method {} failed for policy {}. Response status: {}, Response status info: {}",
+                        method, policyName, response.getStatus(), response.getStatusInfo());
                 return false;
             }
         } catch (KeyManagementException | NoSuchAlgorithmException | ClassNotFoundException exception) {