diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java
index 46fb651..613ab0d 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -21,15 +23,17 @@
 package org.onap.so.adapters.network;
 
 
-import org.onap.so.logger.MessageEnum;
-import org.onap.so.logger.MsoLogger;
-
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.onap.so.logger.MessageEnum;
+import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ContrailPolicyRef {
-	private static final MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, ContrailPolicyRef.class);
+
+    private static final Logger logger = LoggerFactory.getLogger(ContrailPolicyRef.class);
 	 
 	@JsonProperty("network_policy_refs_data_sequence")
 	private ContrailPolicyRefSeq seq;
@@ -44,7 +48,8 @@
 		}
 		catch (Exception e)
 		{
-			logger.error (MessageEnum.RA_MARSHING_ERROR, "Error creating JsonString for Contrail Policy Ref", "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Policy Ref", e);
+        logger.error("{} {} Error creating JsonString for Contrail Policy Ref: ", MessageEnum.RA_MARSHING_ERROR,
+            MsoLogger.ErrorCode.SchemaError.getValue(), e);
 		}
 		
 		return node;
@@ -60,7 +65,8 @@
 		}
 		catch (Exception e)
 		{
-			logger.error (MessageEnum.RA_MARSHING_ERROR, "Error creating JsonString for Contrail Policy Ref", "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Policy Ref", e);
+        logger.error("{} {} Error creating JsonString for Contrail Policy Ref: ", MessageEnum.RA_MARSHING_ERROR,
+            MsoLogger.ErrorCode.SchemaError.getValue(), e);
 		}
 		
 		return jsonString;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java
index 019963b..6f80e0e 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -20,23 +22,24 @@
 
 package org.onap.so.adapters.network;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.HostRoute;
 import org.onap.so.openstack.beans.Pool;
 import org.onap.so.openstack.beans.Subnet;
 import org.onap.so.openstack.utils.MsoCommonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 public class ContrailSubnet {
-	private static final MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, ContrailSubnet.class);
+
+    private static final Logger logger = LoggerFactory.getLogger(ContrailSubnet.class);
 	@Autowired
 	private MsoCommonUtils msoCommonUtils;
 	
@@ -129,8 +132,8 @@
 		}
 		catch (Exception e)
 		{
-			String error = "Error creating JsonNode for Contrail Subnet:" + subnetName;
-			logger.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonNode for Contrail Subnet", e);
+        logger.error("{} {} Error creating JsonNode for Contrail Subnet: {} ", MessageEnum.RA_MARSHING_ERROR,
+            MsoLogger.ErrorCode.SchemaError.getValue(), subnetName, e);
 		}
 		
 		return node;
@@ -146,8 +149,8 @@
 		}
 		catch (Exception e)
 		{
-			String error = "Error creating JsonString for Contrail Subnet:" + subnetName;
-			logger.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Subnet", e);
+        logger.error("{} {} Error creating JsonString for Contrail Subnet: {} ", MessageEnum.RA_MARSHING_ERROR,
+            MsoLogger.ErrorCode.SchemaError.getValue(), subnetName, e);
 		}
 		
 		return jsonString;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
index 8181714..80333d6 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
@@ -6,6 +6,7 @@
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +23,7 @@
  */
 
 package org.onap.so.adapters.network;
- 
+
 
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -31,14 +32,12 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import javax.jws.WebService;
 import javax.xml.bind.DatatypeConverter;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Holder;
 import javax.xml.ws.handler.MessageContext;
-
 import org.onap.so.adapters.network.async.client.CreateNetworkNotification;
 import org.onap.so.adapters.network.async.client.MsoExceptionCategory;
 import org.onap.so.adapters.network.async.client.NetworkAdapterNotify;
@@ -48,12 +47,13 @@
 import org.onap.so.adapters.network.exceptions.NetworkException;
 import org.onap.so.entity.MsoRequest;
 import org.onap.so.logger.MessageEnum;
-
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.NetworkRollback;
 import org.onap.so.openstack.beans.NetworkStatus;
 import org.onap.so.openstack.beans.Subnet;
 import org.onap.so.utils.CryptoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
@@ -62,14 +62,14 @@
 @WebService(serviceName = "NetworkAdapterAsync", endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapterAsync", targetNamespace = "http://org.onap.so/networkA")
 public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
 
-    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoNetworkAdapterAsyncImpl.class);
+    private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterAsyncImpl.class);
 
     private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth";
     private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
     private static final String NETWORK_EXCEPTION_MSG="Got a NetworkException on createNetwork: ";
-    private static final String CREATE_NETWORK_ERROR_MSG="Error sending createNetwork notification ";
-    private static final String CREATE_NETWORK_EXCEPTON_MSG="Exception sending createNetwork notification";
-    private static final String MSO_INTERNAL_ERROR_MSG="MsoInternalError";
+    private static final String CREATE_NETWORK_ERROR_LOGMSG ="{} {} Error sending createNetwork notification {} ";
+    private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info ";
+
     @Autowired
     private Environment environment;
 
@@ -80,7 +80,7 @@
      */
     @Override
     public void healthCheckA () {
-        LOGGER.debug ("Health check call in Network Adapter");
+        logger.debug ("Health check call in Network Adapter");
     }
 
     /**
@@ -130,13 +130,7 @@
 
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName ("CreateNetworkA");
-        LOGGER.debug ("Async Create Network: " + networkName
-                                      + " of type "
-                                      + networkType
-                                      + " in "
-                                      + cloudSiteId
-                                      + "/"
-                                      + tenantId);
+        logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
 
         // Use the synchronous method to perform the actual Create
         
@@ -177,27 +171,28 @@
                                           subnetIdMap,
                                           networkRollback);
         } catch (NetworkException e) {
-            LOGGER.debug (NETWORK_EXCEPTION_MSG, e);
+            logger.debug (NETWORK_EXCEPTION_MSG, e);
             MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
                 eMsg = e.getFaultInfo ().getMessage ();
                 exCat = MsoExceptionCategory.fromValue (e.getFaultInfo ().getCategory ().name ());
             } catch (Exception e1) {
-                LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - fault info", e1);
+                logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.createNetworkNotification (messageId, false, exCat, eMsg, null, null, null, null);
             } catch (Exception e1) {
-                error = CREATE_NETWORK_ERROR_MSG + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError,CREATE_NETWORK_EXCEPTON_MSG, e1);
+                logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
             }
             return;
         }
-        LOGGER.debug ("Async Create Network:Name " + networkName + " physicalNetworkName:" + physicalNetworkName);
+        logger.debug("Async Create Network:Name {} physicalNetworkName:{}", networkName, physicalNetworkName);
         // Build and send Asynchronous response
         try {
             NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
@@ -210,8 +205,8 @@
                                                   copyCreateSubnetIdMap (subnetIdMap),
                                                   copyNrb (networkRollback));
         } catch (Exception e) {
-            error = CREATE_NETWORK_ERROR_MSG + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, CREATE_NETWORK_EXCEPTON_MSG, e);
+            logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), e.getMessage(), e);
 
         }
         return;
@@ -262,13 +257,7 @@
         String serviceName = "UpdateNetworkA";
         MsoLogger.setServiceName (serviceName);
         MsoLogger.setLogContext (msoRequest);
-        LOGGER.debug ("Async Update Network: " + networkId
-                      + " of type "
-                      + networkType
-                      + "in "
-                      + cloudSiteId
-                      + "/"
-                      + tenantId);
+        logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId);
 
         // Use the synchronous method to perform the actual Create
         
@@ -306,27 +295,29 @@
             MsoLogger.setServiceName (serviceName);
         } catch (NetworkException e) {
         	MsoLogger.setServiceName (serviceName);
-            LOGGER.debug ("Got a NetworkException on updateNetwork: ", e);
+            logger.debug ("Got a NetworkException on updateNetwork: ", e);
             MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
                 eMsg = e.getFaultInfo ().getMessage ();
                 exCat = MsoExceptionCategory.fromValue (e.getFaultInfo ().getCategory ().name ());
             } catch (Exception e1) {
-                LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - fault info", e1);
+                logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.updateNetworkNotification (messageId, false, exCat, eMsg, null, copyNrb (networkRollback));
             } catch (Exception e1) {
-                error = "Error sending updateNetwork notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending updateNetwork notification", e1);
+                logger.error("{} {} Error sending updateNetwork notification {} ",
+                    MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, MsoLogger.ErrorCode.DataError.getValue(), e1.getMessage(),
+                    e1);
 
             }
             return;
         }
-        LOGGER.debug ("Async Update Network:Name " + networkName + " NetworkId:" + networkId);
+        logger.debug("Async Update Network:Name {} NetworkId:{}", networkName, networkId);
         // Build and send Asynchronous response
         try {
             NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
@@ -337,9 +328,8 @@
                                                   copyUpdateSubnetIdMap (subnetIdMap),
                                                   copyNrb (networkRollback));
         } catch (Exception e) {
-            error = "Error sending updateNotification request" + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending updateNotification request", e);
-
+            logger.error("{} {} Error sending updateNotification request {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), e.getMessage(), e);
         }
         return;
     }
@@ -363,7 +353,8 @@
         MsoLogger.setLogContext (msoRequest);
         String serviceName = "QueryNetworkA";
         MsoLogger.setServiceName (serviceName);
-        LOGGER.debug ("Async Query Network " + networkNameOrId + " in " + cloudSiteId + "/" + tenantId);
+        logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
+        String errorCreateNetworkMessage = "{} {} Error sending createNetwork notification {} ";
 
         // Use the synchronous method to perform the actual Create
         
@@ -390,27 +381,27 @@
             MsoLogger.setServiceName (serviceName);
         } catch (NetworkException e) {
         	MsoLogger.setServiceName (serviceName);
-            LOGGER.debug (NETWORK_EXCEPTION_MSG, e);
+            logger.debug (NETWORK_EXCEPTION_MSG, e);
             MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
                 eMsg = e.getFaultInfo ().getMessage ();
                 exCat = MsoExceptionCategory.fromValue (e.getFaultInfo ().getCategory ().name ());
             } catch (Exception e1) {
-                LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - fault info", e1);
+                logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.queryNetworkNotification (messageId, false, exCat, eMsg, null, null, null, null, null, null);
             } catch (Exception e1) {
-                error = "Error sending createNetwork notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e1);
-
+                logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1.getMessage(), e1);
             }
             return;
         }
-        LOGGER.debug ("Async Query Network:NameOrId " + networkNameOrId + " tenantId:" + tenantId);
+        logger.debug("Async Query Network:NameOrId {} tenantId:{}", networkNameOrId, tenantId);
         // Build and send Asynchronous response
         try {
             NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
@@ -426,9 +417,8 @@
                                                  vlans.value,
                                                  copyQuerySubnetIdMap (subnetIdMap));
         } catch (Exception e) {
-            error = "Error sending createNetwork notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e);
-
+            logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), e.getMessage(), e);
         }
         return;
     }
@@ -464,7 +454,7 @@
         MsoLogger.setLogContext (msoRequest);
         String serviceName = "DeleteNetworkA";
         MsoLogger.setServiceName (serviceName);
-        LOGGER.debug ("Async Delete Network " + networkId + " in " + cloudSiteId + "/" + tenantId);
+        logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId);
 
         // Use the synchronous method to perform the actual Create
         
@@ -477,34 +467,36 @@
             MsoLogger.setServiceName (serviceName);
         } catch (NetworkException e) {
         	MsoLogger.setServiceName (serviceName);
-            LOGGER.debug (NETWORK_EXCEPTION_MSG, e);
+            logger.debug (NETWORK_EXCEPTION_MSG, e);
             MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
                 eMsg = e.getFaultInfo ().getMessage ();
                 exCat = MsoExceptionCategory.fromValue (e.getFaultInfo ().getCategory ().name ());
             } catch (Exception e1) {
-                LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - fault info", e1);
+                logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.deleteNetworkNotification (messageId, false, exCat, eMsg, null);
             } catch (Exception e1) {
-                error = "Error sending createNetwork notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e1);
+                logger.error("{} {} Error sending createNetwork notification {} ",
+                    MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, MsoLogger.ErrorCode.DataError.getValue(), e1.getMessage(),
+                    e1);
 
             }
             return;
         }
-        LOGGER.debug ("Async Delete NetworkId: " + networkId + " tenantId:" + tenantId);
+        logger.debug("Async Delete NetworkId: {} tenantId:{}", networkId, tenantId);
         // Build and send Asynchronous response
         try {
             NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
             notifyPort.deleteNetworkNotification (messageId, true, null, null, networkDeleted.value);
         } catch (Exception e) {
-            error = "Error sending deleteNetwork notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending deleteNetwork notification", e);
+            logger.error("{} {} Error sending deleteNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), e.getMessage(), e);
 
         }
         return;
@@ -526,12 +518,13 @@
         MsoLogger.setServiceName (serviceName);
         // rollback may be null (e.g. if network already existed when Create was called)
         if (rollback == null) {
-            LOGGER.warn (MessageEnum.RA_ROLLBACK_NULL, "", "", MsoLogger.ErrorCode.SchemaError, "Rollback is null");
+            logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL,
+                MsoLogger.ErrorCode.SchemaError.getValue());
             return;
         }
 
         MsoLogger.setLogContext (rollback.getMsoRequest ());
-        LOGGER.info (MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId (), "", "");
+        logger.info("{} {}", MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId());
         // Use the synchronous method to perform the actual Create
         
 
@@ -540,7 +533,7 @@
             MsoLogger.setServiceName (serviceName);
         } catch (NetworkException e) {
         	MsoLogger.setServiceName (serviceName);
-            LOGGER.debug ("Got a NetworkException on rollbackNetwork: ", e);
+            logger.debug ("Got a NetworkException on rollbackNetwork: ", e);
             // Build and send Asynchronous error response
             MsoExceptionCategory exCat = null;
             String eMsg = null;
@@ -548,27 +541,29 @@
                 eMsg = e.getFaultInfo ().getMessage ();
                 exCat = MsoExceptionCategory.fromValue (e.getFaultInfo ().getCategory ().name ());
             } catch (Exception e1) {
-                LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception in get fault info", e1);
+                logger.error("{} {} Exception in get fault info ", MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.rollbackNetworkNotification (rollback.getMsoRequest ().getRequestId (), false, exCat, eMsg);
             } catch (Exception e1) {
-                error = CREATE_NETWORK_ERROR_MSG + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception in sending createNetwork notification ", e1);
+                logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
             }
             return;
         }
-        LOGGER.debug ("Async Rollback NetworkId: " + rollback.getNetworkStackId () + " tenantId:" + rollback.getTenantId ());
+        logger.debug("Async Rollback NetworkId: {} tenantId:{}", rollback.getNetworkStackId(), rollback.getTenantId());
         // Build and send Asynchronous response
         try {
             NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl);
             notifyPort.rollbackNetworkNotification (rollback.getMsoRequest ().getRequestId (), true, null, null);
         } catch (Exception e) {
-            error = "Error sending rollbackNetwork notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception in sending rollbackNetwork notification", e);
+            logger
+                .error("{} {} Error sending rollbackNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
+                    MsoLogger.ErrorCode.DataError.getValue(), e.getMessage(), e);
 
         }
         return;
@@ -607,15 +602,18 @@
         try {
             warWsdlLoc = Thread.currentThread ().getContextClassLoader ().getResource ("NetworkAdapterNotify.wsdl");
         } catch (Exception e) {
-            LOGGER.error (MessageEnum.RA_WSDL_NOT_FOUND, "NetworkAdpaterNotify.wsdl", "", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
+            logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
+                MsoLogger.ErrorCode.DataError.getValue(), e);
         }
         if (warWsdlLoc == null) {
-            LOGGER.error (MessageEnum.RA_WSDL_NOT_FOUND, "NetworkAdpaterNotify.wsdl", "", "", MsoLogger.ErrorCode.DataError, "WSDL not found");
+            logger
+                .error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND, MsoLogger.ErrorCode.DataError.getValue());
         } else {
             try {
-                LOGGER.debug ("NetworkAdpaterNotify.wsdl location:" + warWsdlLoc.toURI ().toString ());
+                logger.debug("NetworkAdpaterNotify.wsdl location: {}", warWsdlLoc.toURI().toString());
             } catch (Exception e) {
-                LOGGER.error (MessageEnum.RA_WSDL_URL_CONVENTION_EXC, "NetworkAdpaterNotify.wsdl", "", "", MsoLogger.ErrorCode.SchemaError, "Exception - WSDL URL convention", e);
+                logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
+                    MsoLogger.ErrorCode.SchemaError.getValue(), e);
             }
         }
 
@@ -631,15 +629,16 @@
         try {
             epUrl = new URL (notificationUrl);
         } catch (MalformedURLException e1) {
-            LOGGER.error (MessageEnum.RA_INIT_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - init notification", e1);
+            logger.error("{} {} Exception - init notification ", MessageEnum.RA_INIT_NOTIF_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), e1);
         }
 
         if(null != epUrl) {
-            LOGGER.debug ("Notification Endpoint URL: " + epUrl.toExternalForm ());
+            logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
             bp.getRequestContext ().put (BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm ());
         }
         else {
-        	LOGGER.debug ("Notification Endpoint URL is NULL: ");
+            logger.debug("Notification Endpoint URL is NULL: ");
         }
 
         // authentication
@@ -653,9 +652,8 @@
             reqCtx.put (MessageContext.HTTP_REQUEST_HEADERS, headers);
             headers.put ("Authorization", Collections.singletonList (basicAuth));
         } catch (Exception e) {
-            String error1 = "Unable to set authorization in callback request" + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_SET_CALLBACK_AUTH_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - Unable to set authorization in callback request", e);
-
+            logger.error("{} {} Unable to set authorization in callback request {} ",
+                MessageEnum.RA_SET_CALLBACK_AUTH_EXC, MsoLogger.ErrorCode.DataError.getValue(), e.getMessage(), e);
         }
 
         return notifyPort;
@@ -665,7 +663,7 @@
     	try {
 			return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
 		} catch (GeneralSecurityException e) {
-			LOGGER.debug("Exception while decrypting property: " + this.environment.getProperty(key), e);
+          logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);
 		}
 		return defaultValue;
 
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index d250561..7996657 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -6,6 +6,7 @@
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,17 +22,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.adapters.network; 
+package org.onap.so.adapters.network;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-
 import javax.jws.WebService;
 import javax.xml.ws.Holder;
-
 import org.onap.so.adapters.network.beans.ContrailPolicyRef;
 import org.onap.so.adapters.network.beans.ContrailPolicyRefSeq;
 import org.onap.so.adapters.network.beans.ContrailSubnet;
@@ -39,17 +40,16 @@
 import org.onap.so.adapters.network.mappers.ContrailSubnetMapper;
 import org.onap.so.cloud.CloudConfig;
 import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
 import org.onap.so.db.catalog.beans.HeatTemplate;
 import org.onap.so.db.catalog.beans.NetworkResource;
 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
 import org.onap.so.db.catalog.data.repository.CollectionNetworkResourceCustomizationRepository;
 import org.onap.so.db.catalog.data.repository.NetworkResourceCustomizationRepository;
 import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
 import org.onap.so.db.catalog.utils.MavenLikeVersioning;
 import org.onap.so.entity.MsoRequest;
 import org.onap.so.logger.MessageEnum;
-
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.HeatStatus;
 import org.onap.so.openstack.beans.NetworkInfo;
@@ -67,14 +67,13 @@
 import org.onap.so.openstack.utils.MsoHeatUtilsWithUpdate;
 import org.onap.so.openstack.utils.MsoNeutronUtils;
 import org.onap.so.openstack.utils.MsoNeutronUtils.NetworkType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 @Component
 @Transactional
 @WebService(serviceName = "NetworkAdapter", endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapter", targetNamespace = "http://org.onap.so/network")
@@ -91,7 +90,7 @@
     private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError";
     private static final String NEUTRON_MODE = "NEUTRON";
     
-    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoNetworkAdapterImpl.class);
+    private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterImpl.class);
 
     @Autowired
     private CloudConfig cloudConfig;
@@ -119,7 +118,7 @@
      */
     @Override
     public void healthCheck () {
-        LOGGER.debug ("Health check call in Network Adapter");
+        logger.debug ("Health check call in Network Adapter");
     }
 
     /**
@@ -270,13 +269,7 @@
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (CREATE_NETWORK_CONTEXT);
 
-        LOGGER.debug ("*** CREATE Network: " + networkName
-                      + " of type "
-                      + networkType
-                      + " in "
-                      + cloudSiteId
-                      + "/"
-                      + tenantId);
+        logger.debug("*** CREATE Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
 
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
@@ -295,16 +288,12 @@
         Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId);
         if (!cloudSiteOpt.isPresent())
         {
-        	String error = "Configuration Error. Stack " + networkName + " in "
-        			+ cloudSiteId
-        			+ "/"
-        			+ tenantId
-        			+ ": "
-        			+ " CloudSite does not exist in MSO Configuration";
-        	LOGGER.error (MessageEnum.RA_CONFIG_EXC, error, "", "", MsoLogger.ErrorCode.DataError, "Configuration Error");
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
-        	// Set the detailed error as the Exception 'message'
-        	throw new NetworkException (error, MsoExceptionCategory.USERDATA);
+            String error = String
+                .format("Configuration Error. Stack %s in %s/%s: CloudSite does not exist in MSO Configuration",
+                    networkName, cloudSiteId, tenantId);
+            logger.error("{} {} {}", MessageEnum.RA_CONFIG_EXC, MsoLogger.ErrorCode.DataError.getValue(), error);
+            // Set the detailed error as the Exception 'message'
+            throw new NetworkException(error, MsoExceptionCategory.USERDATA);
         }
 
 
@@ -329,12 +318,12 @@
                 long queryNetworkStarttime = System.currentTimeMillis ();
                 try {
                     netInfo = neutron.queryNetwork (networkName, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "QueryNetwork", null);
                 } catch (MsoException me) {
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack", "OpenStack", "QueryNetwork", null);
-                    LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while querying network from OpenStack", me);
+                    logger.error(
+                        "{} {} Exception while querying network {} for CloudSite {} from Tenant {} from OpenStack ",
+                        MessageEnum.RA_QUERY_NETWORK_EXC, MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+                        networkName, cloudSiteId, tenantId, me);
                     me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack");
                     throw new NetworkException (me);
                 }
 
@@ -342,23 +331,20 @@
                     // Exists. If that's OK, return success with the network ID.
                     // Otherwise, return an exception.
                     if (failIfExists != null && failIfExists) {
-                        String error = "Create Nework: Network " + networkName
-                                       + " already exists in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + " with ID " + netInfo.getId();
-                        LOGGER.error (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Network already exists");
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+                        String error = String
+                            .format("Create Nework: Network %s already exists in %s/%s with ID %s", networkName,
+                                cloudSiteId, tenantId, netInfo.getId());
+                        logger.error("{} {} {}", MessageEnum.RA_NETWORK_ALREADY_EXIST,
+                            MsoLogger.ErrorCode.DataError.getValue(), error);
                         throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                     } else {
                         // Populate the outputs from the existing network.
                         networkId.value = netInfo.getId ();
                         neutronNetworkId.value = netInfo.getId ();
                         rollback.value = networkRollback; // Default rollback - no updates performed
-                        String msg = "Found Existing network, status=" + netInfo.getStatus () + " for Neutron mode";
-                        LOGGER.warn (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", MsoLogger.ErrorCode.DataError, "Found Existing network, status=" + netInfo.getStatus ());
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, msg);
+                        logger.warn("{} {} Found Existing network, status={} for Neutron mode ",
+                            MessageEnum.RA_NETWORK_ALREADY_EXIST, MsoLogger.ErrorCode.DataError.getValue(),
+                            netInfo.getStatus());
                     }
                     return;
                 }
@@ -371,19 +357,10 @@
                                                      networkName,
                                                      physicalNetworkName,
                                                      vlans);
-                    LOGGER.recordMetricEvent (createNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "CreateNetwork", null);
                 } catch (MsoException me) {
-                	me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordMetricEvent (createNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with OpenStack", "OpenStack", "CreateNetwork", null);
-                	String error = "Create Network: type " + neutronNetworkType
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception while communicate with OpenStack", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    logger.error("{} {} Create Network: type {} in {}/{}: ", MessageEnum.RA_CREATE_NETWORK_EXC,
+                        MsoLogger.ErrorCode.DataError.getValue(), neutronNetworkType, cloudSiteId, tenantId, me);
 
                     throw new NetworkException (me);
                 }
@@ -401,18 +378,19 @@
                 networkRollback.setNeutronNetworkId (netInfo.getId ());
                 networkRollback.setNetworkType (networkType);
 
-                LOGGER.debug ("Network " + networkName + " created, id = " + netInfo.getId ());
+                logger.debug("Network {} created, id = {}", networkName, netInfo.getId());
             } else if ("HEAT".equals (mode)) {
 
                 HeatTemplate heatTemplate = networkResource.getHeatTemplate();
                 if (heatTemplate == null) {
-                    String error = "Network error - undefined Heat Template. Network Type = " + networkType;
-                    LOGGER.error (MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "Openstack", "", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type = " + networkType);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                    String error = String
+                        .format("Network error - undefined Heat Template. Network Type = %s", networkType);
+                    logger.error("{} {} {}", MessageEnum.RA_PARAM_NOT_FOUND, MsoLogger.ErrorCode.DataError.getValue(),
+                        error);
                     throw new NetworkException (error, MsoExceptionCategory.INTERNAL);
                 }
-                
-                LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.toString());
+
+                logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString());
 
                 // "Fix" the template if it has CR/LF (getting this from Oracle)
                 String template = heatTemplate.getHeatTemplate ();
@@ -432,33 +410,22 @@
                 long queryNetworkStarttime = System.currentTimeMillis ();
                 try {
                     heatStack = heat.queryStack (cloudSiteId, tenantId, networkName);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "QueryNetwork", null);
                 } catch (MsoException me) {
                     me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying stack from OpenStack", "OpenStack", "QueryNetwork", null);
-                	String error = "Create Network (heat): query network " + networkName
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception while querying stack from OpenStack", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Create Network (heat): query network {} in {}/{}: ",
+                        MessageEnum.RA_QUERY_NETWORK_EXC, MsoLogger.ErrorCode.DataError.getValue(), networkName,
+                        cloudSiteId, tenantId, me);
                     throw new NetworkException (me);
                 }
 
                 if (heatStack != null && (heatStack.getStatus () != HeatStatus.NOTFOUND)) {
                     // Stack exists. Return success or error depending on input directive
                     if (failIfExists != null && failIfExists) {
-                        String error = "CreateNetwork: Stack " + networkName
-                                       + " already exists in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + " as " + heatStack.getCanonicalName();
-                        LOGGER.error (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Network already exists");
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+                        String error = String
+                            .format("CreateNetwork: Stack %s already exists in %s/%s as %s", networkName, cloudSiteId,
+                                tenantId, heatStack.getCanonicalName());
+                        logger.error("{} {} {}", MessageEnum.RA_NETWORK_ALREADY_EXIST,
+                            MsoLogger.ErrorCode.DataError.getValue(), error);
                         throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                     } else {
                         // Populate the outputs from the existing stack.
@@ -489,8 +456,9 @@
                         	}
                         }
                         subnetIdMap.value = sMap;
-                        LOGGER.warn (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", MsoLogger.ErrorCode.DataError, "Found Existing network stack, status=" + heatStack.getStatus ());
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc, "Found Existing network stack");
+                        logger.warn("{} {} Found Existing network stack, status={} networkName={} for {}/{}",
+                            MessageEnum.RA_NETWORK_ALREADY_EXIST, MsoLogger.ErrorCode.DataError.getValue(),
+                            heatStack.getStatus(), networkName, cloudSiteId, tenantId);
                     }
                     return;
                 }
@@ -513,8 +481,8 @@
                     stackParams = heat.validateStackParams (stackParams, heatTemplate);
                 } catch (IllegalArgumentException e) {
                     String error = "Create Network: Configuration Error: " + e.getMessage ();
-                    LOGGER.error (MessageEnum.RA_CONFIG_EXC, e.getMessage(), "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - Create Network, Configuration Error", e);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+                    logger.error("{} {} {} ", MessageEnum.RA_CONFIG_EXC,
+                        MsoLogger.ErrorCode.DataError.getValue(), error,e);
                     // Input parameters were not valid
                     throw new NetworkException (error, MsoExceptionCategory.INTERNAL);
                 }
@@ -531,15 +499,10 @@
                 		}
                 	} catch (MsoException me) {
                 		me.addContext (CREATE_NETWORK_CONTEXT);
-                		String error = "Create Network (heat): type " + neutronNetworkType
-                				+ " in "
-                				+ cloudSiteId
-                				+ "/"
-                				+ tenantId
-                				+ ": "
-                				+ me;
-                		LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging subnets", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                      logger
+                          .error("{} {} Exception Create Network, merging subnets for network (heat) type {} in {}/{} ",
+                              MessageEnum.RA_CREATE_NETWORK_EXC, MsoLogger.ErrorCode.DataError.getValue(),
+                              neutronNetworkType.toString(), cloudSiteId, tenantId, me);
                 		throw new NetworkException (me);
                 	}
                 }
@@ -549,15 +512,9 @@
                         mergePolicyRefs (policyFqdns, stackParams);
                     } catch (MsoException me) {
                         me.addContext (CREATE_NETWORK_CONTEXT);
-                    	String error = "Create Network (heat) mergePolicyRefs type " + neutronNetworkType
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging policyRefs", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                        logger.error("{} {} Exception Create Network, merging policyRefs type {} in {}/{} ",
+                            MessageEnum.RA_CREATE_NETWORK_EXC, MsoLogger.ErrorCode.DataError.getValue(),
+                            neutronNetworkType.toString(), cloudSiteId, tenantId, me);
                         throw new NetworkException (me);
                     }
                 }
@@ -567,15 +524,9 @@
                         mergeRouteTableRefs (routeTableFqdns, stackParams);
                     } catch (MsoException me) {
                         me.addContext (CREATE_NETWORK_CONTEXT);
-                    	String error = "Create Network (heat) mergeRouteTableRefs type " + neutronNetworkType
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging routeTableRefs", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                        logger.error("{} {} Exception Create Network, merging routeTableRefs type {} in {}/{} ",
+                            MessageEnum.RA_CREATE_NETWORK_EXC, MsoLogger.ErrorCode.DataError.getValue(),
+                            neutronNetworkType.toString(), cloudSiteId, tenantId, me);
                         throw new NetworkException (me);
                     }
                 }
@@ -598,15 +549,9 @@
                                                   backout.booleanValue());
                 } catch (MsoException me) {
                     me.addContext (CREATE_NETWORK_CONTEXT);
-                	String error = "Create Network (heat): type " + neutronNetworkType
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception creating network", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger
+                        .error("{} {} Exception creating network type {} in {}/{} ", MessageEnum.RA_CREATE_NETWORK_EXC,
+                            MsoLogger.ErrorCode.DataError.getValue(), networkName, cloudSiteId, tenantId, me);
                     throw new NetworkException (me);
                 }
 
@@ -648,10 +593,9 @@
                 networkRollback.setNetworkCreated (true);
                 networkRollback.setNetworkType (networkType);
 
-                LOGGER.debug ("Network " + networkName + " successfully created via HEAT");
+                logger.debug("Network {} successfully created via HEAT", networkName);
             }
        
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc, "Successfully created network");
         return;
     }
 
@@ -772,14 +716,8 @@
                                Holder <NetworkRollback> rollback) throws NetworkException {
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (UPDATE_NETWORK_CONTEXT);
-        LOGGER.debug ("***UPDATE Network adapter with Network: " + networkName
-                + " of type "
-                + networkType
-                + " in "
-                + cloudSiteId
-                + "/"
-                + tenantId);
-
+        logger.debug("***UPDATE Network adapter with Network: {} of type {} in {}/{}", networkName, networkType,
+            cloudSiteId, tenantId);
 
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
@@ -792,16 +730,12 @@
 
         Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite (cloudSiteId);
         if (!cloudSiteOpt.isPresent()) {
-        	   String error = "UpdateNetwork: Configuration Error. Stack " + networkName + " in "
-                       + cloudSiteId
-                       + "/"
-                       + tenantId
-                       + ": "
-                       + " CloudSite does not exist in MSO Configuration";
-        	   LOGGER.error (MessageEnum.RA_CONFIG_EXC, error, "Openstack", "", MsoLogger.ErrorCode.DataError, "CloudSite does not exist in MSO Configuration");
-               LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
-        	   // Set the detailed error as the Exception 'message'
-        	   throw new NetworkException (error, MsoExceptionCategory.USERDATA);
+            String error = String.format(
+                "UpdateNetwork: Configuration Error. Stack %s in %s/%s: CloudSite does not exist in MSO Configuration",
+                networkName, cloudSiteId, tenantId);
+            logger.error("{} {} {}", MessageEnum.RA_CONFIG_EXC, MsoLogger.ErrorCode.DataError.getValue(), error);
+            // Set the detailed error as the Exception 'message'
+            throw new NetworkException(error, MsoExceptionCategory.USERDATA);
         }
 
 
@@ -830,30 +764,18 @@
                 long queryNetworkStarttime = System.currentTimeMillis();
                 try {
                     netInfo = neutron.queryNetwork(networkId, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryNetwork", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
-                    String error = "Update Network (neutron): query " + networkId
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryNetwork", null);
-                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "QueryNetwork", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryNetwork", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Exception - queryNetwork query {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
+                        MsoLogger.ErrorCode.BusinessProcesssError.getValue(), networkId, cloudSiteId, tenantId, me);
                     throw new NetworkException(me);
                 }
 
                 if (netInfo == null) {
-                    String error = "Update Nework: Network " + networkId
-                            + " does not exist in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId;
-                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Network not found");
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                    String error = String
+                        .format("Update Nework: Network %s does not exist in %s/%s", networkId, cloudSiteId, tenantId);
+                    logger.error("{} {} {}", MessageEnum.RA_NETWORK_NOT_FOUND,
+                        MsoLogger.ErrorCode.BusinessProcesssError.getValue(), error);
                     // Does not exist. Throw an exception (can't update a non-existent network)
                     throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                 }
@@ -865,19 +787,10 @@
                             neutronNetworkType,
                             physicalNetworkName,
                             vlans);
-                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "UpdateNetwork", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
-                    String error = "Update Network (neutron): " + networkId
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "Openstack", "updateNetwork", MsoLogger.ErrorCode.DataError, "Exception - updateNetwork", me);
-                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateNetwork", null);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Exception - updateNetwork {} in {}/{} ", MessageEnum.RA_UPDATE_NETWORK_ERR,
+                        MsoLogger.ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me);
                     throw new NetworkException(me);
                 }
 
@@ -890,7 +803,7 @@
                 networkRollback.setPhysicalNetwork(netInfo.getProvider());
                 networkRollback.setVlans(netInfo.getVlans());
 
-                LOGGER.debug("Network " + networkId + " updated, id = " + netInfo.getId());
+                logger.debug("Network {} updated, id = {}", networkId, netInfo.getId());
             } else if ("HEAT".equals(mode)) {
 
                 // First, look up to see that the Network already exists.
@@ -899,30 +812,18 @@
                 long queryStackStarttime = System.currentTimeMillis();
                 try {
                     heatStack = heat.queryStack(cloudSiteId, tenantId, networkName);
-                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryStack", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
-                    String error = "UpdateNetwork (heat): query " + networkName
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
-                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Exception - QueryStack query {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
+                        MsoLogger.ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me);
                     throw new NetworkException(me);
                 }
 
                 if (heatStack == null || (heatStack.getStatus() == HeatStatus.NOTFOUND)) {
-                    String error = "UpdateNetwork: Stack " + networkName
-                            + " does not exist in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId;
-                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Network not found");
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                    String error = String
+                        .format("UpdateNetwork: Stack %s does not exist in %s/%s", networkName, cloudSiteId, tenantId);
+                    logger.error("{} {} {}", MessageEnum.RA_NETWORK_NOT_FOUND, MsoLogger.ErrorCode.DataError.getValue(),
+                        error);
                     // Network stack does not exist. Return an error
                     throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                 }
@@ -940,11 +841,12 @@
                         try {
                             previousVlans.add(Integer.parseInt(vlan));
                         } catch (NumberFormatException e) {
-                            LOGGER.warn(MessageEnum.RA_VLAN_PARSE, networkId, vlansParam, "",  MsoLogger.ErrorCode.DataError, "Exception - VLAN parse", e);
+                            logger.warn("{} {} Exception - VLAN parse for params {} ", MessageEnum.RA_VLAN_PARSE,
+                                MsoLogger.ErrorCode.DataError.getValue(), vlansParam, e);
                         }
                     }
                 }
-                LOGGER.debug("Update Stack:  Previous VLANS: " + previousVlans);
+                logger.debug("Update Stack:  Previous VLANS: {}", previousVlans);
 
                 // Ready to deploy the updated Network via Heat
 
@@ -952,13 +854,12 @@
                 HeatTemplate heatTemplate = networkResource.getHeatTemplate();
                 if (heatTemplate == null) {
                     String error = "Network error - undefined Heat Template. Network Type=" + networkType;
-                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "OpenStack", "getHeatTemplate", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type=" + networkType);
-
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                    logger.error("{} {} {}", MessageEnum.RA_PARAM_NOT_FOUND, MsoLogger.ErrorCode.DataError.getValue(),
+                        error);
                     throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
-                LOGGER.debug("Got HEAT Template from DB: " + heatTemplate.toString());
+                logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString());
 
                 // "Fix" the template if it has CR/LF (getting this from Oracle)
                 String template = heatTemplate.getHeatTemplate();
@@ -988,9 +889,7 @@
                     stackParams = heat.validateStackParams(stackParams, heatTemplate);
                 } catch (IllegalArgumentException e) {
                     String error = "UpdateNetwork: Configuration Error: Network Type=" + networkType;
-                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, "Network Type=" + networkType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork: Configuration Error");
-
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, error);
+                    logger.error("{} {} {} ", MessageEnum.RA_CONFIG_EXC, MsoLogger.ErrorCode.DataError.getValue(), error);
                     throw new NetworkException(error, MsoExceptionCategory.INTERNAL, e);
                 }
 
@@ -1003,15 +902,9 @@
                         }
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
-                        String error = "Update Network (heat): type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergeSubnets ", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                        logger.error("{} {} Exception - UpdateNetwork mergeSubnets for network type {} in {}/{} ",
+                            MessageEnum.RA_UPDATE_NETWORK_ERR, MsoLogger.ErrorCode.DataError.getValue(),
+                            neutronNetworkType.toString(), cloudSiteId, tenantId, me);
                         throw new NetworkException(me);
                     }
                 }
@@ -1021,15 +914,9 @@
                         mergePolicyRefs(policyFqdns, stackParams);
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
-                        String error = "UpdateNetwork (heat) mergePolicyRefs type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergePolicyRefs", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                        logger.error("{} {} Exception - UpdateNetwork mergePolicyRefs type {} in {}/{} ",
+                            MessageEnum.RA_UPDATE_NETWORK_ERR, MsoLogger.ErrorCode.DataError.getValue(),
+                            neutronNetworkType.toString(), cloudSiteId, tenantId, me);
                         throw new NetworkException(me);
                     }
                 }
@@ -1039,15 +926,9 @@
                         mergeRouteTableRefs(routeTableFqdns, stackParams);
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
-                        String error = "UpdateNetwork (heat) mergeRouteTableRefs type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergeRouteTableRefs", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                        logger.error("{} {} Exception - UpdateNetwork mergeRouteTableRefs type {} in {}/{} ",
+                            MessageEnum.RA_UPDATE_NETWORK_ERR, MsoLogger.ErrorCode.DataError.getValue(),
+                            neutronNetworkType.toString(), cloudSiteId, tenantId, me);
                         throw new NetworkException(me);
                     }
                 }
@@ -1063,13 +944,10 @@
                             stackParams,
                             true,
                             heatTemplate.getTimeoutMinutes());
-                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "UpdateStack", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
-                    String error = "Update Network: " + networkId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
-                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - update network", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Exception - update network {} in {}/{} ", MessageEnum.RA_UPDATE_NETWORK_ERR,
+                        MsoLogger.ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me);
                     throw new NetworkException(me);
                 }
 
@@ -1100,7 +978,7 @@
                     networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID));
                 }
                 else {
-                    LOGGER.debug("outputs is NULL");
+                    logger.debug("outputs is NULL");
                 }
                 networkRollback.setNetworkType(networkType);
                 // Save previous parameters
@@ -1110,10 +988,9 @@
 
                 rollback.value = networkRollback;
 
-                LOGGER.debug("Network " + networkId + " successfully updated via HEAT");
+                logger.debug("Network {} successfully updated via HEAT", networkId);
             }
 
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully updated network");
         return;
     }
 
@@ -1141,30 +1018,23 @@
 				}
 			}
 			if(networkCust != null){
-				LOGGER.debug("Got Network Customization definition from Catalog: "
-						+ networkCust.toString());
+          logger.debug("Got Network Customization definition from Catalog: {}", networkCust.toString());
 
 				networkResource = networkCust.getNetworkResource();
 			} else if (collectionNetworkCust != null) {
-				LOGGER.debug("Retrieved Collection Network Resource Customization from Catalog: " 
-						+ collectionNetworkCust.toString());
+          logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}",
+              collectionNetworkCust.toString());
 				networkResource = collectionNetworkCust.getNetworkResource();
 			}
 			if (networkResource == null) {
-				String error = "Create/UpdateNetwork: Unable to get network resource with NetworkType:"
-						+ networkType
-						+ " or ModelCustomizationUUID:"
-						+ modelCustomizationUuid;
-				LOGGER.error(MessageEnum.RA_UNKOWN_PARAM,
-						"NetworkType/ModelCustomizationUUID", networkType + "/"
-								+ modelCustomizationUuid, "OpenStack", "",
-						MsoLogger.ErrorCode.DataError,
-						"Create/UpdateNetwork: Unknown NetworkType/ModelCustomizationUUID");
+          String error = String.format(
+              "Create/UpdateNetwork: Unable to get network resource with NetworkType: %s or ModelCustomizationUUID:%s",
+              networkType, modelCustomizationUuid);
+          logger.error("{} {} {} ", MessageEnum.RA_UNKOWN_PARAM, MsoLogger.ErrorCode.DataError.getValue(), error);
 
 				throw new NetworkException(error, MsoExceptionCategory.USERDATA);
-			} 
-			LOGGER.debug("Got Network definition from Catalog: "
-					+ networkResource.toString());
+			}
+        logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
 
 			String mode = networkResource.getOrchestrationMode();
 			NetworkType neutronNetworkType = NetworkType
@@ -1172,12 +1042,10 @@
 
 			// All Networks are orchestrated via HEAT or Neutron
 			if (!("HEAT".equals(mode) || NEUTRON_MODE.equals(mode))) {
-				String error = "CreateNetwork: Configuration Error: Network Type = "
-						+ networkType;
-				LOGGER.error(MessageEnum.RA_NETWORK_ORCHE_MODE_NOT_SUPPORT,
-						mode, "OpenStack", "", MsoLogger.ErrorCode.DataError,
-						"CreateNetwork: Configuration Error");
-				throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
+          String error = "CreateNetwork: Configuration Error: Network Type = " + networkType;
+          logger.error("{} {} {}", MessageEnum.RA_NETWORK_ORCHE_MODE_NOT_SUPPORT,
+              MsoLogger.ErrorCode.DataError.getValue(), error);
+          throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
 			}
 
 			MavenLikeVersioning aicV = new MavenLikeVersioning();
@@ -1191,22 +1059,15 @@
 							.isMoreRecentThan(networkResource
 									.getAicVersionMax())))) // aic <= max
 			{
-				LOGGER.debug("Network Type:" + networkType + " VersionMin:"
-						+ networkResource.getAicVersionMin() + " VersionMax:"
-						+ networkResource.getAicVersionMax()
-						+ " supported on Cloud:" + cloudSiteId
-						+ " with AIC_Version:" + cloudSite.getCloudVersion());
+          logger.debug("Network Type:{} VersionMin:{} VersionMax:{} supported on Cloud:{} with AIC_Version:{}",
+              networkType, networkResource.getAicVersionMin(), networkResource.getAicVersionMax(), cloudSiteId,
+              cloudSite.getCloudVersion());
 			} else {
-				String error = "Network Type:" + networkType + " Version_Min:"
-						+ networkResource.getAicVersionMin() + " Version_Max:"
-						+ networkResource.getAicVersionMax()
-						+ " not supported on Cloud:" + cloudSiteId
-						+ " with AIC_Version:" + cloudSite.getCloudVersion();
-				LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
-						MsoLogger.ErrorCode.DataError,
-						"Network Type not supported on Cloud");
-				LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-						MsoLogger.ResponseCode.DataError, error);
+          String error = String
+              .format("Network Type:%s Version_Min:%s Version_Max:%s not supported on Cloud:%s with AIC_Version:%s",
+                  networkType, networkType, networkResource.getAicVersionMin(),
+                  networkResource.getAicVersionMax(), cloudSiteId, cloudSite.getCloudVersion());
+          logger.error("{} {} {} ", MessageEnum.RA_CONFIG_EXC, MsoLogger.ErrorCode.DataError.getValue(), error);
 				throw new NetworkException(error, MsoExceptionCategory.USERDATA);
 			}
 
@@ -1215,9 +1076,7 @@
 					networkName, physicalNetworkName, vlans, routeTargets);
 			if (!missing.isEmpty()) {
 				String error = "Create Network: Missing parameters: " + missing;
-				LOGGER.error(MessageEnum.RA_MISSING_PARAM, missing,
-						"OpenStack", "", MsoLogger.ErrorCode.DataError,
-						"Create Network: Missing parameters");
+          logger.error("{} {} {}", MessageEnum.RA_MISSING_PARAM, MsoLogger.ErrorCode.DataError.getValue(), error);
 
 				throw new NetworkException(error, MsoExceptionCategory.USERDATA);
 			}
@@ -1293,11 +1152,7 @@
                               Holder <Map <String, String>> subnetIdMap) throws NetworkException {
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName ("QueryNetwork");
-        LOGGER.debug ("*** QUERY Network with Network: " + networkNameOrId
-                + " in "
-                + cloudSiteId
-                + "/"
-                + tenantId);
+        logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
 
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
@@ -1307,22 +1162,17 @@
             || commonUtils.isNullOrEmpty(networkNameOrId)) {
 
             String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId";
-            LOGGER.error (MessageEnum.RA_MISSING_PARAM, "cloudSiteId or tenantId or networkNameOrId", "OpenStack", "", MsoLogger.ErrorCode.DataError, "Missing mandatory parameter cloudSiteId, tenantId or networkId");
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+            logger.error("{} {} {}", MessageEnum.RA_MISSING_PARAM, MsoLogger.ErrorCode.DataError.getValue(), error);
             throw new NetworkException (error, MsoExceptionCategory.USERDATA);
         }
 
         Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId);
         if (!cloudSiteOpt.isPresent())
         {
-        	String error = "Configuration Error. Stack " + networkNameOrId + " in "
-        			+ cloudSiteId
-        			+ "/"
-        			+ tenantId
-        			+ ": "
-        			+ " CloudSite does not exist in MSO Configuration";
-        	LOGGER.error (MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Configuration Error");
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+            String error = String
+                .format("Configuration Error. Stack %s in %s/%s: CloudSite does not exist in MSO Configuration",
+                    networkNameOrId, cloudSiteId, tenantId);
+            logger.error("{} {} {}", MessageEnum.RA_CONFIG_EXC, MsoLogger.ErrorCode.DataError.getValue(), error);
         	// Set the detailed error as the Exception 'message'
         	throw new NetworkException (error, MsoExceptionCategory.USERDATA);
         }
@@ -1336,19 +1186,10 @@
         long queryStackStarttime = System.currentTimeMillis ();
         try {
             heatStack = heat.queryStack (cloudSiteId, tenantId, networkNameOrId);
-            LOGGER.recordMetricEvent (queryStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryStack", null);
         } catch (MsoException me) {
         	me.addContext ("QueryNetwork");
-            String error = "Query Network (heat): " + networkNameOrId
-                           + " in "
-                           + cloudSiteId
-                           + "/"
-                           + tenantId
-                           + ": "
-                           + me;
-            LOGGER.recordMetricEvent (queryStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "BPMN", "QueryStack", null);
-            LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkNameOrId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Exception - Query Network (heat)", me);
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+            logger.error("{} {} Exception - Query Network (heat): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), networkNameOrId, cloudSiteId, tenantId, me);
             throw new NetworkException (me);
         }
 
@@ -1388,7 +1229,6 @@
         long queryNetworkStarttime = System.currentTimeMillis ();
         try {
             NetworkInfo netInfo = neutron.queryNetwork (neutronId, tenantId, cloudSiteId);
-            LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryNetwork", null);
             if (netInfo != null) {
                 // Found. Populate the output elements
                 networkExists.value = Boolean.TRUE;
@@ -1402,12 +1242,8 @@
                 if (vlans != null)
                 	vlans.value = netInfo.getVlans ();
 
-                LOGGER.debug ("Network " + networkNameOrId
-                              + " found ("
-                              + mode
-                              + "), ID = "
-                              + networkId.value
-                              + ("HEAT".equals (mode) ? ",NeutronId = " + neutronNetworkId.value : ""));
+                logger.debug("Network {} found({}), ID = {}{}", networkNameOrId, mode, networkId.value,
+                    ("HEAT".equals(mode) ? ",NeutronId = " + neutronNetworkId.value : ""));
             } else {
                 // Not found. Populate the status fields, leave the rest null
                 networkExists.value = Boolean.FALSE;
@@ -1416,23 +1252,14 @@
                 if (vlans != null)
                 	vlans.value = new ArrayList<>();
 
-                LOGGER.debug ("Network " + networkNameOrId + " not found");
+                logger.debug("Network {} not found", networkNameOrId);
             }
         } catch (MsoException me) {
             me.addContext ("QueryNetwork");
-            String error = "Query Network (neutron): " + networkNameOrId
-                           + " in "
-                           + cloudSiteId
-                           + "/"
-                           + tenantId
-                           + ": "
-                           + me;
-            LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryNetwork", null);
-            LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkNameOrId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - Query Network (neutron)", me);
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+            logger.error("{} {} Exception - Query Network (neutron): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
+                MsoLogger.ErrorCode.DataError.getValue(), networkNameOrId, cloudSiteId, tenantId, me);
             throw new NetworkException (me);
         }
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully queried network");
         return;
     }
 
@@ -1464,11 +1291,7 @@
                                Holder <Boolean> networkDeleted) throws NetworkException {
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName ("DeleteNetwork");
-        LOGGER.debug ("*** DELETE Network adapter with Network: " + networkId
-                                      + " in "
-                                      + cloudSiteId
-                                      + "/"
-                                      + tenantId);
+        logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId);
 
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
@@ -1478,8 +1301,7 @@
                             || commonUtils.isNullOrEmpty(tenantId)
                             || commonUtils.isNullOrEmpty(networkId)) {
                 String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId";
-                LOGGER.error (MessageEnum.RA_MISSING_PARAM, "cloudSiteId or tenantId or networkId", "Openstack", "", MsoLogger.ErrorCode.DataError, "Missing mandatory parameter cloudSiteId, tenantId or networkId");
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                logger.error("{} {} {} ", MessageEnum.RA_MISSING_PARAM, MsoLogger.ErrorCode.DataError.getValue(), error);
                 throw new NetworkException (error, MsoExceptionCategory.USERDATA);
             }
 
@@ -1499,7 +1321,7 @@
         	
             String mode = "";
             if (networkResource != null) {
-                LOGGER.debug ("Got Network definition from Catalog: " + networkResource.toString ());
+                logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
 
                 mode = networkResource.getOrchestrationMode ();
             }
@@ -1512,20 +1334,11 @@
                     // The deleteNetwork function in MsoNeutronUtils returns success if the network
                     // was not found. So don't bother to query first.
                     boolean deleted = neutron.deleteNetwork (networkId, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteNetwork", null);
                     networkDeleted.value = deleted;
                 } catch (MsoException me) {
                     me.addContext ("DeleteNetwork");
-                	String error = "Delete Network (neutron): " + networkId
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
-                    LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Delete Network (neutron)", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Delete Network (neutron): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC,
+                        MsoLogger.ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me);
                     throw new NetworkException (me);
                 }
             } else { // DEFAULT to ("HEAT".equals (mode))
@@ -1539,7 +1352,6 @@
                 	if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND)
                 	{
                 		heat.deleteStack (tenantId, cloudSiteId, networkId, true);
-                		LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteStack", null);
                 		networkDeleted.value = true;
                 	}
                 	else
@@ -1548,23 +1360,14 @@
                 	}
                 } catch (MsoException me) {
                     me.addContext ("DeleteNetwork");
-                	String error = "Delete Network (heat): " + networkId
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
-                    LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Delete Network (heat)", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    logger.error("{} {} Delete Network (heat): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC,
+                        MsoLogger.ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me);
                     throw new NetworkException (me);
                 }
             }
        
 
         // On success, nothing is returned.
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully deleted network");
         return;
     }
 
@@ -1584,8 +1387,8 @@
         long startTime = System.currentTimeMillis ();
 
         if (rollback == null) {
-        	LOGGER.error (MessageEnum.RA_ROLLBACK_NULL, "Openstack", "", MsoLogger.ErrorCode.DataError, "rollback is null");
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "No action to perform");
+            logger
+                .error("{} {} rollback is null", MessageEnum.RA_ROLLBACK_NULL, MsoLogger.ErrorCode.DataError.getValue());
             return;
         }
 
@@ -1598,9 +1401,8 @@
         String networkType = rollback.getNetworkType ();
         String modelCustomizationUuid = rollback.getModelCustomizationUuid();
 
-        LOGGER.debug ("*** ROLLBACK Network " + networkId + " in " + cloudSiteId + "/" + tenantId);
+        logger.debug("*** ROLLBACK Network {} in {}/{}", networkId, cloudSiteId, tenantId);
 
-    
 
             // Retrieve the Network Resource definition
             NetworkResource networkResource = null;
@@ -1612,7 +1414,7 @@
             String mode = "";
             if (networkResource != null) {
 
-                LOGGER.debug ("Got Network definition from Catalog: " + networkResource.toString ());
+                logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
 
                 mode = networkResource.getOrchestrationMode ();
             }
@@ -1626,19 +1428,11 @@
                         // The deleteNetwork function in MsoNeutronUtils returns success if the network
                         // was not found. So don't bother to query first.
                         neutron.deleteNetwork (networkId, tenantId, cloudSiteId);
-                        LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteNetwork", null);
                     } catch (MsoException me) {
                         me.addContext ("RollbackNetwork");
-                        String error = "Rollback Network (neutron): " + networkId
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
-                        LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (neutron)", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        logger.error("{} {} Exception - Rollback Network (neutron): {} in {}/{} ",
+                            MessageEnum.RA_DELETE_NETWORK_EXC, MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+                            networkId, cloudSiteId, tenantId, me);
                         throw new NetworkException (me);
                     }
                 } else { // DEFAULT to if ("HEAT".equals (mode))
@@ -1647,25 +1441,16 @@
                         // The deleteStack function in MsoHeatUtils returns success if the stack
                         // was not found. So don't bother to query first.
                         heat.deleteStack (tenantId, cloudSiteId, networkId, true);
-                        LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteStack", null);
                     } catch (MsoException me) {
                         me.addContext ("RollbackNetwork");
-                        String error = "Rollback Network (heat): " + networkId
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
-                        LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (heat)", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ",
+                            MessageEnum.RA_DELETE_NETWORK_EXC, MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+                            networkId, cloudSiteId, tenantId, me);
                         throw new NetworkException (me);
                     }
                 }
             }
 
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully rolled back network");
         return;
     }
 
@@ -1740,7 +1525,7 @@
             	{
             		String routeTarget = rt.getRouteTarget();
             		String routeTargetRole = rt.getRouteTargetRole();
-            		LOGGER.debug("Checking for an actually null route target: " + rt.toString());
+                  logger.debug("Checking for an actually null route target: {}", rt);
             		if (routeTarget == null || routeTarget.equals("") || routeTarget.equalsIgnoreCase("null"))
             			rtIsNull = true;
             		if (routeTargetRole == null || routeTargetRole.equals("") || routeTargetRole.equalsIgnoreCase("null"))
@@ -1749,7 +1534,7 @@
             		rtIsNull = true;
             	}
             	if (!rtIsNull) {
-            		LOGGER.debug("Input RT:" + rt.toString());
+                  logger.debug("Input RT:{}", rt);
             		String role = rt.getRouteTargetRole();
             		String rtValue = rt.getRouteTarget();
             		
@@ -1827,7 +1612,7 @@
 				ContrailPolicyRefSeq refSeq = new ContrailPolicyRefSeq(String.valueOf(index), "0");
 				pr.setSeq(refSeq);
 				index++;
-				LOGGER.debug("Contrail PolicyRefs Data:" + pr.toString());
+          logger.debug("Contrail PolicyRefs Data:{}", pr);
 				prlist.add(pr);
 			}
 		}
@@ -1838,12 +1623,13 @@
 			ObjectMapper mapper = new ObjectMapper();
 			node = mapper.convertValue(prlist, JsonNode.class);
 			String jsonString = mapper.writeValueAsString(prlist);
-			LOGGER.debug("Json PolicyRefs Data:" + jsonString);
+        logger.debug("Json PolicyRefs Data:{}", jsonString);
 		}
 		catch (Exception e)
 		{
 			String error = "Error creating JsonNode for policyRefs Data";
-			LOGGER.error (MessageEnum.RA_MARSHING_ERROR, error, "Openstack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception creating JsonNode for policyRefs Data", e);
+        logger.error("{} {} {} ", MessageEnum.RA_MARSHING_ERROR, MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+            error, e);
 			throw new MsoAdapterException (error);
 		}
 		//update parameters
@@ -1863,7 +1649,7 @@
 			stackParams.put ("policy_refsdata", node);
 		}
 
-		LOGGER.debug ("StackParams updated with policy refs");
+        logger.debug("StackParams updated with policy refs");
 		return;
     }
 
@@ -1885,7 +1671,7 @@
 			stackParams.put ("route_table_refs", csl);
 		}
 
-		LOGGER.debug ("StackParams updated with route_table refs");
+        logger.debug("StackParams updated with route_table refs");
 		return;
     }
 
@@ -1948,9 +1734,9 @@
 		//Resource Property
 		List<ContrailSubnet> cslist =  new ArrayList <> ();
 		for (Subnet subnet : subnets) {
-			LOGGER.debug("Input Subnet:" + subnet.toString());
+        logger.debug("Input Subnet:{}", subnet.toString());
 			ContrailSubnet cs = new ContrailSubnetMapper(subnet).map();
-			LOGGER.debug("Contrail Subnet:" + cs.toString());
+        logger.debug("Contrail Subnet:{}", cs.toString());
 			cslist.add(cs);
 		}
 
@@ -1960,12 +1746,12 @@
 			ObjectMapper mapper = new ObjectMapper();
 			node = mapper.convertValue(cslist, JsonNode.class);
 			String jsonString = mapper.writeValueAsString(cslist);
-			LOGGER.debug("Json Subnet List:" + jsonString);
+        logger.debug("Json Subnet List:{}", jsonString);
 		}
 		catch (Exception e)
 		{
 			String error = "Error creating JsonNode from input subnets";
-			LOGGER.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.DataError, "Exception creating JsonNode from input subnets", e);
+        logger.error("{} {} {} ", MessageEnum.RA_MARSHING_ERROR, MsoLogger.ErrorCode.DataError.getValue(), error, e);
 			throw new MsoAdapterException (error);
 		}
 		//update parameters
@@ -1980,7 +1766,7 @@
 		// append outputs in heatTemplate
 		int outputsIdx = heatTemplate.indexOf ("outputs:");
 		heatTemplate = insertStr (heatTemplate, outputTempl, outputsIdx + 8);
-		LOGGER.debug ("Template updated with all AIC3.0 subnets:" + heatTemplate);
+        logger.debug("Template updated with all AIC3.0 subnets:{}", heatTemplate);
 		return heatTemplate;
     }
 
@@ -2018,7 +1804,7 @@
     				curR = curR.replace ("%subnetId%", subnet.getSubnetId ());
     			} else {
     				String error = "Missing Required AAI SubnetId for subnet in HEAT Template";
-    				LOGGER.error (MessageEnum.RA_MISSING_PARAM, error, "Openstack", "", MsoLogger.ErrorCode.DataError, "Missing Required AAI ID  for subnet in HEAT Template");
+              logger.error("{} {} {} ", MessageEnum.RA_MISSING_PARAM, MsoLogger.ErrorCode.DataError.getValue(), error);
     				throw new MsoAdapterException (error);
     			}
 
@@ -2032,7 +1818,7 @@
     				curR = curR.replace ("%cidr%", subnet.getCidr ());
     			} else {
     				String error = "Missing Required cidr for subnet in HEAT Template";
-    				LOGGER.error (MessageEnum.RA_MISSING_PARAM, error, "Openstack", "", MsoLogger.ErrorCode.DataError, "Missing Required cidr for subnet in HEAT Template");
+              logger.error("{} {} {} ", MessageEnum.RA_MISSING_PARAM, MsoLogger.ErrorCode.DataError.getValue(), error);
     				throw new MsoAdapterException (error);
     			}
 
@@ -2067,13 +1853,13 @@
 
     		}
     		// append resources and outputs in heatTemplate
-    		LOGGER.debug ("Tempate initial:" + heatTemplate);
+        logger.debug("Tempate initial:{}", heatTemplate);
     		int outputsIdx = heatTemplate.indexOf ("outputs:");
     		heatTemplate = insertStr (heatTemplate, outputsBuf.toString (), outputsIdx + 8);
     		int resourcesIdx = heatTemplate.indexOf ("resources:");
     		heatTemplate = insertStr (heatTemplate, resourcesBuf.toString (), resourcesIdx + 10);
 
-    		LOGGER.debug ("Template updated with all subnets:" + heatTemplate);
+        logger.debug("Template updated with all subnets:{}", heatTemplate);
     		return heatTemplate;
     }
 
@@ -2085,12 +1871,12 @@
     		Object obj = outputs.get(key);
     		ObjectMapper mapper = new ObjectMapper();
     		String jStr = mapper.writeValueAsString(obj);
-    		LOGGER.debug ("Subnet_Ipam Output JSON String:" + obj.getClass() + " " + jStr);
+          logger.debug("Subnet_Ipam Output JSON String:{} {}", obj.getClass(), jStr);
 
     		JsonNode rootNode = mapper.readTree(jStr);
     		for (JsonNode sNode : rootNode.path("ipam_subnets"))
     		{
-    			LOGGER.debug("Output Subnet Node" + sNode.toString());
+            logger.debug("Output Subnet Node {}", sNode.toString());
     			String name = sNode.path("subnet_name").textValue();
     			String uuid = sNode.path("subnet_uuid").textValue();
     			String aaiId = name; // default
@@ -2114,10 +1900,11 @@
     	}
     	catch (Exception e)
     	{
-    		LOGGER.error (MessageEnum.RA_MARSHING_ERROR, "error getting subnet-uuids", "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception getting subnet-uuids", e);
+          logger.error("{} {} Exception getting subnet-uuids ", MessageEnum.RA_MARSHING_ERROR,
+              MsoLogger.ErrorCode.DataError.getValue(), e);
     	}
 
-    	LOGGER.debug ("Return sMap" + sMap.toString());
+        logger.debug("Return sMap {}", sMap.toString());
     	return sMap;
     }
 
@@ -2125,14 +1912,14 @@
 
         String updatedTemplate;
 
-        LOGGER.debug ("Index:" + index + " Snippet:" + snippet);
+        logger.debug("Index:{} Snippet:{}", index, snippet);
 
         String templateBeg = template.substring (0, index);
         String templateEnd = template.substring (index);
 
         updatedTemplate = templateBeg + "\n" + snippet + templateEnd;
 
-        LOGGER.debug ("Template updated with a subnet:" + updatedTemplate);
+        logger.debug("Template updated with a subnet:{}", updatedTemplate);
         return updatedTemplate;
     }
 
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
index fd65824..27b2b6a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -22,10 +24,14 @@
 package org.onap.so.adapters.network;
 
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import javax.inject.Provider;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -40,7 +46,6 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.xml.ws.Holder;
-
 import org.apache.http.HttpStatus;
 import org.onap.so.adapters.network.exceptions.NetworkException;
 import org.onap.so.adapters.nwrest.ContrailNetwork;
@@ -67,25 +72,21 @@
 import org.onap.so.openstack.beans.NetworkStatus;
 import org.onap.so.openstack.beans.RouteTarget;
 import org.onap.so.openstack.exceptions.MsoExceptionCategory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
 @Path("/v1/networks")
 @Api(value = "/v1/networks", description = "root of network adapters restful web service")
 @Component
 @Transactional
 public class NetworkAdapterRest {
-	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,NetworkAdapterRest.class);
+
+    private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterRest.class);
 	private static final String TESTING_KEYWORD = "___TESTING___";
-	private String APPEND_RESPONSE = ", resp=";
 	private String EXCEPTION = "Exception:";
 
 	@Autowired
@@ -109,7 +110,7 @@
 	public Response createNetwork(
 				@ApiParam(value = "details of network being created", required = true) 
 				CreateNetworkRequest req) {
-		LOGGER.debug("createNetwork enter: " + req.toJsonString());
+      logger.debug("createNetwork enter: {}", req.toJsonString());
 		CreateNetworkTask task = new CreateNetworkTask(req);
 		if (req.isSynchronous()) {
 			// This is a synchronous request
@@ -125,11 +126,12 @@
 				t1.start();
 			} catch (Exception e) {
 				// problem handling create, send generic failure as sync resp to caller
-				LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while create network", e);
+          logger.error("{} {} Exception while create network ", MessageEnum.RA_CREATE_NETWORK_EXC,
+              MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
 				return Response.serverError().build();
 			}
 			// send sync response (ACK) to caller
-			LOGGER.debug ("createNetwork exit");
+        logger.debug("createNetwork exit");
 			return Response.status(HttpStatus.SC_ACCEPTED).build();
 		}
 	}
@@ -161,7 +163,7 @@
 		}
 		@Override
 		public void run() {
-			LOGGER.debug ("CreateNetworkTask start");
+        logger.debug("CreateNetworkTask start");
 			try {
 				// Synchronous Web Service Outputs
 				Holder<String> networkId = new Holder<>();
@@ -269,7 +271,7 @@
 						rollback.value,
 						req.getMessageId());
 			} catch (NetworkException e) {
-			    LOGGER.debug (EXCEPTION, e);
+          logger.debug(EXCEPTION, e);
 				eresp = new CreateNetworkError(
 					e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
 			}
@@ -278,7 +280,7 @@
 				BpelRestClient bpelClient = bpelRestClientProvider.get();
 				bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
 			}
-			LOGGER.debug ("CreateNetworkTask exit: code=" + getStatusCode() + APPEND_RESPONSE+ getResponse());
+        logger.debug("CreateNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse());
 		}
 	}
 
@@ -299,7 +301,7 @@
 		@ApiParam(value = "details of network being deleted", required = true) 
 		DeleteNetworkRequest req)
 	{
-		LOGGER.debug("deleteNetwork enter: " + req.toJsonString());
+      logger.debug("deleteNetwork enter: {}", req.toJsonString());
 		if (aaiNetworkId == null || !aaiNetworkId.equals(req.getNetworkId())) {
 			return Response
 				.status(HttpStatus.SC_BAD_REQUEST)
@@ -322,11 +324,12 @@
 				t1.start();
 			} catch (Exception e) {
 				// problem handling create, send generic failure as sync resp to caller
-				LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while delete network", e);
+          logger.error("{} {} Exception while delete network ", MessageEnum.RA_DELETE_NETWORK_EXC,
+              MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
 				return Response.serverError().build();
 			}
 			// send sync response (ACK) to caller
-			LOGGER.debug ("deleteNetwork exit");
+        logger.debug("deleteNetwork exit");
 			return Response.status(HttpStatus.SC_ACCEPTED).build();
 		}
 	}
@@ -358,7 +361,7 @@
 		}
 		@Override
 		public void run() {
-			LOGGER.debug("DeleteNetworkTask start");
+        logger.debug("DeleteNetworkTask start");
 			try {
 				Holder<Boolean> networkDeleted = new Holder<>();
 				if (req.getCloudSiteId().equals(TESTING_KEYWORD)) {
@@ -375,7 +378,7 @@
 				}
 				response = new DeleteNetworkResponse(req.getNetworkId(), networkDeleted.value, req.getMessageId());
 			} catch (NetworkException e) {
-			    LOGGER.debug (EXCEPTION, e);
+          logger.debug(EXCEPTION, e);
 				eresp = new DeleteNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
 			}
 			if (!req.isSynchronous()) {
@@ -383,7 +386,7 @@
 				BpelRestClient bpelClient = bpelRestClientProvider.get();
 				bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
 			}
-			LOGGER.debug("DeleteNetworkTask exit: code=" + getStatusCode() + APPEND_RESPONSE+ getResponse());
+        logger.debug("DeleteNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse());
 		}
 	}
 
@@ -413,7 +416,7 @@
 		@PathParam("aaiNetworkId") String aaiNetworkId)
 	{
 		//This request responds synchronously only
-		LOGGER.debug ("Query network enter:" + aaiNetworkId);
+      logger.debug("Query network enter:{}" + aaiNetworkId);
 		MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId);
 
 		try {
@@ -430,10 +433,10 @@
 				networkExists, networkId, neutronNetworkId, status, routeTargets, subnetIdMap);
 
 			if (!networkExists.value) {
-				LOGGER.debug ("network not found");
+          logger.debug("network not found");
 				respStatus = HttpStatus.SC_NOT_FOUND;
 			} else {
-				LOGGER.debug ("network found" + networkId.value + ", status=" + status.value);
+          logger.debug("network found {}, status={}", networkId.value, status.value);
 				resp.setNetworkExists(networkExists.value);
 				resp.setNetworkId(networkId.value);
 				resp.setNeutronNetworkId(neutronNetworkId.value);
@@ -441,13 +444,14 @@
 				resp.setRouteTargets(routeTargets.value);
 				resp.setSubnetIdMap(subnetIdMap.value);
 			}
-			LOGGER.debug ("Query network exit");
+        logger.debug("Query network exit");
 			return Response
 				.status(respStatus)
 				.entity(new GenericEntity<QueryNetworkResponse>(resp) {})
 				.build();
 		} catch (NetworkException e) {
-			LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, aaiNetworkId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception when query VNF", e);
+        logger.error("{} {} Exception when query VNF ", MessageEnum.RA_QUERY_VNF_ERR,
+            MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
 			QueryNetworkError err = new QueryNetworkError();
 			err.setMessage(e.getMessage());
 			err.setCategory(MsoExceptionCategory.INTERNAL);
@@ -473,7 +477,7 @@
 		@ApiParam(value = "RollbackNetworkRequest in JSON format", required = true)
 		RollbackNetworkRequest req)
 	{
-		LOGGER.debug("rollbackNetwork enter: " + req.toJsonString());
+      logger.debug("rollbackNetwork enter: {}", req.toJsonString());
 		RollbackNetworkTask task = new RollbackNetworkTask(req);
 		if (req.isSynchronous()) {
 			// This is a synchronous request
@@ -489,11 +493,12 @@
 				t1.start();
 			} catch (Exception e) {
 				// problem handling create, send generic failure as sync resp to caller
-				LOGGER.error (MessageEnum.RA_ROLLBACK_NULL, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in rollbackNetwork", e);
+          logger.error("{} {} Exception in rollbackNetwork ", MessageEnum.RA_ROLLBACK_NULL,
+              MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
 				return Response.serverError().build();
 			}
 			// send sync response (ACK) to caller
-			LOGGER.debug("rollbackNetwork exit");
+        logger.debug("rollbackNetwork exit");
 			return Response.status(HttpStatus.SC_ACCEPTED).build();
 		}
 	}
@@ -525,13 +530,13 @@
 		}
 		@Override
 		public void run() {
-			LOGGER.debug("RollbackNetworkTask start");
+        logger.debug("RollbackNetworkTask start");
 			try {
 				NetworkRollback nwr = req.getNetworkRollback();
 				adapter.rollbackNetwork(nwr);
 				response = new RollbackNetworkResponse(true, req.getMessageId());
 			} catch (NetworkException e) {
-			    LOGGER.debug (EXCEPTION, e);
+          logger.debug(EXCEPTION, e);
 				eresp = new RollbackNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
 			}
 			if (!req.isSynchronous()) {
@@ -539,7 +544,7 @@
 				BpelRestClient bpelClient = bpelRestClientProvider.get();
 				bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
 			}
-			LOGGER.debug("RollbackNetworkTask exit: code=" + getStatusCode() + APPEND_RESPONSE+ getResponse());
+        logger.debug("RollbackNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse());
 		}
 	}
 
@@ -560,7 +565,7 @@
 		@ApiParam(value = "UpdateNetworkRequest in JSON format", required = true)
 		UpdateNetworkRequest req)
 	{
-		LOGGER.debug("updateNetwork enter: " + req.toJsonString());
+      logger.debug("updateNetwork enter: {}", req.toJsonString());
 		if (aaiNetworkId == null || !aaiNetworkId.equals(req.getNetworkId())) {
 			return Response
 				.status(HttpStatus.SC_BAD_REQUEST)
@@ -583,11 +588,12 @@
 	    		t1.start();
 	    	} catch (Exception e) {
 	    		// problem handling create, send generic failure as sync resp to caller
-	    		LOGGER.error (MessageEnum.RA_UPDATE_NETWORK_ERR, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in updateNetwork", e);
+            logger.error("{} {} Exception in updateNetwork ", MessageEnum.RA_UPDATE_NETWORK_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
 	    		return Response.serverError().build();
 	    	}
 	    	// send sync response (ACK) to caller
-	    	LOGGER.debug ("updateNetwork exit");
+        logger.debug("updateNetwork exit");
 	    	return Response.status(HttpStatus.SC_ACCEPTED).build();
 		}
 	}
@@ -619,7 +625,7 @@
 		}
 		@Override
 		public void run() {
-			LOGGER.debug("UpdateNetworkTask start");
+        logger.debug("UpdateNetworkTask start");
 			try {
 				Holder<Map<String, String>> subnetIdMap = new Holder<>();
 				Holder<NetworkRollback> rollback = new Holder<> ();
@@ -709,7 +715,7 @@
 					subnetIdMap.value,
 					req.getMessageId());
 			} catch (NetworkException e) {
-			    LOGGER.debug (EXCEPTION, e);
+          logger.debug(EXCEPTION, e);
 				eresp = new UpdateNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
 			}
 			if (!req.isSynchronous()) {
@@ -717,7 +723,7 @@
 				BpelRestClient bpelClient = bpelRestClientProvider.get();
 				bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
 			}
-			LOGGER.debug("UpdateNetworkTask exit: code=" + getStatusCode() + APPEND_RESPONSE+ getResponse());
+        logger.debug("UpdateNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse());
 		}
 	}
 
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
index b86681e..db9226b 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
@@ -5,6 +5,7 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,12 +25,10 @@
 
 
 import java.util.Map;
-
 import javax.annotation.Resource;
 import javax.jws.WebService;
 import javax.xml.ws.Holder;
 import javax.xml.ws.WebServiceContext;
-
 import org.onap.so.adapters.tenant.exceptions.TenantAlreadyExists;
 import org.onap.so.adapters.tenant.exceptions.TenantException;
 import org.onap.so.adapters.tenantrest.TenantRollback;
@@ -41,6 +40,8 @@
 import org.onap.so.openstack.exceptions.MsoException;
 import org.onap.so.openstack.utils.MsoTenantUtils;
 import org.onap.so.openstack.utils.MsoTenantUtilsFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -52,14 +53,13 @@
     public static final String QUERY_TENANT = "QueryTenant";
     public static final String DELETE_TENANT = "DeleteTenant";
     public static final String ROLLBACK_TENANT = "RollbackTenant";
-	private static final String SUCCESS_RESPONSE_OPENSTACK="Successfully received response from Open Stack";
-	private static final String OPENSTACK_COMMUNICATE_EXCEPTION_MSG="Exception while communicate with Open Stack";
+    private static final String OPENSTACK_COMMUNICATE_EXCEPTION_MSG = "{} {} Exception while communicate with Open Stack ";
     @Resource
     private WebServiceContext wsContext;
 
     @Autowired
 	private MsoTenantUtilsFactory tFactory;
-    private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoTenantAdapterImpl.class);
+    private static Logger logger = LoggerFactory.getLogger(MsoTenantAdapterImpl.class);
     /**
      * Health Check web method. Does nothing but return to show the adapter is deployed.
      */
@@ -91,12 +91,7 @@
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (CREATE_TENANT);
 
-        logger.debug ("Call to MSO createTenant adapter. Creating Tenant: " + tenantName
-                                      + "in "
-                                      + cloudSiteId);
-
-        // Will capture total time for metrics
-        long startTime = System.currentTimeMillis ();
+        logger.debug("Call to MSO createTenant adapter. Creating Tenant: {} in {}", tenantName, cloudSiteId);
 
         // Start building up rollback object
         TenantRollback tenantRollback = new TenantRollback ();
@@ -107,57 +102,47 @@
 		try {
 			tUtils = tFactory.getTenantUtils (cloudSiteId);
 		} catch (MsoCloudSiteNotFound me) {
-            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, "no implementation found for " + cloudSiteId, me);
+        logger.error("{} {} no implementation found for {}: ", MessageEnum.RA_CREATE_TENANT_ERR,
+            MsoLogger.ErrorCode.DataError.getValue(), cloudSiteId, me);
             throw new TenantException (me);
 		}
 
         MsoTenant newTenant = null;
         String newTenantId;
-        long queryTenantStartTime = System.currentTimeMillis ();
         try {
             newTenant = tUtils.queryTenantByName (tenantName, cloudSiteId);
-            logger.recordMetricEvent (queryTenantStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_RESPONSE_OPENSTACK, OPENSTACK, QUERY_TENANT, null);
         } catch (MsoException me) {
-            logger.recordMetricEvent (queryTenantStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, OPENSTACK, QUERY_TENANT, null);
-            String error = "Create Tenant " + tenantName + ": " + me;
-            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, me);
-            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+            logger.error(OPENSTACK_COMMUNICATE_EXCEPTION_MSG, MessageEnum.RA_CREATE_TENANT_ERR,
+                MsoLogger.ErrorCode.DataError.getValue(), me);
             throw new TenantException (me);
         }
         if (newTenant == null) {
             if (backout == null)
                 backout = true;
-            long createTenantStartTime = System.currentTimeMillis ();
             try {
                 newTenantId = tUtils.createTenant (tenantName, cloudSiteId, metadata, backout.booleanValue ());
-                logger.recordMetricEvent (createTenantStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_RESPONSE_OPENSTACK, OPENSTACK, CREATE_TENANT, null);
             } catch (MsoException me) {
-                logger.recordMetricEvent (createTenantStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, OPENSTACK, CREATE_TENANT, null);
-                String error = "Create Tenant " + tenantName + ": " + me;
-                logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, me);
-                logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                logger.error (OPENSTACK_COMMUNICATE_EXCEPTION_MSG, MessageEnum.RA_CREATE_TENANT_ERR, MsoLogger.ErrorCode.DataError.getValue(), me);
                 throw new TenantException (me);
             }
             tenantRollback.setTenantId (newTenantId);
             tenantRollback.setTenantCreated (true);
-            logger.debug ("Tenant " + tenantName + " successfully created with ID " + newTenantId);
+            logger.debug ("Tenant {} successfully created with ID {}", tenantName, newTenantId);
         } else {
             if (failIfExists != null && failIfExists) {
-                String error = CREATE_TENANT + ": Tenant " + tenantName + " already exists in " + cloudSiteId;
-                logger.error (MessageEnum.RA_TENANT_ALREADY_EXIST, tenantName, cloudSiteId, OPENSTACK, "", MsoLogger.ErrorCode.DataError, CREATE_TENANT + ", Tenant already exists");
-                logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+                logger.error("{} {} CreateTenant: Tenant {} already exists in {} ", MessageEnum.RA_TENANT_ALREADY_EXIST,
+                    MsoLogger.ErrorCode.DataError.getValue(), tenantName, cloudSiteId);
                 throw new TenantAlreadyExists (tenantName, cloudSiteId, newTenant.getTenantId ());
             }
 
             newTenantId = newTenant.getTenantId ();
             tenantRollback.setTenantCreated (false);
-            logger.debug ("Tenant " + tenantName + " already exists with ID " + newTenantId);
+            logger.debug("Tenant {} already exists with ID {}", tenantName, newTenantId);
         }
 
 
         tenantId.value = newTenantId;
         rollback.value = tenantRollback;
-        logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create tenant");
         return;
     }
 
@@ -170,48 +155,41 @@
                              Holder <Map <String, String>> metadata) throws TenantException {
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (QUERY_TENANT);
-        logger.debug ("Querying Tenant " + tenantNameOrId + " in " + cloudSiteId);
-
-        // Will capture execution time for metrics
-        long startTime = System.currentTimeMillis ();
+        logger.debug ("Querying Tenant {} in {}", tenantNameOrId, cloudSiteId);
 
         MsoTenantUtils tUtils;
 		try {
 			tUtils = tFactory.getTenantUtils (cloudSiteId);
 		} catch (MsoCloudSiteNotFound me) {
-            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, "no implementation found for " + cloudSiteId, me);
+        logger.error("{} {} no implementation found for {}: ", MessageEnum.RA_CREATE_TENANT_ERR,
+            MsoLogger.ErrorCode.DataError.getValue(), cloudSiteId, me);
             throw new TenantException (me);
 		}
         
         MsoTenant qTenant = null;
-        long subStartTime = System.currentTimeMillis ();
         try {
             qTenant = tUtils.queryTenant (tenantNameOrId, cloudSiteId);
-            logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_RESPONSE_OPENSTACK, OPENSTACK, QUERY_TENANT, null);
             if (qTenant == null) {
                 // Not found by ID, Try by name.
                 qTenant = tUtils.queryTenantByName (tenantNameOrId, cloudSiteId);
             }
 
             if (qTenant == null) {
-                logger.debug ("QueryTenant: Tenant " + tenantNameOrId + " not found");
+                logger.debug ("QueryTenant: Tenant {} not found", tenantNameOrId);
                 tenantId.value = null;
                 tenantName.value = null;
                 metadata.value = null;
             } else {
-                logger.debug ("QueryTenant: Tenant " + tenantNameOrId + " found with ID " + qTenant.getTenantId ());
+                logger.debug("QueryTenant: Tenant {} found with ID {}", tenantNameOrId, qTenant.getTenantId());
                 tenantId.value = qTenant.getTenantId ();
                 tenantName.value = qTenant.getTenantName ();
                 metadata.value = qTenant.getMetadata ();
             }
         } catch (MsoException me) {
-            String error = "Query Tenant " + tenantNameOrId + ": " + me;
-            logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, OPENSTACK, QUERY_TENANT, null);
-            logger.error (MessageEnum.RA_GENERAL_EXCEPTION, me.getMessage(), OPENSTACK, "", MsoLogger.ErrorCode.DataError, "Exception in queryTenant", me);
-            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+            logger.error("Exception in queryTenant for {}: ", MessageEnum.RA_GENERAL_EXCEPTION,
+                MsoLogger.ErrorCode.DataError.getValue(), tenantNameOrId, me);
             throw new TenantException (me);
         }
-        logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully query tenant");
         return;
     }
 
@@ -223,29 +201,21 @@
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (DELETE_TENANT);
 
-        logger.debug ("Deleting Tenant " + tenantId + " in " + cloudSiteId);
-
-        // Will capture execution time for metrics
-        long startTime = System.currentTimeMillis ();
+        logger.debug ("Deleting Tenant {} in {}", tenantId, cloudSiteId);
 
         // Delete the Tenant.
-        long subStartTime = System.currentTimeMillis ();
         try {
         	
         	MsoTenantUtils tUtils = tFactory.getTenantUtils (cloudSiteId);
             boolean deleted = tUtils.deleteTenant (tenantId, cloudSiteId);
             tenantDeleted.value = deleted;
-            logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully communicate with Open Stack", OPENSTACK, DELETE_TENANT, null);
         } catch (MsoException me) {
-            String error = "Delete Tenant " + tenantId + ": " + me;
-            logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, OPENSTACK, DELETE_TENANT, null);
-            logger.error (MessageEnum.RA_DELETE_TEMAMT_ERR, me.getMessage(), OPENSTACK, "", MsoLogger.ErrorCode.DataError, "Exception - DeleteTenant", me);
-            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+            logger.error("{} {} Exception - DeleteTenant {}: ", MessageEnum.RA_DELETE_TEMAMT_ERR,
+                MsoLogger.ErrorCode.DataError.getValue(), tenantId, me);
             throw new TenantException (me);
         }
 
         // On success, nothing is returned.
-        logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully delete tenant");
         return;
     }
 
@@ -260,11 +230,11 @@
      */
     @Override
     public void rollbackTenant (TenantRollback rollback) throws TenantException {
-        long startTime = System.currentTimeMillis ();
         MsoLogger.setServiceName (ROLLBACK_TENANT);
         // rollback may be null (e.g. if stack already existed when Create was called)
         if (rollback == null) {
-            logger.warn (MessageEnum.RA_ROLLBACK_NULL, OPENSTACK, "rollbackTenant", MsoLogger.ErrorCode.DataError, "rollbackTenant, rollback is null");
+            logger.warn("{} {} rollbackTenant, rollback is null", MessageEnum.RA_ROLLBACK_NULL,
+                MsoLogger.ErrorCode.DataError.getValue());
             return;
         }
 
@@ -273,26 +243,21 @@
         String tenantId = rollback.getTenantId ();
 
         MsoLogger.setLogContext (rollback.getMsoRequest ());
-        logger.debug ("Rolling Back Tenant " + rollback.getTenantId () + " in " + cloudSiteId);
+        logger.debug("Rolling Back Tenant {} in {}", rollback.getTenantId(), cloudSiteId);
 
-        long subStartTime = System.currentTimeMillis ();
         if (rollback.getTenantCreated ()) {
             try {
             	 
             	MsoTenantUtils tUtils = tFactory.getTenantUtils (cloudSiteId);
                 tUtils.deleteTenant (tenantId, cloudSiteId);
-                logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully communicate with Open Stack", OPENSTACK, ROLLBACK_TENANT, null);
             } catch (MsoException me) {
                 me.addContext (ROLLBACK_TENANT);
                 // Failed to delete the tenant.
-                String error = "Rollback Tenant " + tenantId + ": " + me;
-                logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, OPENSTACK, ROLLBACK_TENANT, null);
-                logger.error (MessageEnum.RA_ROLLBACK_TENANT_ERR, me.getMessage(), OPENSTACK, "rollbackTenant", MsoLogger.ErrorCode.DataError, "Exception - rollbackTenant", me);
-                logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                logger.error("{} {} Exception - rollbackTenant {}: ", MessageEnum.RA_ROLLBACK_TENANT_ERR,
+                    MsoLogger.ErrorCode.DataError.getValue(), tenantId, me);
                 throw new TenantException (me);
             }
         }
-        logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully roll back tenant");
         return;
     }
 }
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java
index 41544c8..11051df 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java
@@ -6,6 +6,7 @@
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +25,12 @@
 package org.onap.so.adapters.tenant;
 
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
 import java.util.Map;
-
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -38,7 +43,6 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.xml.ws.Holder;
-
 import org.onap.so.adapters.tenant.exceptions.TenantAlreadyExists;
 import org.onap.so.adapters.tenant.exceptions.TenantException;
 import org.onap.so.adapters.tenantrest.CreateTenantError;
@@ -53,18 +57,13 @@
 import org.onap.so.adapters.tenantrest.RollbackTenantRequest;
 import org.onap.so.adapters.tenantrest.RollbackTenantResponse;
 import org.onap.so.adapters.tenantrest.TenantRollback;
-import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.MsoTenant;
 import org.onap.so.openstack.exceptions.MsoExceptionCategory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
 /**
  * This class services calls to the REST interface for Tenants (http://host:port/vnfs/rest/v1/tenants)
  * Both XML and JSON can be produced/consumed.  Set Accept: and Content-Type: headers appropriately.  XML is the default.
@@ -73,7 +72,8 @@
 @Api(value = "/v1/tenants", description = "root of tenant adapters restful web service")
 @Component
 public class TenantAdapterRest {
-	private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, TenantAdapterRest.class);
+
+    private static Logger logger = LoggerFactory.getLogger(TenantAdapterRest.class);
 	private static final String EXCEPTION= "Exception :";
 	//RAA? No logging in wrappers
 	@Autowired
@@ -122,7 +122,7 @@
 	public Response createTenant(
 			@ApiParam(value = "details of tenant being created", required = true) 			
 			CreateTenantRequest req) {
-		LOGGER.debug("createTenant enter: " + req.toJsonString());
+      logger.debug("createTenant enter: {}", req.toJsonString());
 
 		String newTenantId = null;
 		TenantRollback tenantRollback = new TenantRollback ();
@@ -145,17 +145,17 @@
 
 		}
 		catch (TenantAlreadyExists tae) {
-			LOGGER.debug(EXCEPTION,tae);
+        logger.debug(EXCEPTION, tae);
 			CreateTenantError exc = new CreateTenantError(tae.getMessage(), tae.getFaultInfo().getCategory(), Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).entity(exc).build();
 		}
 		catch (TenantException te) {
-			LOGGER.debug(EXCEPTION,te);
+        logger.debug(EXCEPTION, te);
 			CreateTenantError exc = new CreateTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory(), Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
 		catch (Exception e) {
-			LOGGER.debug(EXCEPTION,e);
+        logger.debug(EXCEPTION, e);
 			CreateTenantError exc = new CreateTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
@@ -208,12 +208,12 @@
 		    tenantDeleted = deleted.value;
 		}
 		catch (TenantException te) {
-			LOGGER.debug(EXCEPTION,te);
+        logger.debug(EXCEPTION, te);
 			DeleteTenantError exc = new DeleteTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory(), Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
 		catch (Exception e) {
-			LOGGER.debug(EXCEPTION,e);
+        logger.debug(EXCEPTION, e);
 			DeleteTenantError exc = new DeleteTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
@@ -272,12 +272,12 @@
 
 		}
 		catch (TenantException te) {
-			LOGGER.debug(EXCEPTION,te);
+        logger.debug(EXCEPTION, te);
 			QueryTenantError exc = new QueryTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory());
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
 		catch (Exception e) {
-			LOGGER.debug(EXCEPTION,e);
+        logger.debug(EXCEPTION, e);
 			QueryTenantError exc = new QueryTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
@@ -321,12 +321,12 @@
 		    impl.rollbackTenant(req.getTenantRollback());
 		}
 		catch (TenantException te) {
-			LOGGER.debug(EXCEPTION,te);
+        logger.debug(EXCEPTION, te);
 			RollbackTenantError exc = new RollbackTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory(), Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
 		catch (Exception e) {
-			LOGGER.debug(EXCEPTION,e);
+        logger.debug(EXCEPTION, e);
 			RollbackTenantError exc = new RollbackTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
 			return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
 		}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
index 4b02b73..7265a59 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -24,10 +26,8 @@
 import java.security.GeneralSecurityException;
 import java.util.Set;
 import java.util.TreeSet;
-
 import javax.annotation.PostConstruct;
 import javax.xml.bind.DatatypeConverter;
-
 import org.apache.http.HttpEntity;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -40,6 +40,8 @@
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.utils.CryptoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.core.env.Environment;
@@ -69,7 +71,7 @@
 	private static final String RETRY_INTERVAL_PROPERTY  = PROPERTY_DOMAIN+".retryinterval";
 	private static final String RETRY_LIST_PROPERTY      = PROPERTY_DOMAIN+".retrylist";
 	private static final String ENCRYPTION_KEY_PROP      = "org.onap.so.adapters.network.encryptionKey";
-	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, BpelRestClient.class);
+    private static final Logger logger = LoggerFactory.getLogger(BpelRestClient.class);
 
 	/** Default socket timeout (in seconds) */
 	public static final int DEFAULT_SOCKET_TIMEOUT = 5;
@@ -218,7 +220,8 @@
 			}
 			if (totalretries >= retryCount) {
 				debug("Retried " + totalretries + " times, giving up.");
-				LOGGER.error(MessageEnum.RA_SEND_VNF_NOTIF_ERR, "Could not deliver response to BPEL after "+totalretries+" tries: "+toBpelStr, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError, "Could not deliver response to BPEL");
+          logger.error("{} {} Could not deliver response to BPEL after {} tries: {}", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+              MsoLogger.ErrorCode.BusinessProcesssError.getValue(), totalretries, toBpelStr);
 				return false;
 			}
 			totalretries++;
@@ -232,26 +235,26 @@
 			try {
 				Thread.sleep(sleepinterval * 1000L);
 			} catch (InterruptedException e) {
-				LOGGER.debug("Exception while Thread sleep", e);
+          logger.debug("Exception while Thread sleep", e);
 				Thread.currentThread().interrupt();
 			}
 		}
 	}
 	private void debug(String m) {
-		LOGGER.debug(m);
+		logger.debug(m);
 	}
 	private void sendOne(final String toBpelStr, final String bpelUrl, final boolean isxml) {
-		LOGGER.debug("Sending to BPEL server: "+bpelUrl);
-		LOGGER.debug("Content is: "+toBpelStr);
+      logger.debug("Sending to BPEL server: {}", bpelUrl);
+      logger.debug("Content is: {}", toBpelStr);
 
 		//POST
 		HttpPost post = new HttpPost(bpelUrl);
 		if (credentials != null && !credentials.isEmpty())
 			post.addHeader("Authorization", "Basic " + DatatypeConverter.printBase64Binary(credentials.getBytes()));
 
-		LOGGER.debug("HTTPPost Headers: " + post.getAllHeaders());
-		
-        //ContentType
+      logger.debug("HTTPPost Headers: {}", post.getAllHeaders());
+
+      //ContentType
         ContentType ctype = isxml ? ContentType.APPLICATION_XML : ContentType.APPLICATION_JSON;
         post.setEntity(new StringEntity(toBpelStr, ctype));
 
@@ -274,14 +277,14 @@
 				lastResponse = "";
 			}
 		} catch (Exception e) {
-			String error = "Error sending Bpel notification:" + toBpelStr;
-			LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, error, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Error sending Bpel notification", e);
+            logger.error("{} {} Exception - Error sending Bpel notification: {} ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), toBpelStr, e);
 			lastResponseCode = 900;
 			lastResponse = "";
 		}
 
-		LOGGER.debug("Response code from BPEL server: "+lastResponseCode);
-		LOGGER.debug("Response body is: "+lastResponse);
+      logger.debug("Response code from BPEL server: {}", lastResponseCode);
+      logger.debug("Response body is: {}", lastResponse);
 	}
 	
 	private String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
@@ -289,7 +292,7 @@
 			try {
 				return CryptoUtils.decrypt(env.getProperty(key), env.getProperty(encryptionKey));
 			} catch (GeneralSecurityException e) {
-				LOGGER.debug("Exception while decrypting property: " + env.getProperty(key), e);
+          logger.debug("Exception while decrypting property: {} ", env.getProperty(key), e);
 			}
 		}
 		return defaultValue;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
index 21b7ea4..6340f76 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -29,14 +31,12 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import javax.jws.WebService;
 import javax.xml.bind.DatatypeConverter;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Holder;
 import javax.xml.ws.handler.MessageContext;
-
 import org.onap.so.adapters.vnf.async.client.CreateVnfNotification;
 import org.onap.so.adapters.vnf.async.client.QueryVnfNotification;
 import org.onap.so.adapters.vnf.async.client.UpdateVnfNotification;
@@ -45,11 +45,12 @@
 import org.onap.so.adapters.vnf.exceptions.VnfException;
 import org.onap.so.entity.MsoRequest;
 import org.onap.so.logger.MessageEnum;
-
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.VnfRollback;
 import org.onap.so.openstack.beans.VnfStatus;
 import org.onap.so.utils.CryptoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
@@ -58,8 +59,7 @@
 @Component
 public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
 
-	public static final String MSO_PROP_VNF_ADAPTER="MSO_PROP_VNF_ADAPTER";
-    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfAdapterAsyncImpl.class);
+    private static final Logger logger = LoggerFactory.getLogger(MsoVnfAdapterAsyncImpl.class);
 
     private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth";
     private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
@@ -75,7 +75,7 @@
      */
     @Override
     public void healthCheckA () {
-        LOGGER.debug ("Health check call in VNF Adapter");
+        logger.debug ("Health check call in VNF Adapter");
     }
 
     /**
@@ -136,7 +136,7 @@
         String serviceName = "CreateVnfA";
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (serviceName);
-        LOGGER.info (MessageEnum.RA_ASYNC_CREATE_VNF, vnfName, vnfType, cloudSiteId, tenantId, "createVnfA");
+        logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF);
         // Use the synchronous method to perform the actual Create
         MsoVnfAdapter vnfAdapter = vnfImpl;
         // Synchronous Web Service Outputs
@@ -163,7 +163,8 @@
             MsoLogger.setServiceName (serviceName);
         } catch (VnfException e) {
         	MsoLogger.setServiceName (serviceName);
-        	LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR,  vnfName, cloudSiteId, tenantId, "", "createVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "VnfException in createVnfA", e);
+            logger.error("{} {} VnfException in createVnfA ", MessageEnum.RA_CREATE_VNF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
             org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
@@ -172,21 +173,21 @@
                                                                                                      .getCategory ()
                                                                                                      .name ());
             } catch (Exception e1) {
-                LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "createVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Fault info", e1);
+                logger.error("{} {} Exception - Fault info ", MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.createVnfNotification (messageId, false, exCat, eMsg, null, null, null);
             } catch (Exception e1) {
-                error = "Error sending createVnf notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "createVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending createVnf notification", e1);
-
+                logger.error("{} {} Exception sending createVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
-            LOGGER.info (MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE, "", "createVnfA", "");
+            logger.info("{}", MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE);
             return;
         }
-        LOGGER.debug ("Async Create VNF: " + vnfName + " VnfId:" + vnfId.value);
+        logger.debug("Async Create VNF: {} VnfId:{}", vnfName, vnfId.value);
         // Build and send Asynchronous response
         try {
             VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
@@ -198,11 +199,10 @@
                                               copyCreateOutputs (outputs),
                                               copyVrb (vnfRollback));
         } catch (Exception e) {
-            error = "Error sending createVnf notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "createVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending createVnf notification", e);
-
+            logger.error("{} {} Exception sending createVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
-        LOGGER.info (MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE, "", "","createVnfA");
+        logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE);
         return;
     }
 
@@ -222,7 +222,7 @@
         String serviceName = "UpdateVnfA";
         MsoLogger.setServiceName (serviceName);
         MsoLogger.setLogContext (msoRequest);
-        LOGGER.info (MessageEnum.RA_ASYNC_UPDATE_VNF, vnfName, vnfType, cloudSiteId, tenantId,  "UpdateVnfA");
+        logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF);
 
         // Use the synchronous method to perform the actual Create
         MsoVnfAdapter vnfAdapter = vnfImpl;
@@ -237,7 +237,8 @@
             MsoLogger.setServiceName (serviceName);
         } catch (VnfException e) {
         	MsoLogger.setServiceName (serviceName);
-        	LOGGER.error (MessageEnum.RA_UPDATE_VNF_ERR,  vnfName, cloudSiteId, tenantId, "", "UpdateVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending updateVnf notification", e);
+            logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_UPDATE_VNF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
             org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
@@ -246,21 +247,21 @@
                                                                                                      .getCategory ()
                                                                                                      .name ());
             } catch (Exception e1) {
-            	LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "UpdateVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - fault info", e1);
+                logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.updateVnfNotification (messageId, false, exCat, eMsg, null, null);
             } catch (Exception e1) {
-                error = "Error sending updateVnf notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "UpdateVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending updateVnf notification", e1);
-
+                logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
-            LOGGER.info (MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE,"","","UpdateVnfA");
+            logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE);
             return;
         }
-        LOGGER.debug ("Async Update VNF: " + vnfName + " VnfId:" + vnfId.value);
+        logger.debug("Async Update VNF: {} VnfId:{}", vnfName, vnfId.value);
         // Build and send Asynchronous response
         try {
             VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
@@ -271,11 +272,10 @@
                                               copyUpdateOutputs (outputs),
                                               copyVrb (vnfRollback));
         } catch (Exception e) {
-            error = "Error sending updateVnf notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "UpdateVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending updateVnf notification", e);
-
+            logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
-        LOGGER.info (MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE, "", "","UpdateVnfA");
+        logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE);
         return;
     }
 
@@ -303,7 +303,7 @@
         String serviceName = "QueryVnfA";
         MsoLogger.setServiceName (serviceName);
         MsoLogger.setLogContext (msoRequest);
-        LOGGER.info (MessageEnum.RA_ASYNC_QUERY_VNF, vnfName, cloudSiteId, tenantId);
+        logger.info("{}", MessageEnum.RA_ASYNC_QUERY_VNF);
 
         // Use the synchronous method to perform the actual query
         MsoVnfAdapter vnfAdapter = vnfImpl;
@@ -319,7 +319,8 @@
             MsoLogger.setServiceName (serviceName);
         } catch (VnfException e) {
         	MsoLogger.setServiceName (serviceName);
-            LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR,  vnfName, cloudSiteId, tenantId, "", "queryVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending queryVnfA notification", e);
+            logger.error("{} {} Exception sending queryVnfA notification ", MessageEnum.RA_QUERY_VNF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
             org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
@@ -328,25 +329,25 @@
                                                                                                      .getCategory ()
                                                                                                      .name ());
             } catch (Exception e1) {
-            	LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "queryVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - fault info", e1);
+                logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.queryVnfNotification (messageId, false, exCat, eMsg, null, null, null, null);
             } catch (Exception e1) {
-                error = "Error sending queryVnf notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "queryVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending queryVnf notification", e1);
-
+                logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
-            LOGGER.info (MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE, "","", "queryVnfA");
+            logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE);
             return;
         }
 
         if (!vnfExists.value) {
-            LOGGER.debug ("Async Query, VNF not found");
+            logger.debug ("Async Query, VNF not found");
         } else {
-            LOGGER.debug ("Async Query, VNF=" + vnfId.value + ", status=" + status.value);
+            logger.debug("Async Query, VNF={}, status={}", vnfId.value, status.value);
         }
         // Build and send Asynchronous response
         try {
@@ -361,12 +362,11 @@
                                              vnfS,
                                              copyQueryOutputs (outputs));
         } catch (Exception e) {
-            error = "Error sending queryVnf notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "queryVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending queryVnf notification", e);
-
+            logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
 
-        LOGGER.info (MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE, "","", "queryVnfA");
+        logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE);
         return;
     }
 
@@ -393,7 +393,7 @@
         String serviceName = "DeleteVnfA";
         MsoLogger.setServiceName (serviceName);
         MsoLogger.setLogContext (msoRequest);
-        LOGGER.info (MessageEnum.RA_ASYNC_DELETE_VNF, vnfName, cloudSiteId, tenantId);
+        logger.info("{}", MessageEnum.RA_ASYNC_DELETE_VNF);
 
         // Use the synchronous method to perform the actual delete
         MsoVnfAdapter vnfAdapter = vnfImpl;
@@ -403,7 +403,8 @@
             MsoLogger.setServiceName (serviceName);
         } catch (VnfException e) {
         	MsoLogger.setServiceName (serviceName);
-        	LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR,  vnfName, cloudSiteId, tenantId, "", "deleteVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending deleteVnfA notification", e);
+            logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_DELETE_VNF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
             org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
@@ -412,34 +413,33 @@
                                                                                                      .getCategory ()
                                                                                                      .name ());
             } catch (Exception e1) {
-            	LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "deleteVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - fault info", e1);
+                logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.deleteVnfNotification (messageId, false, exCat, eMsg);
             } catch (Exception e1) {
-                error = "Error sending deleteVnf notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "deleteVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending deleteVnfA notification", e1);
-
+                logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
-            LOGGER.info (MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE, "","", "deleteVnfA");
+            logger.info("{} deleteVnfA", MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE);
             return;
         }
 
-        LOGGER.debug ("Async Delete VNF: " + vnfName);
+        logger.debug("Async Delete VNF: {}", vnfName);
         // Build and send Asynchronous response
         try {
             VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
             notifyPort.deleteVnfNotification (messageId, true, null, null);
 
         } catch (Exception e) {
-            error = "Error sending deleteVnf notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "deleteVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending deleteVnfA notification", e);
-
+            logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
 
-        LOGGER.info (MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE, "", "","deleteVnfA");
+        logger.info("{} deleteVnfA", MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE);
         return;
     }
 
@@ -456,14 +456,12 @@
         String error;
         // rollback may be null (e.g. if stack already existed when Create was called)
         if (rollback == null) {
-            error = "Empty Rollback: No action to perform";
-            LOGGER.info (MessageEnum.RA_ROLLBACK_NULL, "","", "rollbackVnfA");
-
+            logger.info("{} rollbackVnfA: Empty Rollback: No action to perform", MessageEnum.RA_ROLLBACK_NULL);
             return;
         }
 
         MsoLogger.setLogContext (rollback.getMsoRequest ());
-        LOGGER.info (MessageEnum.RA_ASYNC_ROLLBACK_VNF, "", "","rollbackVnfA");
+        logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF);
 
         // Use the synchronous method to perform the actual rollback
         MsoVnfAdapter vnfAdapter = vnfImpl;
@@ -473,7 +471,8 @@
             MsoLogger.setServiceName (serviceName);
         } catch (VnfException e) {
         	MsoLogger.setServiceName (serviceName);
-        	LOGGER.error (MessageEnum.RA_ROLLBACK_VNF_ERR, "", "rollbackVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending rollbackVnfA notification", e);
+            logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_ROLLBACK_VNF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
             org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
             String eMsg = null;
             try {
@@ -482,33 +481,32 @@
                                                                                                      .getCategory ()
                                                                                                      .name ());
             } catch (Exception e1) {
-            	LOGGER.error (MessageEnum.RA_FAULT_INFO_EXC, "", "rollbackVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - fault info", e1);
+                logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
             // Build and send Asynchronous error response
             try {
                 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
                 notifyPort.rollbackVnfNotification (messageId, false, exCat, eMsg);
             } catch (Exception e1) {
-                error = "Error sending rollbackVnf notification " + e1.getMessage ();
-                LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "rollbackVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending rollbackVnfA notification", e1);
-
+                logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
             }
-            LOGGER.info (MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE, "","", "rollbackVnfA");
+            logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE);
             return;
         }
 
-        LOGGER.debug ("Async Rollback VNF:" + rollback.getVnfId ());
+        logger.debug ("Async Rollback VNF:" + rollback.getVnfId ());
         // Build and send Asynchronous response
         try {
             VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
             notifyPort.rollbackVnfNotification (messageId, true, null, null);
         } catch (Exception e) {
-            error = "Error sending rollbackVnf notification " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "rollbackVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending rollbackVnfA notification", e);
-
+            logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
 
-        LOGGER.info (MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE, "", "","rollbackVnfA");
+        logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE);
         return;
     }
 
@@ -600,15 +598,18 @@
         try {
             warWsdlLoc = Thread.currentThread ().getContextClassLoader ().getResource ("VnfAdapterNotify.wsdl");
         } catch (Exception e) {
-            LOGGER.error (MessageEnum.RA_WSDL_NOT_FOUND, "VnfAdapterNotify.wsdl", "", "getNotifyEP", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - WSDL not found", e);
+            logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
         if (warWsdlLoc == null) {
-        	LOGGER.error (MessageEnum.RA_WSDL_NOT_FOUND, "VnfAdapterNotify.wsdl", "", "getNotifyEP", MsoLogger.ErrorCode.BusinessProcesssError, "WSDL not found");
+            logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue());
         } else {
             try {
-                LOGGER.debug ("VnfAdpaterNotify.wsdl location:" + warWsdlLoc.toURI ().toString ());
+                logger.debug("VnfAdpaterNotify.wsdl location:{}", warWsdlLoc.toURI().toString());
             } catch (Exception e) {
-                LOGGER.error (MessageEnum.RA_WSDL_URL_CONVENTION_EXC, "VnfAdapterNotify.wsdl", "", "getNotifyEP", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - WSDL URL convention", e);
+                logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
             }
         }
 
@@ -624,15 +625,16 @@
         try {
             epUrl = new URL (notificationUrl);
         } catch (MalformedURLException e1) {
-            LOGGER.error (MessageEnum.RA_INIT_NOTIF_EXC, "", "getNotifyEP", MsoLogger.ErrorCode.BusinessProcesssError, "MalformedURLException", e1);
+            logger.error("{} {} MalformedURLException ", MessageEnum.RA_INIT_NOTIF_EXC,
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e1);
         }
 
         if(null != epUrl) {
-            LOGGER.debug ("Notification Endpoint URL: " + epUrl.toExternalForm ());
+            logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
             bp.getRequestContext ().put (BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm ());
         }
         else {
-            LOGGER.debug ("epUrl is NULL:");
+            logger.debug ("epUrl is NULL:");
         }
 
         // authentication
@@ -646,8 +648,8 @@
             reqCtx.put (MessageContext.HTTP_REQUEST_HEADERS, headers);
             headers.put ("Authorization", Collections.singletonList (basicAuth));
         } catch (Exception e) {
-            LOGGER.error (MessageEnum.RA_SET_CALLBACK_AUTH_EXC, "", "getNotifyEP", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Unable to set authorization in callback request", e);
-
+            logger.error("{} {} Exception - Unable to set authorization in callback request ",
+                MessageEnum.RA_SET_CALLBACK_AUTH_EXC, MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
         }
 
         return notifyPort;
@@ -657,7 +659,7 @@
     	try {
 			return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
 		} catch (GeneralSecurityException e) {
-			LOGGER.debug("Exception while decrypting property: " + this.environment.getProperty(key), e);
+          logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);
 		}
 		return defaultValue;
 
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
index 62971ec..9e75c7c 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -22,14 +24,14 @@
 
 import javax.annotation.PreDestroy;
 
-import org.onap.so.asdc.client.ASDCConfiguration;
 import org.onap.so.asdc.client.ASDCController;
 import org.onap.so.asdc.client.exceptions.ASDCControllerException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Profile;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
-import org.onap.so.logger.MsoLogger;
 import java.security.SecureRandom;
 
 
@@ -40,30 +42,28 @@
    
     @Autowired
     private ASDCController asdcController;
-    private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.ASDC, ASDCControllerSingleton.class);
+    private static Logger logger = LoggerFactory.getLogger(ASDCControllerSingleton.class);
   
 
 
     @Scheduled (fixedRate = 50000)
 	public void periodicControllerTask() {
-       
-		try {
-            int randomNumber = new SecureRandom().nextInt(Integer.MAX_VALUE);
-			asdcController.setControllerName("mso-controller"+randomNumber);
-			asdcController.initASDC();
-		} catch (ASDCControllerException e) {
-			msoLogger.error(e);
-	
-		}
+			try {
+				int randomNumber = new SecureRandom().nextInt(Integer.MAX_VALUE);
+				asdcController.setControllerName("mso-controller" + randomNumber);
+				asdcController.initASDC();
+			} catch (ASDCControllerException e) {
+				logger.error("Exception occurred", e);
+			}
 	}
    
    @PreDestroy
    private void terminate () {
-	   try {
-		asdcController.closeASDC ();
-	} catch (ASDCControllerException e) {
-		msoLogger.error(e);
-	}
-   }
+		 try {
+			 asdcController.closeASDC();
+		 } catch (ASDCControllerException e) {
+			 logger.error("Exception occurred", e);
+		 }
+	 }
 
 }
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
index 5710905..20e7c87 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -27,8 +29,9 @@
 import java.util.List;
 
 import org.onap.sdc.api.consumer.IConfiguration;
-import org.onap.so.logger.MsoLogger;
 import org.onap.so.utils.CryptoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.env.Environment;
@@ -40,6 +43,7 @@
     // SHell command to obtain the same encryption, 128 bits key, key must be HEX
     // echo -n "This is a test string" | openssl aes-128-ecb -e -K 546573746F736973546573746F736973 -nosalt | xxd
 
+    private static Logger logger = LoggerFactory.getLogger(ASDCConfiguration.class);
    
 
     private String asdcControllerName;
@@ -72,9 +76,6 @@
     public static final String TOSCA_CSAR="TOSCA_CSAR";
     public static final String WORKFLOWS="Workflows";
     public static final String VF_MODULES_METADATA="VF_MODULES_METADATA";
-    private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.ASDC,ASDCConfiguration.class);
-    
-   
 
     private static final String[] SUPPORTED_ARTIFACT_TYPES = {HEAT,
     		HEAT_ARTIFACT,
@@ -176,7 +177,7 @@
 		try {
 				decryptedKey = CryptoUtils.decrypt(config, this.configKey);
 			} catch (GeneralSecurityException e) {
-				msoLogger.debug("Exception while decrypting property: " + propertyName, e);
+				logger.debug("Exception while decrypting property: {}", propertyName, e);
 				return null;
 			}
 			
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index a21deee..bb70e3c 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -30,7 +32,6 @@
 import java.util.List;
 import java.util.Optional;
 
-import org.hibernate.StaleObjectStateException;
 import org.onap.sdc.api.IDistributionClient;
 import org.onap.sdc.api.consumer.IDistributionStatusMessage;
 import org.onap.sdc.api.consumer.IFinalDistrStatusMessage;
@@ -58,6 +59,8 @@
 import org.onap.so.db.request.data.repository.WatchdogDistributionStatusRepository;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.orm.ObjectOptimisticLockingFailureException;
 import org.springframework.stereotype.Component;
@@ -71,9 +74,7 @@
 @Component
 public class ASDCController {
 
-    protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,ASDCController.class);
-
-
+    protected static final Logger logger = LoggerFactory.getLogger(ASDCController.class);
 
     protected boolean isAsdcClientAutoManaged = false;
 
@@ -189,7 +190,7 @@
     public void initASDC () throws ASDCControllerException {
         String event = "Initialize the ASDC Controller";
         MsoLogger.setServiceName ("InitASDC");
-        LOGGER.debug (event);
+        logger.debug(event);
         if (this.getControllerStatus () != ASDCControllerStatus.STOPPED) {
             String endEvent = "The controller is already initialized, call the closeASDC method first";
             throw new ASDCControllerException (endEvent);
@@ -203,36 +204,29 @@
             distributionClient = DistributionClientFactory.createDistributionClient ();
         }
         
-        long initStartTime = System.currentTimeMillis ();
         IDistributionClientResult result = this.distributionClient.init (asdcConfig,
                                                                          asdcNotificationCallBack, asdcStatusCallBack);
         if (!result.getDistributionActionResult ().equals (DistributionActionResultEnum.SUCCESS)) {
             String endEvent = "ASDC distribution client init failed with reason:"
                               + result.getDistributionMessageResult ();
-            LOGGER.recordMetricEvent (initStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.UnknownError, "Initialization of the ASDC Controller failed with reason:" + result.getDistributionMessageResult (), "ASDC", "init", null);
-            LOGGER.debug (endEvent);
+            logger.debug (endEvent);
             this.changeControllerStatus (ASDCControllerStatus.STOPPED);
             throw new ASDCControllerException ("Initialization of the ASDC Controller failed with reason: "
                                                + result.getDistributionMessageResult ());
         }
-        LOGGER.recordMetricEvent (initStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully initialize ASDC Controller", "ASDC", "init", null);
 
-        long clientstartStartTime = System.currentTimeMillis ();
         result = this.distributionClient.start ();
         if (!result.getDistributionActionResult ().equals (DistributionActionResultEnum.SUCCESS)) {
             String endEvent = "ASDC distribution client start failed with reason:"
                               + result.getDistributionMessageResult ();
-            LOGGER.recordMetricEvent (clientstartStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.UnknownError, endEvent, "ASDC", "start", null);
-            LOGGER.debug (endEvent);           
+            logger.debug (endEvent);
             this.changeControllerStatus (ASDCControllerStatus.STOPPED);
             throw new ASDCControllerException ("Startup of the ASDC Controller failed with reason: "
                                                + result.getDistributionMessageResult ());
         }
-        LOGGER.recordMetricEvent (clientstartStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully start ASDC distribution client", "ASDC", "start", null);
-
 
         this.changeControllerStatus (ASDCControllerStatus.IDLE);
-        LOGGER.info (MessageEnum.ASDC_INIT_ASDC_CLIENT_SUC, "ASDC", "changeControllerStatus","");
+        logger.info("{} {} {}", MessageEnum.ASDC_INIT_ASDC_CLIENT_SUC.toString(), "ASDC", "changeControllerStatus");
     }
 
     /**
@@ -264,10 +258,10 @@
 
     	
    		if (toscaInstaller.isResourceAlreadyDeployed (resource)) {
-    			LOGGER.info (MessageEnum.ASDC_ARTIFACT_ALREADY_EXIST,
+    			logger.info("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_ALREADY_EXIST.toString(),
                     resource.getResourceInstance().getResourceInstanceName(),
                     resource.getResourceInstance().getResourceUUID(),
-                    resource.getResourceInstance().getResourceName(), "", "");
+                    resource.getResourceInstance().getResourceName());
 
     			this.sendDeployNotificationsForResource(resource,DistributionStatusEnum.ALREADY_DOWNLOADED,null);
     			this.sendDeployNotificationsForResource(resource,DistributionStatusEnum.ALREADY_DEPLOYED,null);
@@ -283,7 +277,7 @@
     protected IDistributionClientDownloadResult downloadTheArtifact (IArtifactInfo artifact,
                                                                    String distributionId) throws ASDCDownloadException {
 
-        LOGGER.debug ("Trying to download the artifact : " + artifact.getArtifactURL ()
+        logger.debug("Trying to download the artifact : " + artifact.getArtifactURL ()
                       + UUID_PARAM
                       + artifact.getArtifactUUID ()
                       + ")");
@@ -293,11 +287,11 @@
         try {
             downloadResult = distributionClient.download (artifact);
             if (null == downloadResult) {
-            	LOGGER.info (MessageEnum.ASDC_ARTIFACT_NULL, artifact.getArtifactUUID (), "", "");
+            	logger.info ("{} {}", MessageEnum.ASDC_ARTIFACT_NULL.toString(), artifact.getArtifactUUID());
             	return downloadResult;
             }
         } catch (RuntimeException e) {
-            LOGGER.debug ("Not able to download the artifact due to an exception: " + artifact.getArtifactURL ());
+            logger.debug ("Not able to download the artifact due to an exception: " + artifact.getArtifactURL ());
             this.sendASDCNotification (NotificationType.DOWNLOAD,
                                        artifact.getArtifactURL (),
                                        asdcConfig.getConsumerID (),
@@ -310,19 +304,14 @@
         }
 
         if (DistributionActionResultEnum.SUCCESS.equals(downloadResult.getDistributionActionResult ())) {
-
-            LOGGER.info (MessageEnum.ASDC_ARTIFACT_DOWNLOAD_SUC,
-                         artifact.getArtifactURL (),
-                         artifact.getArtifactUUID (),
-                         String.valueOf (downloadResult.getArtifactPayload ().length), "", "");
+            logger.info("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_DOWNLOAD_SUC.toString(), artifact.getArtifactURL(),
+                artifact.getArtifactUUID(), String.valueOf(downloadResult.getArtifactPayload().length));
 
         } else {
-
-            LOGGER.error (MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL,
-                          artifact.getArtifactName (),
-                          artifact.getArtifactURL (),
-                          artifact.getArtifactUUID (),
-                          downloadResult.getDistributionMessageResult (), "", "", MsoLogger.ErrorCode.DataError, "ASDC artifact download fail");
+            logger.error("{} {} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL.toString(),
+                artifact.getArtifactName(), artifact.getArtifactURL(), artifact.getArtifactUUID(),
+                downloadResult.getDistributionMessageResult(), MsoLogger.ErrorCode.DataError.getValue(),
+                "ASDC artifact download fail");
 
             this.sendASDCNotification (NotificationType.DOWNLOAD,
                                        artifact.getArtifactURL (),
@@ -359,11 +348,10 @@
     private void writeArtifactToFile (IArtifactInfo artifact,
     		IDistributionClientDownloadResult resultArtifact) {
 
-    	LOGGER.debug ("Trying to write artifact to file : " + artifact.getArtifactURL ()
-    			+ UUID_PARAM
-    			+ artifact.getArtifactUUID ()
-    			+ ")");
-    	
+        logger.debug(
+            "Trying to write artifact to file : " + artifact.getArtifactURL() + UUID_PARAM + artifact.getArtifactUUID()
+                + ")");
+
         String filePath = Paths.get(System.getProperty("mso.config.path"), "ASDC",  artifact.getArtifactVersion(), artifact.getArtifactName()).normalize().toString();
     	// make parent directory
     	File file = new File(filePath);    	
@@ -373,20 +361,20 @@
     	}
 
     	byte[] payloadBytes = resultArtifact.getArtifactPayload();
-    	
+
     	try (FileOutputStream outFile = new FileOutputStream(filePath)) {
-    		LOGGER.info(MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF, "***WRITE FILE ARTIFACT NAME", "ASDC", artifact.getArtifactName());
-    		outFile.write(payloadBytes, 0, payloadBytes.length);
-    		outFile.close();
-    	} catch (Exception e) { 
-			LOGGER.debug("Exception :",e);
-            LOGGER.error(MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL,
-    				artifact.getArtifactName (),
-    				artifact.getArtifactURL (),
-    				artifact.getArtifactUUID (),
-    				resultArtifact.getDistributionMessageResult (), "", "", MsoLogger.ErrorCode.DataError, "ASDC write to file failed"); 
-        } 
-    	
+          logger.info("{} {} {} {}", MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF.toString(), "***WRITE FILE ARTIFACT NAME",
+              "ASDC", artifact.getArtifactName());
+          outFile.write(payloadBytes, 0, payloadBytes.length);
+          outFile.close();
+      } catch (Exception e) {
+          logger.debug("Exception :", e);
+          logger.error("{} {} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL.toString(),
+              artifact.getArtifactName(), artifact.getArtifactURL(), artifact.getArtifactUUID(),
+              resultArtifact.getDistributionMessageResult(), MsoLogger.ErrorCode.DataError.getValue(),
+              "ASDC write to file failed");
+        }
+
     }
 
 
@@ -446,7 +434,9 @@
     
     protected void deployResourceStructure (VfResourceStructure resourceStructure, ToscaResourceStructure toscaResourceStructure) throws ArtifactInstallerException {
 
-    	LOGGER.info (MessageEnum.ASDC_START_DEPLOY_ARTIFACT, resourceStructure.getResourceInstance().getResourceInstanceName(), resourceStructure.getResourceInstance().getResourceUUID(), "ASDC");
+        logger.info("{} {} {} {}", MessageEnum.ASDC_START_DEPLOY_ARTIFACT.toString(),
+            resourceStructure.getResourceInstance().getResourceInstanceName(),
+            resourceStructure.getResourceInstance().getResourceUUID(), "ASDC");
         try {
         	String resourceType = resourceStructure.getResourceInstance().getResourceType();
         	String category = resourceStructure.getResourceInstance().getCategory();
@@ -456,20 +446,20 @@
         	toscaInstaller.installTheResource(toscaResourceStructure, resourceStructure);        	        				
 
         } catch (ArtifactInstallerException e) {
-        	LOGGER.info (MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL,
-	           		resourceStructure.getResourceInstance().getResourceName(),
-	          		resourceStructure.getResourceInstance().getResourceUUID(),
-	                String.valueOf (resourceStructure.getVfModuleStructure().size()), "ASDC", "deployResourceStructure");
-        	sendDeployNotificationsForResource(resourceStructure,DistributionStatusEnum.DEPLOY_ERROR,e.getMessage());
-        	throw e;
+            logger.info("{} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL.toString(),
+                resourceStructure.getResourceInstance().getResourceName(),
+                resourceStructure.getResourceInstance().getResourceUUID(),
+                String.valueOf(resourceStructure.getVfModuleStructure().size()), "ASDC", "deployResourceStructure");
+            sendDeployNotificationsForResource(resourceStructure, DistributionStatusEnum.DEPLOY_ERROR, e.getMessage());
+            throw e;
         }
 
         if (resourceStructure.isDeployedSuccessfully() || toscaResourceStructure.isDeployedSuccessfully()) {
-	        LOGGER.info (MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC,
-	           		resourceStructure.getResourceInstance().getResourceName(),
-	          		resourceStructure.getResourceInstance().getResourceUUID(),
-	                String.valueOf (resourceStructure.getVfModuleStructure().size()), "ASDC", "deployResourceStructure");
-	        sendDeployNotificationsForResource(resourceStructure,DistributionStatusEnum.DEPLOY_OK ,null);
+            logger.info("{} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC.toString(),
+                resourceStructure.getResourceInstance().getResourceName(),
+                resourceStructure.getResourceInstance().getResourceUUID(),
+                String.valueOf(resourceStructure.getVfModuleStructure().size()), "ASDC", "deployResourceStructure");
+            sendDeployNotificationsForResource(resourceStructure, DistributionStatusEnum.DEPLOY_OK, null);
         }
 
     }
@@ -497,10 +487,10 @@
         if (errorReason != null) {
         	event=event+"("+errorReason+")";
         }
-        LOGGER.info (MessageEnum.ASDC_SEND_NOTIF_ASDC, notificationType.name (), status.name (), artifactURL, "ASDC", "sendASDCNotification");
-        LOGGER.debug (event);
+        logger.info("{} {} {} {} {} {}", MessageEnum.ASDC_SEND_NOTIF_ASDC.toString(), notificationType.name(),
+            status.name(), artifactURL, "ASDC", "sendASDCNotification");
+        logger.debug (event);
 
-        long subStarttime = System.currentTimeMillis ();
         String action = "";
         try {
             IDistributionStatusMessage message = new DistributionStatusMessage (artifactURL,
@@ -529,10 +519,11 @@
                 default:
                 	break;
             }
-        } catch (RuntimeException e) {           
-            LOGGER.warn (MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC, "ASDC", "sendASDCNotification", MsoLogger.ErrorCode.SchemaError, "RuntimeException - sendASDCNotification", e);
+        } catch (RuntimeException e) {
+            logger.warn("{} {} {} {} {}", MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC.toString(), "ASDC",
+                "sendASDCNotification", MsoLogger.ErrorCode.SchemaError.getValue(),
+                "RuntimeException - sendASDCNotification", e);
         }
-        LOGGER.recordMetricEvent (subStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully sent notification to ASDC", "ASDC", action, null);
     }
     
     protected void sendFinalDistributionStatus (
@@ -541,7 +532,8 @@
     		String errorReason) {
 
 
-    	LOGGER.debug ("Enter sendFinalDistributionStatus with DistributionID " + distributionID + " and Status of " + status.name() + " and ErrorReason " + errorReason);
+        logger.debug("Enter sendFinalDistributionStatus with DistributionID " + distributionID + " and Status of " + status
+                .name() + " and ErrorReason " + errorReason);
 
     	long subStarttime = System.currentTimeMillis ();
     	try {
@@ -556,11 +548,11 @@
     		}
     		
  
-    	} catch (RuntimeException e) {    		
-    		LOGGER.debug ("Exception caught in sendFinalDistributionStatus " + e.getMessage());
-    		LOGGER.warn (MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC, "ASDC", "sendASDCNotification", MsoLogger.ErrorCode.SchemaError, "RuntimeException - sendASDCNotification", e);
-    	}
-    	LOGGER.recordMetricEvent (subStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully sent Final notification to ASDC", "ASDC", null, null);
+    	} catch (RuntimeException e) {
+          logger.debug("Exception caught in sendFinalDistributionStatus {}", e.getMessage());
+          logger.warn("{} {} {} {} {}", MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC.toString(), "ASDC", "sendASDCNotification",
+                  MsoLogger.ErrorCode.SchemaError.getValue(), "RuntimeException - sendASDCNotification", e);
+      }
     }
 
 	private Optional<String> getNotificationJson(INotificationData iNotif) {
@@ -574,7 +566,7 @@
 		try {
 			returnValue = Optional.of(mapper.writeValueAsString(iNotif));
 		} catch (JsonProcessingException e) {
-			LOGGER.error("Error converting incoming ASDC notification to JSON" , e);
+			logger.error("Error converting incoming ASDC notification to JSON" , e);
 		}
 		return returnValue;
 	}
@@ -587,15 +579,14 @@
     	for (IResourceInstance resource : iNotif.getResources ()) {
     		noOfArtifacts += resource.getArtifacts ().size ();
     	}
-        LOGGER.info (MessageEnum.ASDC_RECEIVE_CALLBACK_NOTIF,
-                     String.valueOf (noOfArtifacts),
-                     iNotif.getServiceUUID (), "ASDC");
-
+        logger.info("{} {} {} {}", MessageEnum.ASDC_RECEIVE_CALLBACK_NOTIF.toString(), String.valueOf(noOfArtifacts),
+            iNotif.getServiceUUID(), "ASDC");
         try {
-        	LOGGER.debug(ASDCNotificationLogging.dumpASDCNotification(iNotif));
-			LOGGER.info(MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF, iNotif.getServiceUUID(), "ASDC", "treatNotification");
-						
-			this.changeControllerStatus(ASDCControllerStatus.BUSY);
+        	logger.debug(ASDCNotificationLogging.dumpASDCNotification(iNotif));
+            logger.info("{} {} {} {}", MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF.toString(), iNotif.getServiceUUID(), "ASDC",
+                    "treatNotification");
+
+            this.changeControllerStatus(ASDCControllerStatus.BUSY);
 			Optional<String> notificationMessage = getNotificationJson(iNotif);
 			toscaInstaller.processWatchdog(iNotif.getDistributionID(), iNotif.getServiceUUID(), notificationMessage,
 					asdcConfig.getConsumerID());
@@ -622,7 +613,7 @@
     				distributionStatus = wd.getOverallDistributionStatus(iNotif.getDistributionID());
     				Thread.sleep(watchDogTimeout / 10);    		
     			}catch(Exception e){
-    				LOGGER.debug ("Exception in Watchdog Loop " + e.getMessage());
+    				logger.debug ("Exception in Watchdog Loop {}", e.getMessage());
     				Thread.sleep(watchDogTimeout / 10);
     			}
     			
@@ -639,25 +630,25 @@
         	}
         	
         	if(!componentsComplete){
-        		LOGGER.debug("Timeout of " + watchDogTimeout + " seconds was reached before all components reported status");
+        		logger.debug("Timeout of {} seconds was reached before all components reported status", watchDogTimeout);
         		watchdogError = "Timeout occurred while waiting for all components to report status";
         		overallStatus = DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name();
         	}
         	
         	if(distributionStatus == null){        	
         		overallStatus = DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name();
-        		LOGGER.debug("DistributionStatus is null for DistributionId: " + iNotif.getDistributionID());        		 	
+        		logger.debug("DistributionStatus is null for DistributionId: {}", iNotif.getDistributionID());
         	}
         	
         	try {
         		wd.executePatchAAI(iNotif.getDistributionID(), iNotif.getServiceInvariantUUID(), overallStatus);
-        		LOGGER.debug ("A&AI Updated succefully with Distribution Status!");
+        		logger.debug("A&AI Updated succefully with Distribution Status!");
         	}
         	catch(Exception e) {
-        		LOGGER.debug ("Exception in Watchdog executePatchAAI(): " + e.getMessage());
+              logger.debug("Exception in Watchdog executePatchAAI(): {}", e.getMessage());
         		watchdogError = "Error calling A&AI " + e.getMessage();
         		if(e.getCause() != null) {
-        			LOGGER.debug ("Exception caused by: " + e.getCause().getMessage());
+        			logger.debug("Exception caused by: {}", e.getCause().getMessage());
         		}
         	}
      	
@@ -676,27 +667,31 @@
         	
 
         } catch(ObjectOptimisticLockingFailureException e) {
-        	
-        	LOGGER.debug ("OptimisticLockingFailure for DistributionId: " + iNotif.getDistributionID() + " Another process has already altered this distribution, so not going to process it on this site.");
-        	LOGGER.error (MessageEnum.ASDC_GENERAL_EXCEPTION_ARG,
-                    "Database concurrency exception: ",  "ASDC", "treatNotification", MsoLogger.ErrorCode.BusinessProcesssError, "RuntimeException in treatNotification",
-                    e);
-        	
+
+            logger.debug("OptimisticLockingFailure for DistributionId: {} Another process "
+                    + "has already altered this distribution, so not going to process it on this site.",
+                iNotif.getDistributionID());
+            logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+                "Database concurrency exception: ", "ASDC", "treatNotification",
+                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "RuntimeException in treatNotification", e);
+
         } catch (Exception e) {
-            LOGGER.error (MessageEnum.ASDC_GENERAL_EXCEPTION_ARG,
-                          "Unexpected exception caught during the notification processing",  "ASDC", "treatNotification", MsoLogger.ErrorCode.SchemaError, "RuntimeException in treatNotification",
+            logger.error("", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+                          "Unexpected exception caught during the notification processing",  "ASDC",
+                "treatNotification", MsoLogger.ErrorCode.SchemaError.getValue(), "RuntimeException in treatNotification",
                           e);
-            
-          	try {
-        		wd.executePatchAAI(iNotif.getDistributionID(), iNotif.getServiceInvariantUUID(), DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name());
-        		LOGGER.debug ("A&AI Updated succefully with Distribution Status of " + DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name());
-        	}
-        	catch(Exception aaiException) {
-        		LOGGER.debug ("Exception in executePatchAAI(): " + aaiException);
-        		if(aaiException.getCause() != null) {
-        			LOGGER.debug ("Exception caused by: " + aaiException.getCause().getMessage());
-        		}
-        	}
+
+            try {
+                wd.executePatchAAI(iNotif.getDistributionID(), iNotif.getServiceInvariantUUID(),
+                    DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name());
+                logger.debug("A&AI Updated succefully with Distribution Status of {}",
+                    DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name());
+            } catch (Exception aaiException) {
+                logger.debug("Exception in executePatchAAI(): {}", aaiException);
+                if (aaiException.getCause() != null) {
+                    logger.debug("Exception caused by: {}", aaiException.getCause().getMessage());
+                }
+            }
             
              sendFinalDistributionStatus(iNotif.getDistributionID(), DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR, e.getMessage());
              
@@ -735,7 +730,8 @@
   	           	String resourceType = resourceStructure.getResourceInstance().getResourceType();
             	String category = resourceStructure.getResourceInstance().getCategory();
     				       	
-                LOGGER.debug("Processing Resource Type: " + resourceType + " and Model UUID: " + resourceStructure.getResourceInstance().getResourceUUID());
+                logger.debug("Processing Resource Type: " + resourceType + " and Model UUID: " + resourceStructure
+                    .getResourceInstance().getResourceUUID());
                 	
 				if("VF".equals(resourceType) && !"Allotted Resource".equalsIgnoreCase(category)){
 					
@@ -747,15 +743,16 @@
 	    				if (resultArtifact != null) {
 	    					    					
 	    					if (ASDCConfiguration.VF_MODULES_METADATA.equals(artifact.getArtifactType())) {
-	    						LOGGER.debug("VF_MODULE_ARTIFACT: "+new String(resultArtifact.getArtifactPayload(),"UTF-8"));
-	    						LOGGER.debug(ASDCNotificationLogging.dumpVfModuleMetaDataList(resourceStructure.decodeVfModuleArtifact(resultArtifact.getArtifactPayload())));
+	    						logger.debug("VF_MODULE_ARTIFACT: "+ new String(resultArtifact.getArtifactPayload(),"UTF-8"));
+	    						logger.debug(ASDCNotificationLogging.dumpVfModuleMetaDataList(resourceStructure.decodeVfModuleArtifact
+                      (resultArtifact.getArtifactPayload())));
 	    					}
 	    					resourceStructure.addArtifactToStructure(distributionClient,artifact, resultArtifact);
 	    				}
 	    			}
 	    			
 					//Deploy VF resource and artifacts
-					LOGGER.debug("Preparing to deploy Service: " + iNotif.getServiceUUID());
+					logger.debug("Preparing to deploy Service: {}", iNotif.getServiceUUID());
 					try{
 						
 						this.deployResourceStructure(resourceStructure, toscaResourceStructure);
@@ -763,7 +760,7 @@
 				 	} catch(ArtifactInstallerException e){
 				 		deploySuccessful = false;
 				 		errorMessage = e.getMessage();
-				 		LOGGER.error(e);
+				 		logger.error("Exception occurred", e);
 				 	}  
 				}
 						
@@ -772,7 +769,7 @@
   			// There are cases where the Service has no VF resources, those are handled here
    			if (!hasVFResource) {
    				
-   				LOGGER.debug("No resources found for Service: " + iNotif.getServiceUUID());
+   				logger.debug("No resources found for Service: {}", iNotif.getServiceUUID());
 				
    				try{
    					resourceStructure = new VfResourceStructure(iNotif,new ResourceInstance()); 
@@ -782,15 +779,16 @@
 			 	} catch(ArtifactInstallerException e){
 			 		deploySuccessful = false;
 			 		errorMessage = e.getMessage();
-			 		LOGGER.error(e);
+			 		logger.error("Exception occurred", e);
 		   }
    		}
 			 this.sendCsarDeployNotification(iNotif, resourceStructure, toscaResourceStructure, deploySuccessful, errorMessage);
     		
     	} catch (ASDCDownloadException | UnsupportedEncodingException e) {
-    		LOGGER.error(MessageEnum.ASDC_GENERAL_EXCEPTION_ARG,
-    				"Exception caught during Installation of artifact", "ASDC", "processResourceNotification", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in processResourceNotification", e);
-    	}
+          logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+              "Exception caught during Installation of artifact", "ASDC", "processResourceNotification",
+              MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in processResourceNotification", e);
+      }
     }
     protected void processCsarServiceArtifacts (INotificationData iNotif, ToscaResourceStructure toscaResourceStructure) {
     	
@@ -812,12 +810,13 @@
     					
     					toscaResourceStructure.setServiceVersion(iNotif.getServiceVersion());
     					
-    					LOGGER.debug(ASDCNotificationLogging.dumpCSARNotification(iNotif, toscaResourceStructure));
+    					logger.debug(ASDCNotificationLogging.dumpCSARNotification(iNotif, toscaResourceStructure));
     					
 
     				} catch(Exception e){
-    					LOGGER.error(MessageEnum.ASDC_GENERAL_EXCEPTION_ARG,
-    							"Exception caught during processCsarServiceArtifacts", "ASDC", "processCsarServiceArtifacts", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in processCsarServiceArtifacts", e);
+    					logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+    							"Exception caught during processCsarServiceArtifacts", "ASDC", "processCsarServiceArtifacts",
+                  MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in processCsarServiceArtifacts", e);
     				}
     			}
     			else if(artifact.getArtifactType().equals(ASDCConfiguration.WORKFLOWS)){
@@ -830,14 +829,16 @@
     					
     					toscaResourceStructure.setToscaArtifact(artifact);
     					
-    					LOGGER.debug(ASDCNotificationLogging.dumpASDCNotification(iNotif));
+    					logger.debug(ASDCNotificationLogging.dumpASDCNotification(iNotif));
     					
 
     				} catch(Exception e){
-    					System.out.println("Whats the error " + e.getMessage());
-    					LOGGER.error(MessageEnum.ASDC_GENERAL_EXCEPTION_ARG,
-    							"Exception caught during processCsarServiceArtifacts", "ASDC", "processCsarServiceArtifacts", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in processCsarServiceArtifacts", e);
-    				}
+                logger.info("Whats the error {}", e.getMessage());
+                logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+                    "Exception caught during processCsarServiceArtifacts", "ASDC", "processCsarServiceArtifacts",
+                    MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in processCsarServiceArtifacts",
+                    e);
+            }
     			}
 
     				
@@ -865,5 +866,4 @@
         }
         return UNKNOWN;
     }
-
 }
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java
index ab5b7aa..876c5e1 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -22,8 +24,8 @@
 
 import org.onap.sdc.api.consumer.INotificationCallback;
 import org.onap.sdc.api.notification.INotificationData;
-import org.onap.so.logger.MsoLogger;
-import org.onap.so.utils.UUIDChecker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -38,7 +40,7 @@
 	@Autowired
     private ASDCController asdcController;
     
-    protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,ASDCNotificationCallBack.class);
+    protected static final Logger logger = LoggerFactory.getLogger(ASDCNotificationCallBack.class);
 
     /**
      * This method can be called multiple times at the same moment.
@@ -46,13 +48,8 @@
      */
     @Override
     public void activateCallback (INotificationData iNotif) {
-        long startTime = System.currentTimeMillis ();
-        UUIDChecker.generateUUID (LOGGER);
-        MsoLogger.setServiceName ("NotificationHandler");
-        MsoLogger.setLogContext (iNotif.getDistributionID (), iNotif.getServiceUUID ());
         String event = "Receive a callback notification in ASDC, nb of resources: " + iNotif.getResources ().size ();
-        LOGGER.debug(event);
+        logger.debug(event);
         asdcController.treatNotification (iNotif);
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Completed the treatment of the notification");
     }
 }
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCStatusCallBack.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCStatusCallBack.java
index d2ac8e7..612599b 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCStatusCallBack.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCStatusCallBack.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -27,8 +29,8 @@
 import org.onap.so.asdc.installer.heat.ToscaResourceInstaller;
 import org.onap.so.db.request.beans.WatchdogDistributionStatus;
 import org.onap.so.db.request.data.repository.WatchdogDistributionStatusRepository;
-import org.onap.so.logger.MsoLogger;
-import org.onap.so.utils.UUIDChecker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -38,18 +40,13 @@
 	@Autowired
 	private ToscaResourceInstaller toscaInstaller;
 
-	protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,ASDCStatusCallBack.class);
+	protected static final Logger logger = LoggerFactory.getLogger(ASDCStatusCallBack.class);
 	
 	@Autowired
 	private WatchdogDistributionStatusRepository watchdogDistributionStatusRepository;
 
 	@Override
 	public void activateCallback (IStatusData iStatus) {
-		
-		long startTime = System.currentTimeMillis ();
-		UUIDChecker.generateUUID (LOGGER);
-		MsoLogger.setServiceName ("ASDCStatusCallBack");
-		MsoLogger.setLogContext (iStatus.getDistributionID (), iStatus.getComponentName());
 		String event = "Receive a callback componentStatus in ASDC, for componentName: " + iStatus.getComponentName() + " and status of " + iStatus.getStatus() + " distributionID of " + iStatus.getDistributionID();
 
 		try{
@@ -63,15 +60,14 @@
 					watchdogDistributionStatus.setDistributionId(iStatus.getDistributionID ());
 					watchdogDistributionStatusRepository.save(watchdogDistributionStatus);
 				}
-				LOGGER.debug(event); 
+				logger.debug(event);
 				toscaInstaller.installTheComponentStatus(iStatus);
 				
 			}
 		  }
 		}catch(ArtifactInstallerException e){
-			LOGGER.error("Error in ASDCStatusCallback " + e.getMessage(),e);
-			LOGGER.debug("Error in ASDCStatusCallback " + e.getMessage());
+			logger.error("Error in ASDCStatusCallback {}", e.getMessage(), e);
+			logger.debug("Error in ASDCStatusCallback {}", e.getMessage());
 		}         
-		LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Completed the treatment of the notification");
-	} 	
-}
\ No newline at end of file
+	}
+}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/DistributionClientEmulator.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/DistributionClientEmulator.java
index 596ad16..ffb7f7a 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/DistributionClientEmulator.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/DistributionClientEmulator.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -27,7 +29,6 @@
 import java.util.List;
 
 import org.onap.so.asdc.installer.IVfModuleData;
-import org.onap.so.logger.MsoLogger;
 import org.onap.sdc.api.IDistributionClient;
 import org.onap.sdc.api.consumer.IComponentDoneStatusMessage;
 import org.onap.sdc.api.consumer.IConfiguration;
@@ -42,6 +43,8 @@
 import org.onap.sdc.impl.DistributionClientDownloadResultImpl;
 import org.onap.sdc.impl.DistributionClientResultImpl;
 import org.onap.sdc.utils.DistributionActionResultEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class DistributionClientEmulator implements IDistributionClient {
 
@@ -52,7 +55,7 @@
 	private List<IDistributionStatusMessage> distributionMessageReceived = new LinkedList<>();
 	
 	
-	private static final MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,DistributionClientEmulator.class );
+	private static final Logger logger = LoggerFactory.getLogger(DistributionClientEmulator.class );
 	
 	public DistributionClientEmulator() {			
 	}
@@ -90,9 +93,8 @@
 		byte[] inputStream=null;
 		try {
 			inputStream = getData(filename);
-		} catch (IOException e) {	
-			
-			logger.error("IOException in DistributionClientEmulator.download() method :",e);
+		} catch (IOException e) {
+			logger.error("IOException in DistributionClientEmulator.download() method", e);
 		}		
 	
 		return new DistributionClientDownloadResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name(),arg0.getArtifactName(),inputStream);		
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
index e86fac7..329c139 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -40,6 +42,8 @@
 import org.onap.so.asdc.installer.heat.ToscaResourceInstaller;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
@@ -65,7 +69,7 @@
 	
 	private static JsonStatusData statusData;
 	
-	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,ASDCRestInterface.class );
+	private static final Logger logger = LoggerFactory.getLogger(ASDCRestInterface.class );
 	
 	@Autowired
 	private ASDCController asdcController;
@@ -100,21 +104,18 @@
 			statusData = JsonStatusData.instantiateNotifFromJsonFile("resource-examples/");
 		
 			ASDCController asdcController = new ASDCController("asdc-controller1", distributionClientEmulator);
-			//LOGGER.info(MessageEnum.ASDC_INIT_ASDC_CLIENT_EXC, notifDataWithoutModuleInfo.getServiceUUID(), "ASDC", "initASDC()");
 			asdcController.initASDC();
-			//LOGGER.info(MessageEnum.ASDC_INIT_ASDC_CLIENT_EXC, notifDataWithoutModuleInfo.getServiceUUID(), "ASDC", "treatNotification()");
 			toscaInstaller.installTheComponentStatus(statusData);
-			//asdcController.treatNotification(notifDataWithoutModuleInfo);
-			//LOGGER.info(MessageEnum.ASDC_INIT_ASDC_CLIENT_EXC, notifDataWithoutModuleInfo.getServiceUUID(), "ASDC", "closeASDC()");
 			asdcController.closeASDC();
 		}catch(Exception e){
-			System.out.println("Error caught " + e.getMessage());
-			LOGGER.error(MessageEnum.ASDC_GENERAL_EXCEPTION,
-					"Exception caught during ASDCRestInterface", "ASDC", "invokeASDCService", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in invokeASDCService", e);
+			logger.info("Error caught " + e.getMessage());
+			logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION.toString(),
+				"Exception caught during ASDCRestInterface", "ASDC", "invokeASDCService",
+				MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in invokeASDCService", e);
 		}
-		System.out.println("ASDC Updates are complete");
-		LOGGER.info(MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC, statusData.getDistributionID(), "ASDC", "ASDC Updates Are Complete");
-		
+		logger.info("ASDC Updates are complete");
+		logger.info("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC.toString(), statusData.getDistributionID(), "ASDC",
+			"ASDC Updates Are Complete");
 		return null;
 	}
 }
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
index 6ddc2a8..700a5b1 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -50,6 +52,8 @@
 import org.onap.so.db.catalog.beans.VnfResourceCustomization;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ToscaResourceStructure {
 	
@@ -94,9 +98,7 @@
 	private VfModule vfModule;
 	
 	private VfModuleCustomization vfModuleCustomization;
-	
-	//private VnfResource vnfResource;
-	
+
 	private VnfResourceCustomization vnfResourceCustomization;
 		
 	private AllottedResource allottedResource;
@@ -109,7 +111,7 @@
 	
 	private ToscaCsar toscaCsar;
 	
-	protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC, ToscaResourceStructure.class);
+	protected static final Logger logger = LoggerFactory.getLogger(ToscaResourceStructure.class);
 		
 	
 	public ToscaResourceStructure(){
@@ -122,22 +124,24 @@
 				
 			SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();//Autoclosable
 			
-			LOGGER.debug("MSO config path is: " + System.getProperty("mso.config.path"));
+			logger.debug("MSO config path is: " + System.getProperty("mso.config.path"));
 			
 			String filePath = Paths.get(System.getProperty("mso.config.path"), "ASDC",  artifact.getArtifactVersion(), artifact.getArtifactName()).normalize().toString();
 
 			File spoolFile = new File(filePath);
- 
-			LOGGER.debug("ASDC File path is: " + spoolFile.getAbsolutePath());
-			LOGGER.info(MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF, "***PATH", "ASDC", spoolFile.getAbsolutePath());
-			
+
+			logger.debug("ASDC File path is: {}", spoolFile.getAbsolutePath());
+			logger.info("{} {} {} {}", MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF.toString(), "***PATH", "ASDC",
+				spoolFile.getAbsolutePath());
 
 			sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath(),false);
 
 		}catch(Exception e){
-			System.out.println("System out " + e.getMessage());
-			LOGGER.error(MessageEnum.ASDC_GENERAL_EXCEPTION_ARG,
-					"Exception caught during parser *****LOOK********* " + artifact.getArtifactName(), "ASDC", "processResourceNotification", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in processResourceNotification", e);
+			logger.info("System out {}", e.getMessage());
+			logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+				"Exception caught during parser *****LOOK********* " + artifact.getArtifactName(), "ASDC",
+				"processResourceNotification", MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+				"Exception in " + "processResourceNotification", e);
 			
 			throw new ASDCDownloadException ("Exception caught when passing the csar file to the parser ", e);
 		}	
@@ -474,10 +478,6 @@
 		this.toscaCsar = toscaCsar;
 	}
 
-	public static MsoLogger getLogger() {
-		return LOGGER;
-	}
-	
 	public boolean isDeployedSuccessfully() {
 		return isDeployedSuccessfully;
 	}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java
index f5e4511..5b24dc5 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -33,7 +35,6 @@
 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
 import org.onap.so.db.catalog.beans.Service;
 import org.onap.so.db.catalog.beans.VnfResource;
-import org.onap.so.logger.MsoLogger;
 import org.onap.sdc.api.IDistributionClient;
 import org.onap.sdc.api.notification.IArtifactInfo;
 import org.onap.sdc.api.notification.INotificationData;
@@ -44,6 +45,9 @@
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * This structure exists to avoid having issues if the order of the vfResource/vfmodule artifact is not good (tree structure).
  *
@@ -52,7 +56,7 @@
 
 public class VfResourceStructure {
 	
-	protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC, VfResourceStructure.class);
+	protected static final Logger logger = LoggerFactory.getLogger(VfResourceStructure.class);
 
 	private boolean isDeployedSuccessfully=false;
 	/**
@@ -134,8 +138,9 @@
 
 		//for vender tosca VNF there is no VFModule in VF
 		if (vfModulesMetadataList == null) {
-		    LOGGER.info(MessageEnum.ASDC_GENERAL_INFO,"There is no VF mudules in the VF.", "ASDC", "createVfModuleStructures");
-		    return;
+			logger.info("{} {} {} {}", MessageEnum.ASDC_GENERAL_INFO.toString(), "There is no VF mudules in the VF.", "ASDC",
+				"createVfModuleStructures");
+			return;
 		}
 			for (IVfModuleData vfModuleMeta:vfModulesMetadataList) {
 				vfModulesStructureList.add(new VfModuleStructure(this,vfModuleMeta));
@@ -218,11 +223,11 @@
 			return listVFModuleMetaData;
 
 		} catch (JsonParseException e) {
-			LOGGER.debug("JsonParseException : ",e);
+			logger.debug("JsonParseException : ",e);
 		} catch (JsonMappingException e) {
-			LOGGER.debug("JsonMappingException : ",e);
+			logger.debug("JsonMappingException : ",e);
 		} catch (IOException e) {
-			LOGGER.debug("IOException : ",e);
+			logger.debug("IOException : ",e);
 		}
 		return null;
 	}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
index 59030e6..7e3f5df 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
@@ -47,13 +47,15 @@
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 
 @Component
 public class BpmnInstaller {
-	protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,BpmnInstaller.class);
+	protected static final Logger logger = LoggerFactory.getLogger(BpmnInstaller.class);
 	private static final String BPMN_SUFFIX = ".bpmn";
 	private static final String CAMUNDA_URL = "mso.camundaURL";
 	private static final String CREATE_DEPLOYMENT_PATH = "/sobpmnengine/deployment/create";
@@ -62,7 +64,7 @@
 	private Environment env;	
 	
 	public void installBpmn(String csarFilePath) {
-		LOGGER.info("Deploying BPMN files from " + csarFilePath);		
+		logger.info("Deploying BPMN files from {}", csarFilePath);
 		try {			
 			ZipInputStream csarFile = new ZipInputStream(new FileInputStream(Paths.get(csarFilePath).normalize().toString()));
 			ZipEntry entry = csarFile.getNextEntry();		
@@ -70,45 +72,39 @@
 			while (entry != null) {				
 				String name = entry.getName();
 				if (name.endsWith(BPMN_SUFFIX)) {
-					LOGGER.debug("Attempting to deploy BPMN file: " + name);
+					logger.debug("Attempting to deploy BPMN file: {}", name);
 					try {
 						Path p = Paths.get(name);
 						String fileName = p.getFileName().toString();
 						extractBpmnFileFromCsar(csarFile, fileName);
 						HttpResponse response = sendDeploymentRequest(fileName);
-						LOGGER.debug("Response status line: " + response.getStatusLine());
-						LOGGER.debug("Response entity: " + response.getEntity().toString());
+						logger.debug("Response status line: {}", response.getStatusLine());
+						logger.debug("Response entity: {}", response.getEntity().toString());
 						if (response.getStatusLine().getStatusCode() != 200) {
-							LOGGER.debug("Failed deploying BPMN " + name);
-			                LOGGER.error(MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL,
-			        				name,
-			        				fileName,
-			        				"",
-			        				Integer.toString(response.getStatusLine().getStatusCode()), "", "", MsoLogger.ErrorCode.DataError, "ASDC BPMN deploy failed"); 	
+							logger.debug("Failed deploying BPMN {}", name);
+							logger
+								.error("{} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), name, fileName,
+									Integer.toString(response.getStatusLine().getStatusCode()), MsoLogger.ErrorCode.DataError.getValue(),
+									"ASDC BPMN deploy failed");
 						}						
 						else {
-							LOGGER.debug("Successfully deployed to Camunda: " + name);
+							logger.debug("Successfully deployed to Camunda: {}", name);
 						}
 					}
 					catch (Exception e) {
-						LOGGER.debug("Exception :",e);
-		                LOGGER.error(MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL,
-		        				name,
-		        				"",
-		        				"",
-		        				e.getMessage(), "", "", MsoLogger.ErrorCode.DataError, "ASDC BPMN deploy failed"); 					
+						logger.debug("Exception :", e);
+						logger
+							.error("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), name, e.getMessage(),
+								MsoLogger.ErrorCode.DataError.getValue(), "ASDC BPMN deploy failed");
 					}							
 				}
 				entry = csarFile.getNextEntry();
 	        }
 			csarFile.close();
 		} catch (IOException ex) {
-			LOGGER.debug("Exception :",ex);
-            LOGGER.error(MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL,
-    				csarFilePath,
-    				"",
-    				"",
-    				ex.getMessage(), "", "", MsoLogger.ErrorCode.DataError, "ASDC reading CSAR with workflows failed");
+			logger.debug("Exception :", ex);
+			logger.error("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), csarFilePath,
+				ex.getMessage(), MsoLogger.ErrorCode.DataError.getValue(), "ASDC reading CSAR with workflows failed");
 		}
 		return;
 	}
@@ -125,12 +121,10 @@
                 }
             }
         } catch (Exception e) {
-            LOGGER.debug("Exception :", e);
-            LOGGER.error(MessageEnum.ASDC_ARTIFACT_CHECK_EXC,
-                csarFilePath,"","",
-                e.getMessage(), "", "",
-                MsoLogger.ErrorCode.DataError, "ASDC Unable to check CSAR entries");
-        }
+					logger.debug("Exception :", e);
+					logger.error("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_CHECK_EXC.toString(), csarFilePath, e.getMessage(),
+						MsoLogger.ErrorCode.DataError.getValue(), "ASDC Unable to check CSAR entries");
+				}
         return workflowsInCsar;
     }
 
@@ -194,7 +188,7 @@
 		}
 		/* outputStream.close(); */
 		} catch (IOException e) {
-              LOGGER.error("Unable to open file.", e);
+              logger.error("Unable to open file.", e);
         }
 	}
 }
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 60d5d7e..313a67d 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -34,7 +36,6 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import org.hibernate.StaleObjectStateException;
 import org.hibernate.exception.ConstraintViolationException;
 import org.hibernate.exception.LockAcquisitionException;
 import org.onap.sdc.api.notification.IArtifactInfo;
@@ -124,6 +125,8 @@
 import org.onap.so.db.request.data.repository.WatchdogServiceModVerIdLookupRepository;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.orm.ObjectOptimisticLockingFailureException;
 import org.springframework.stereotype.Component;
@@ -222,7 +225,7 @@
 	@Autowired
 	protected ExternalServiceToInternalServiceRepository externalServiceToInternalServiceRepository;
 	
-	protected static final MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,ToscaResourceInstaller.class);
+	protected static final Logger logger = LoggerFactory.getLogger(ToscaResourceInstaller.class);
 
 	public boolean isResourceAlreadyDeployed(VfResourceStructure vfResourceStruct) throws ArtifactInstallerException {
 		boolean status = false;
@@ -258,15 +261,16 @@
 			}
 			return status;
 		} catch (Exception e) {
-			logger.error(MessageEnum.ASDC_ARTIFACT_CHECK_EXC, "", "", MsoLogger.ErrorCode.SchemaError,
+			logger
+				.error("{} {} {}", MessageEnum.ASDC_ARTIFACT_CHECK_EXC.toString(), MsoLogger.ErrorCode.SchemaError.getValue(),
 					"Exception - isResourceAlreadyDeployed");
 			throw new ArtifactInstallerException("Exception caught during checking existence of the VNF Resource.", e);
 		}
 	}
 
 	public void installTheComponentStatus(IStatusData iStatus) throws ArtifactInstallerException {
-		logger.debug("Entering installTheComponentStatus for distributionId " + iStatus.getDistributionID()
-				+ " and ComponentName " + iStatus.getComponentName());
+		logger.debug("Entering installTheComponentStatus for distributionId {} and ComponentName {}",
+			iStatus.getDistributionID(), iStatus.getComponentName());
 
 		try {
 			WatchdogComponentDistributionStatus cdStatus = new WatchdogComponentDistributionStatus(iStatus.getDistributionID(),
@@ -275,7 +279,7 @@
 			watchdogCDStatusRepository.save(cdStatus);
 
 		} catch (Exception e) {
-			logger.debug("Exception caught in installTheComponentStatus " + e.getMessage());
+			logger.debug("Exception caught in installTheComponentStatus {}", e.getMessage());
 			throw new ArtifactInstallerException("Exception caught in installTheComponentStatus " + e.getMessage());
 		}
 	}
@@ -338,18 +342,18 @@
 
 			if (dbExceptionToCapture instanceof ConstraintViolationException
 					|| dbExceptionToCapture instanceof LockAcquisitionException) {
-				logger.warn(MessageEnum.ASDC_ARTIFACT_ALREADY_DEPLOYED,
-						vfResourceStructure.getResourceInstance().getResourceName(),
-						vfResourceStructure.getNotification().getServiceVersion(), "", MsoLogger.ErrorCode.DataError, "Exception - ASCDC Artifact already deployed", e);
+				logger.warn("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_ALREADY_DEPLOYED.toString(),
+					vfResourceStructure.getResourceInstance().getResourceName(),
+					vfResourceStructure.getNotification().getServiceVersion(), MsoLogger.ErrorCode.DataError.getValue(),
+					"Exception - ASCDC Artifact already deployed", e);
 			} else {
 				String elementToLog = (!artifactListForLogging.isEmpty()
 						? artifactListForLogging.get(artifactListForLogging.size() - 1).toString()
 						: "No element listed");
-				logger.error(MessageEnum.ASDC_ARTIFACT_INSTALL_EXC, elementToLog, "", "", MsoLogger.ErrorCode.DataError,
-						"Exception caught during installation of "
-								+ vfResourceStructure.getResourceInstance().getResourceName()
-								+ ". Transaction rollback",
-						e);
+				logger.error("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_INSTALL_EXC.toString(), elementToLog,
+					MsoLogger.ErrorCode.DataError.getValue(),
+					"Exception caught during installation of " + vfResourceStructure.getResourceInstance().getResourceName()
+						+ ". Transaction rollback", e);
 				throw new ArtifactInstallerException("Exception caught during installation of "
 						+ vfResourceStructure.getResourceInstance().getResourceName() + ". Transaction rollback.", e);
 			}
@@ -739,10 +743,9 @@
 				break;
 			case ASDCConfiguration.HEAT_NET:
 			case ASDCConfiguration.OTHER:
-				logger.warn(MessageEnum.ASDC_ARTIFACT_TYPE_NOT_SUPPORT,
-						vfModuleArtifact.getArtifactInfo().getArtifactType() + "(Artifact Name:"
-								+ vfModuleArtifact.getArtifactInfo().getArtifactName() + ")",
-						"", "", MsoLogger.ErrorCode.DataError, "Artifact type not supported");
+				logger.warn("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_TYPE_NOT_SUPPORT.toString(),
+					vfModuleArtifact.getArtifactInfo().getArtifactType() + "(Artifact Name:" + vfModuleArtifact.getArtifactInfo()
+						.getArtifactName() + ")", MsoLogger.ErrorCode.DataError.getValue(), "Artifact type not supported");
 				break;
 			default:
 				break;
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/tenantIsolation/WatchdogDistribution.java b/asdc-controller/src/main/java/org/onap/so/asdc/tenantIsolation/WatchdogDistribution.java
index 8c9fb62..c95d701 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/tenantIsolation/WatchdogDistribution.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/tenantIsolation/WatchdogDistribution.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -36,7 +38,8 @@
 import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
 import org.onap.so.db.request.data.repository.WatchdogDistributionStatusRepository;
 import org.onap.so.db.request.data.repository.WatchdogServiceModVerIdLookupRepository;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -44,7 +47,7 @@
 @Component
 public class WatchdogDistribution {
 
-	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC,WatchdogDistribution.class);
+	private static final Logger logger = LoggerFactory.getLogger(WatchdogDistribution.class);
 
 	private AAIResourcesClient aaiClient;
 	
@@ -64,7 +67,7 @@
 	private String[] componentNames;
 	   
 	public String getOverallDistributionStatus(String distributionId) throws Exception {
-		LOGGER.debug("Entered getOverallDistributionStatus method for distrubutionId: " + distributionId);
+		logger.debug("Entered getOverallDistributionStatus method for distrubutionId: {}", distributionId);
 		
 		String status = null;
 		try {
@@ -78,11 +81,13 @@
 			String distributionStatus = watchdogDistributionStatus.getDistributionIdStatus();
 			
 			if(DistributionStatus.TIMEOUT.name().equalsIgnoreCase(distributionStatus)) {
-				LOGGER.debug("Ignoring to update WatchdogDistributionStatus as distributionId: " + distributionId + " status is set to: " + distributionStatus);
+				logger.debug("Ignoring to update WatchdogDistributionStatus as distributionId: {} status is set to: {}",
+					distributionId, distributionStatus);
 				return DistributionStatus.TIMEOUT.name();
 			} else {
 				List<WatchdogComponentDistributionStatus> results = watchdogCDStatusRepository.findByDistributionId(distributionId);
-				LOGGER.debug("Executed RequestDB getWatchdogComponentDistributionStatus for distrubutionId: " + distributionId);
+				logger.debug("Executed RequestDB getWatchdogComponentDistributionStatus for distrubutionId: {}",
+					distributionId);
 		
 				//*************************************************************************************************************************************************
 				//**** Compare config values verse DB watchdog component names to see if every component has reported status before returning final result back to ASDC
@@ -98,13 +103,13 @@
 		                
 						for(WatchdogComponentDistributionStatus cdStatus: cdStatuses){							
 							if(name.equals(cdStatus.getComponentName())){
-								LOGGER.debug("Found componentName " + name + " in the WatchDog Component DB");
+								logger.debug("Found componentName {} in the WatchDog Component DB", name);
 								match = true;
 								break;
 							}
 						}						
 						if(!match){
-							LOGGER.debug(name + " has not be updated in the the WatchDog Component DB yet, so ending the loop");
+							logger.debug("{} has not be updated in the the WatchDog Component DB yet, so ending the loop", name);
 							allComponentsComplete = false;
 							break;
 						}
@@ -112,11 +117,12 @@
 		         
 				
 				if(allComponentsComplete) {				
-					LOGGER.debug("Components Size matched with the WatchdogComponentDistributionStatus results.");
+					logger.debug("Components Size matched with the WatchdogComponentDistributionStatus results.");
 					
 					 for(WatchdogComponentDistributionStatus componentDist : results) {
 						 String componentDistributionStatus = componentDist.getComponentDistributionStatus();
-						 LOGGER.debug("Component status: " + componentDistributionStatus + " on componentName: " + componentDist.getComponentName());
+						 logger.debug("Component status: {} on componentName: ", componentDistributionStatus, componentDist
+							 .getComponentName());
 						 if(componentDistributionStatus.equalsIgnoreCase("COMPONENT_DONE_ERROR")) {
 							 status = DistributionStatus.FAILURE.name();
 							 break;
@@ -127,27 +133,28 @@
 						 }
 					 }
 					 
-					 LOGGER.debug("Updating overall DistributionStatus to: " + status + " for distributionId: " + distributionId);
+					 logger.debug("Updating overall DistributionStatus to: {} for distributionId: ", status, distributionId);
 					 
 					 watchdogDistributionStatus.setDistributionIdStatus(status);
 					 watchdogDistributionStatusRepository.save(watchdogDistributionStatus);
 				} else {
-					LOGGER.debug("Components Size Didn't match with the WatchdogComponentDistributionStatus results.");
+					logger.debug("Components Size Didn't match with the WatchdogComponentDistributionStatus results.");
 					status = DistributionStatus.INCOMPLETE.name();
 					return status;
 				}
 			}
 		}catch (Exception e) {
-			LOGGER.debug("Exception occurred on getOverallDistributionStatus : " + e.getMessage());
-			LOGGER.error(e);
+			logger.debug("Exception occurred on getOverallDistributionStatus : {}", e.getMessage());
+			logger.error("Exception occurred",  e);
 			throw new Exception(e);
 		}		
-		LOGGER.debug("Exiting getOverallDistributionStatus method in WatchdogDistribution");
+		logger.debug("Exiting getOverallDistributionStatus method in WatchdogDistribution");
 		return status;
 	}
 	
 	public void executePatchAAI(String distributionId, String serviceModelInvariantUUID, String distributionStatus) throws Exception {
-		LOGGER.debug("Entered executePatchAAI method with distrubutionId: " + distributionId + " and distributionStatus: " + distributionStatus);
+		logger.debug("Entered executePatchAAI method with distrubutionId: {} and distributionStatus: ", distributionId,
+			distributionStatus);
 		
 		try {
 			WatchdogServiceModVerIdLookup lookup = watchdogModVerIdLookupRepository.findOneByDistributionId(distributionId);
@@ -156,28 +163,29 @@
 			if(lookup != null) {
 				serviceModelVersionId = lookup.getServiceModelVersionId();
 			}
-			
-			LOGGER.debug("Executed RequestDB getWatchdogServiceModVerIdLookup with distributionId: " + distributionId + " and serviceModelVersionId: " + serviceModelVersionId);
-			LOGGER.debug("ASDC Notification ServiceModelInvariantUUID : " + serviceModelInvariantUUID);
+
+			logger.debug("Executed RequestDB getWatchdogServiceModVerIdLookup with distributionId: {} "
+				+ "and serviceModelVersionId: {}", distributionId, serviceModelVersionId);
+			logger.debug("ASDC Notification ServiceModelInvariantUUID : {}", serviceModelInvariantUUID);
 			
 			if(serviceModelInvariantUUID == null || "".equals(serviceModelVersionId)) {
 				String error = "No Service found with serviceModelInvariantUUID: " + serviceModelInvariantUUID;
-				LOGGER.debug(error);
+				logger.debug(error);
 				throw new Exception(error);
 			}
 			
 			AAIResourceUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.MODEL_VER, serviceModelInvariantUUID, serviceModelVersionId);
 			aaiUri.depth(Depth.ZERO); //Do not return relationships if any
-			LOGGER.debug("Target A&AI Resource URI: " + aaiUri.build().toString());
+			logger.debug("Target A&AI Resource URI: {}", aaiUri.build().toString());
 			
 			Map<String, String> payload = new HashMap<>();
 			payload.put("distribution-status", distributionStatus);
 			getAaiClient().update(aaiUri, payload);
-			
-			LOGGER.debug("A&AI UPDATE MODEL Version is success!");
+
+			logger.debug("A&AI UPDATE MODEL Version is success!");
 		} catch (Exception e) {
-			LOGGER.debug("Exception occurred on executePatchAAI : " + e.getMessage());
-			LOGGER.error(e);
+			logger.debug("Exception occurred on executePatchAAI : {}", e.getMessage());
+			logger.error("Exception occurred", e);
 			throw new Exception(e);
 		}
 	}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/NotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/NotificationLogging.java
index 965f8b7..fae1da3 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/util/NotificationLogging.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/NotificationLogging.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -34,15 +36,16 @@
 import java.util.List;
 import java.util.Map;
 
-import org.onap.so.logger.MsoLogger;
 import org.onap.sdc.api.notification.INotificationData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public class NotificationLogging implements InvocationHandler {
 	
 	private static Map<Object, List<Method>> objectMethodsToLog = new HashMap<>();
 
-	protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC, NotificationLogging.class);
+	protected static final Logger logger = LoggerFactory.getLogger(NotificationLogging.class);
 	
 	private static InvocationHandler handler = (arg0, arg1, arg2) -> {
 			List<Method> methods = objectMethodsToLog.get(arg0);
@@ -93,7 +96,7 @@
 					buffer.append(testNull(m.invoke(iNotif, (Object[])null)));
 				} catch (IllegalAccessException | IllegalArgumentException
 						| InvocationTargetException e) {
-					LOGGER.debug("Exception :"+e);
+					logger.debug("Exception", e);
 					buffer.append("UNREADABLE");
 				}
 				buffer.append(System.lineSeparator());
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/xml/XmlTool.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/xml/XmlTool.java
index 49bf95f..6c8070f 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/xml/XmlTool.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/xml/XmlTool.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -21,7 +23,6 @@
 
 package org.onap.so.bpmn.core.xml;
 
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -50,9 +51,9 @@
 import javax.xml.xpath.XPathFactory;
 
 import org.apache.commons.lang3.StringEscapeUtils;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
@@ -64,7 +65,7 @@
 public final class XmlTool {
 
 	private static final Map<String, Integer> ENTITIES = new HashMap<>();
-	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.BPEL, XmlTool.class);
+	private static final Logger logger = LoggerFactory.getLogger(XmlTool.class);
 	static {
 		ENTITIES.put("amp", 38);
 		ENTITIES.put("quot", 34);
@@ -165,7 +166,7 @@
 	 */
 	public static String removeNamespaces(Object xml) {
 		if (xml == null) {
-		LOGGER.debug("removeNamespaces input object is null , returning null");
+			logger.debug("removeNamespaces input object is null , returning null");
 			return null;
 		}
 
@@ -204,7 +205,7 @@
 			}
 			return out.toString();
 		} catch (Exception e) {
-			LOGGER.debug("Exception at readResourceFile stream: " + e);
+			logger.debug("Exception at readResourceFile stream: " + e);
 			return null;
 		}
 	}
@@ -242,7 +243,7 @@
 			//System.out.println("Did not find element tag " + elementTag + " in XML");
 			return Optional.empty();
 		} else {
-			modNode.setTextContent(newValue);			
+			modNode.setTextContent(newValue);
 		}
 		
 		TransformerFactory transformerFactory = TransformerFactory.newInstance();
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/utils/CamundaDBSetup.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/utils/CamundaDBSetup.java
index f3cc094..15f6fbe 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/utils/CamundaDBSetup.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/utils/CamundaDBSetup.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -21,18 +23,18 @@
 package org.onap.so.bpmn.core.utils;
 
 import java.sql.Connection;
-import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Sets up the unit test (H2) database for Camunda.
  */
 public class CamundaDBSetup {
 	private static boolean isDBConfigured = false;
-	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CamundaDBSetup.class);
+	private static final Logger logger = LoggerFactory.getLogger(CamundaDBSetup.class);
 	
 	private CamundaDBSetup() {
 	}
@@ -42,7 +44,7 @@
 			return;
 		}
 
-		LOGGER.debug ("Configuring the Camunda H2 database for MSO");
+		logger.debug ("Configuring the Camunda H2 database for MSO");
 
 		Connection connection = null;
 		PreparedStatement stmt = null;
@@ -57,7 +59,7 @@
 				try {
 					stmt.close();
 				} catch (Exception e) {
-					LOGGER.debug("Exception :",e);
+					logger.debug("Exception :",e);
 				}
 			}
 
@@ -65,9 +67,9 @@
 				try {
 					connection.close();
 				} catch (Exception e) {
-					LOGGER.debug("Exception :",e);
+					logger.debug("Exception :",e);
 				}
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
index 13fe61f..5cc0281 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
@@ -23,7 +23,7 @@
 package org.onap.so.bpmn.infrastructure.pnf.delegate;
 
 import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
 
 import java.util.HashMap;
@@ -62,7 +62,7 @@
     @Test
     public void shouldWaitForMessageFromDmaapAndUpdateAaiEntryWhenAaiEntryExists() {
         // given
-        variables.put(CORRELATION_ID, PnfManagementTestImpl.ID_WITH_ENTRY);
+        variables.put(PNF_CORRELATION_ID, PnfManagementTestImpl.ID_WITH_ENTRY);
         // when
         ProcessInstance instance = runtimeService
                 .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables);
@@ -73,7 +73,7 @@
         assertThat(instance).isEnded().hasPassedInOrder(
                 "CreateAndActivatePnf_StartEvent",
                 "CheckInputs",
-                "CheckAiiForCorrelationId",
+                "CheckAiiForPnfCorrelationId",
                 "DoesAaiContainInfoAboutPnf",
                 "AaiEntryExists",
                 "InformDmaapClient",
@@ -88,7 +88,7 @@
     @Test
     public void shouldCreateAaiEntryWaitForMessageFromDmaapAndUpdateAaiEntryWhenNoAaiEntryExists() {
         // given
-        variables.put(CORRELATION_ID, PnfManagementTestImpl.ID_WITHOUT_ENTRY);
+        variables.put(PNF_CORRELATION_ID, PnfManagementTestImpl.ID_WITHOUT_ENTRY);
         // when
         ProcessInstance instance = runtimeService
                 .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables);
@@ -99,7 +99,7 @@
         assertThat(instance).isEnded().hasPassedInOrder(
                 "CreateAndActivatePnf_StartEvent",
                 "CheckInputs",
-                "CheckAiiForCorrelationId",
+                "CheckAiiForPnfCorrelationId",
                 "DoesAaiContainInfoAboutPnf",
                 "CreatePnfEntryInAai",
                 "AaiEntryExists",
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
index 146e07b..6a5f9fa 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
@@ -30,19 +30,19 @@
 @Primary
 public class DmaapClientTestImpl implements DmaapClient {
 
-    private String correlationId;
+    private String pnfCorrelationId;
     private Runnable informConsumer;
 
     @Override
-    public void registerForUpdate(String correlationId, Runnable informConsumer) {
-        this.correlationId = correlationId;
+    public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) {
+        this.pnfCorrelationId = pnfCorrelationId;
         this.informConsumer = informConsumer;
     }
 
     @Override
-    public Runnable unregister(String correlationId) {
-        if (Objects.equals(this.correlationId, correlationId)) {
-            this.correlationId = null;
+    public Runnable unregister(String pnfCorrelationId) {
+        if (Objects.equals(this.pnfCorrelationId, pnfCorrelationId)) {
+            this.pnfCorrelationId = null;
             Runnable informConsumer = this.informConsumer;
             this.informConsumer = null;
             return informConsumer;
@@ -50,8 +50,8 @@
         return null;
     }
 
-    public String getCorrelationId() {
-        return correlationId;
+    public String getPnfCorrelationId() {
+        return pnfCorrelationId;
     }
 
     public Runnable getInformConsumer() {
@@ -63,6 +63,6 @@
     }
 
     public boolean haveRegisteredConsumer() {
-        return correlationId != null;
+        return pnfCorrelationId != null;
     }
 }
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
index 84c9836..f9db93e 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
@@ -40,8 +40,8 @@
     private Map<String, String> serviceAndPnfRelationMap = new HashMap<>();
 
     @Override
-    public Optional<Pnf> getEntryFor(String correlationId) {
-        if (Objects.equals(correlationId, ID_WITH_ENTRY)) {
+    public Optional<Pnf> getEntryFor(String pnfCorrelationId) {
+        if (Objects.equals(pnfCorrelationId, ID_WITH_ENTRY)) {
             return Optional.of(new Pnf());
         } else {
             return Optional.empty();
@@ -49,8 +49,8 @@
     }
 
     @Override
-    public void createEntry(String correlationId, Pnf entry) {
-        created.put(correlationId, entry);
+    public void createEntry(String pnfCorrelationId, Pnf entry) {
+        created.put(pnfCorrelationId, entry);
     }
 
     @Override
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java
index 05109ab..439591a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java
@@ -33,8 +33,8 @@
 
     @Override
     public void execute(DelegateExecution execution) {
-        String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID);
-        dmaapClient.unregister(correlationId);
+        String pnfCorrelationId = (String) execution.getVariable(ExecutionVariableNames.PNF_CORRELATION_ID);
+        dmaapClient.unregister(pnfCorrelationId);
     }
 
     @Autowired
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
similarity index 80%
rename from bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
rename to bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
index a8fb215..e0fa41b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
@@ -21,7 +21,7 @@
 package org.onap.so.bpmn.infrastructure.pnf.delegate;
 
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 
 import java.io.IOException;
 
@@ -35,16 +35,16 @@
 import org.springframework.stereotype.Component;
 
 /**
- * Implementation of "Check AAI for correlation_id" task in CreateAndActivatePnfResource.bpmn
+ * Implementation of "Check AAI for pnf_correlation_id" task in CreateAndActivatePnfResource.bpmn
  *
- * Inputs: - correlationId - String
+ * Inputs: - pnfCorrelationId - String
  *
  * Outputs: - aaiContainsInfoAboutPnf - local Boolean
  */
 @Component
-public class CheckAaiForCorrelationIdDelegate implements JavaDelegate {
+public class CheckAaiForPnfCorrelationIdDelegate implements JavaDelegate {
 
-    private static final Logger logger = LoggerFactory.getLogger(CheckAaiForCorrelationIdDelegate.class);
+    private static final Logger logger = LoggerFactory.getLogger(CheckAaiForPnfCorrelationIdDelegate.class);
 
     private PnfManagement pnfManagement;
 
@@ -55,13 +55,13 @@
 
     @Override
     public void execute(DelegateExecution execution) {
-        String correlationId = (String) execution.getVariable(CORRELATION_ID);
-        if (correlationId == null) {
-            new ExceptionUtil().buildAndThrowWorkflowException(execution, 500, CORRELATION_ID + " is not set");
+        String pnfCorrelationId = (String) execution.getVariable(PNF_CORRELATION_ID);
+        if (pnfCorrelationId == null) {
+            new ExceptionUtil().buildAndThrowWorkflowException(execution, 500, PNF_CORRELATION_ID + " is not set");
         }
         try {
-            boolean isEntry = pnfManagement.getEntryFor(correlationId).isPresent();
-            logger.debug("AAI entry is found for pnf correlation id {}: {}", CORRELATION_ID, isEntry);
+            boolean isEntry = pnfManagement.getEntryFor(pnfCorrelationId).isPresent();
+            logger.debug("AAI entry is found for pnf correlation id {}: {}", PNF_CORRELATION_ID, isEntry);
             execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, isEntry);
         } catch (IOException e) {
             new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage());
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
index c31041f..e56cb83 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
@@ -22,7 +22,7 @@
 
 package org.onap.so.bpmn.infrastructure.pnf.delegate;
 
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
 
 import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -38,7 +38,7 @@
  * Implementation of "Create Pnf entry in AAI" task in CreateAndActivatePnfResource.bpmn
  *
  * Inputs:
- *  - correlationId - String
+ *  - pnfCorrelationId - String
  *  - pnfUuid - String
  */
 @Component
@@ -54,12 +54,12 @@
 
     @Override
     public void execute(DelegateExecution execution) throws Exception {
-        String correlationId = (String) execution.getVariable(CORRELATION_ID);
+        String pnfCorrelationId = (String) execution.getVariable(PNF_CORRELATION_ID);
         String pnfUuid = (String) execution.getVariable(PNF_UUID);
         Pnf pnf = new Pnf();
         pnf.setPnfId(pnfUuid);
-        pnf.setPnfName(correlationId);
-        pnfManagement.createEntry(correlationId, pnf);
-        logger.debug("AAI entry is created for pnf correlation id: {}, pnf uuid: {}", correlationId, pnfUuid);
+        pnf.setPnfName(pnfCorrelationId);
+        pnfManagement.createEntry(pnfCorrelationId, pnf);
+        logger.debug("AAI entry is created for pnf correlation id: {}, pnf uuid: {}", pnfCorrelationId, pnfUuid);
     }
 }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
index 7b6706f..a367bad 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
@@ -44,7 +44,7 @@
     @Override
     public void execute(DelegateExecution delegateExecution) {
         String serviceInstanceId = (String) delegateExecution.getVariable("serviceInstanceId");
-        String pnfName = (String) delegateExecution.getVariable("correlationId");
+        String pnfName = (String) delegateExecution.getVariable("pnfCorrelationId");
         try {
             pnfManagementImpl.createRelation(serviceInstanceId, pnfName);
         } catch (Exception e) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
index c5caea5..7d449e7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
@@ -27,7 +27,7 @@
 
     private ExecutionVariableNames() {}
 
-    public final static String CORRELATION_ID = "correlationId";
+    public final static String PNF_CORRELATION_ID = "pnfCorrelationId";
     public final static String AAI_CONTAINS_INFO_ABOUT_PNF = "aaiContainsInfoAboutPnf";
     public final static String AAI_CONTAINS_INFO_ABOUT_IP = "aaiContainsInfoAboutIp";
     public final static String DMAAP_MESSAGE = "dmaapMessage";
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
index 1a75b09..96455ac 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
@@ -34,9 +34,9 @@
 
     @Override
     public void execute(DelegateExecution execution) {
-        String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID);
+        String pnfCorrelationId = (String) execution.getVariable(ExecutionVariableNames.PNF_CORRELATION_ID);
         RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
-        dmaapClient.registerForUpdate(correlationId, () ->
+        dmaapClient.registerForUpdate(pnfCorrelationId, () ->
             runtimeService
                 .createMessageCorrelation("WorkflowMessage")
                 .processInstanceBusinessKey(execution.getProcessBusinessKey())
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
index 1b185f7..1caadea 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
@@ -22,7 +22,7 @@
 
 package org.onap.so.bpmn.infrastructure.pnf.delegate;
 
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION;
@@ -49,16 +49,16 @@
 
     @Override
     public void execute(DelegateExecution execution) {
-        validateCorrelationId(execution);
+        validatePnfCorrelationId(execution);
         validatePnfUuid(execution);
         validateTimeout(execution);
         validateServiceInstanceId(execution);
     }
 
-    private void validateCorrelationId(DelegateExecution execution) {
-        String correlationId = (String) execution.getVariable(CORRELATION_ID);
-        if (Strings.isNullOrEmpty(correlationId)) {
-            new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "correlationId variable not defined");
+    private void validatePnfCorrelationId(DelegateExecution execution) {
+        String pnfCorrelationId = (String) execution.getVariable(PNF_CORRELATION_ID);
+        if (Strings.isNullOrEmpty(pnfCorrelationId)) {
+            new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "pnfCorrelationId variable not defined");
         }
     }
 
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
index c7e7c78..fbf86cc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
@@ -22,7 +22,7 @@
 
 public interface DmaapClient {
 
-    void registerForUpdate(String correlationId, Runnable informConsumer);
+    void registerForUpdate(String pnfCorrelationId, Runnable informConsumer);
 
-    Runnable unregister(String correlationId);
+    Runnable unregister(String pnfCorrelationId);
 }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
similarity index 77%
rename from bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java
rename to bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
index 159298b..53f6b78 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
@@ -31,19 +31,19 @@
 import java.util.Optional;
 import java.util.Spliterator;
 
-public final class JsonUtilForCorrelationId {
+public final class JsonUtilForPnfCorrelationId {
 
-    private static final String JSON_CORRELATION_ID_FIELD_NAME = "correlationId";
+    private static final String JSON_PNF_CORRELATION_ID_FIELD_NAME = "pnfCorrelationId";
 
-    static List<String> parseJsonToGelAllCorrelationId(String json) {
+    static List<String> parseJsonToGelAllPnfCorrelationId(String json) {
         JsonElement je = new JsonParser().parse(json);
         JsonArray array = je.getAsJsonArray();
         List<String> list = new ArrayList<>();
         Spliterator<JsonElement> spliterator = array.spliterator();
         spliterator.forEachRemaining(jsonElement -> {
             handleEscapedCharacters(jsonElement)
-                    .ifPresent(jsonObject -> getCorrelationId(jsonObject)
-                            .ifPresent(correlationId -> list.add(correlationId)));
+                    .ifPresent(jsonObject -> getPnfCorrelationId(jsonObject)
+                            .ifPresent(pnfCorrelationId -> list.add(pnfCorrelationId)));
         });
         return list;
     }
@@ -55,9 +55,9 @@
         return Optional.ofNullable(new JsonParser().parse(jsonElement.getAsString()).getAsJsonObject());
     }
 
-    private static Optional<String> getCorrelationId(JsonObject jsonObject) {
-        if (jsonObject.has(JSON_CORRELATION_ID_FIELD_NAME)) {
-            return Optional.ofNullable(jsonObject.get(JSON_CORRELATION_ID_FIELD_NAME).getAsString());
+    private static Optional<String> getPnfCorrelationId(JsonObject jsonObject) {
+        if (jsonObject.has(JSON_PNF_CORRELATION_ID_FIELD_NAME)) {
+            return Optional.ofNullable(jsonObject.get(JSON_PNF_CORRELATION_ID_FIELD_NAME).getAsString());
         }
         return Optional.empty();
     }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
index 52f879b..1b7a69e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
@@ -69,18 +69,18 @@
     }
 
     @Override
-    public synchronized void registerForUpdate(String correlationId, Runnable informConsumer) {
-        logger.debug("registering for pnf ready dmaap event for correlation id: {}", correlationId);
-        pnfCorrelationIdToThreadMap.put(correlationId, informConsumer);
+    public synchronized void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) {
+        logger.debug("registering for pnf ready dmaap event for pnf correlation id: {}", pnfCorrelationId);
+        pnfCorrelationIdToThreadMap.put(pnfCorrelationId, informConsumer);
         if (!dmaapThreadListenerIsRunning) {
             startDmaapThreadListener();
         }
     }
 
     @Override
-    public synchronized Runnable unregister(String correlationId) {
-        logger.debug("unregistering from pnf ready dmaap event for correlation id: {}", correlationId);
-        Runnable runnable = pnfCorrelationIdToThreadMap.remove(correlationId);
+    public synchronized Runnable unregister(String pnfCorrelationId) {
+        logger.debug("unregistering from pnf ready dmaap event for pnf correlation id: {}", pnfCorrelationId);
+        Runnable runnable = pnfCorrelationIdToThreadMap.remove(pnfCorrelationId);
         if (pnfCorrelationIdToThreadMap.isEmpty()) {
             stopDmaapThreadListener();
         }
@@ -113,7 +113,7 @@
             try {
                 logger.debug("dmaap listener starts listening pnf ready dmaap topic");
                 HttpResponse response = httpClient.execute(getRequest);
-                getCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfCorrelationIdFound);
+                getPnfCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
             } catch (IOException e) {
                 logger.error("Exception caught during sending rest request to dmaap for listening event topic", e);
             }
@@ -122,20 +122,20 @@
             }
         }
 
-        private List<String> getCorrelationIdListFromResponse(HttpResponse response) throws IOException {
+        private List<String> getPnfCorrelationIdListFromResponse(HttpResponse response) throws IOException {
             if (response.getStatusLine().getStatusCode() == 200) {
                 String responseString = EntityUtils.toString(response.getEntity(), "UTF-8");
                 if (responseString != null) {
-                    return JsonUtilForCorrelationId.parseJsonToGelAllCorrelationId(responseString);
+                    return JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId(responseString);
                 }
             }
             return Collections.emptyList();
         }
 
-        private void informAboutPnfReadyIfCorrelationIdFound(String correlationId) {
-            Runnable runnable = unregister(correlationId);
+        private void informAboutPnfReadyIfPnfCorrelationIdFound(String pnfCorrelationId) {
+            Runnable runnable = unregister(pnfCorrelationId);
             if (runnable != null) {
-                logger.debug("dmaap listener gets pnf ready event for correlationId: {}", correlationId);
+                logger.debug("dmaap listener gets pnf ready event for pnfCorrelationId: {}", pnfCorrelationId);
                 runnable.run();
             }
         }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagement.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagement.java
index b66bb5f..9e720fe 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagement.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagement.java
@@ -26,9 +26,9 @@
 
 public interface PnfManagement {
 
-    Optional<Pnf> getEntryFor(String correlationId) throws IOException;
+    Optional<Pnf> getEntryFor(String pnfCorrelationId) throws IOException;
 
-    void createEntry(String correlationId, Pnf entry) throws IOException;
+    void createEntry(String pnfCorrelationId, Pnf entry) throws IOException;
 
     void createRelation(String serviceInstanceId, String pnfName) throws IOException;
 }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
index 3d8da2a..32ea357 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
@@ -33,15 +33,15 @@
 public class PnfManagementImpl implements PnfManagement {
 
     @Override
-    public Optional<Pnf> getEntryFor(String correlationId) {
+    public Optional<Pnf> getEntryFor(String pnfCorrelationId) {
         AAIRestClientImpl restClient = new AAIRestClientImpl();
-        return restClient.getPnfByName(correlationId);
+        return restClient.getPnfByName(pnfCorrelationId);
     }
 
     @Override
-    public void createEntry(String correlationId, Pnf entry) {
+    public void createEntry(String pnfCorrelationId, Pnf entry) {
         AAIRestClientImpl restClient = new AAIRestClientImpl();
-        restClient.createPnf(correlationId, entry);
+        restClient.createPnf(pnfCorrelationId, entry);
     }
 
     @Override
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
index 8507d9c..b0ff82e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
@@ -37,9 +37,9 @@
         DmaapClientTestImpl dmaapClientTest = new DmaapClientTestImpl();
         delegate.setDmaapClient(dmaapClientTest);
         DelegateExecution delegateExecution = mock(DelegateExecution.class);
-        when(delegateExecution.getVariable(eq(ExecutionVariableNames.CORRELATION_ID))).thenReturn("testCorrelationId");
+        when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID))).thenReturn("testPnfCorrelationId");
         when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey");
-        dmaapClientTest.registerForUpdate("testCorrelationId", () -> {
+        dmaapClientTest.registerForUpdate("testPnfCorrelationId", () -> {
         });
         // when
         delegate.execute(delegateExecution);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java
similarity index 84%
rename from bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
rename to bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java
index 4b47ed6..6a0aaf7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java
@@ -28,7 +28,7 @@
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl.ID_WITHOUT_ENTRY;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl.ID_WITH_ENTRY;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -41,26 +41,26 @@
 import org.onap.so.bpmn.core.WorkflowException;
 
 @RunWith(Enclosed.class)
-public class CheckAaiForCorrelationIdDelegateTest {
+public class CheckAaiForPnfCorrelationIdDelegateTest {
 
     public static class ConnectionOkTests {
 
-        private CheckAaiForCorrelationIdDelegate delegate;
+        private CheckAaiForPnfCorrelationIdDelegate delegate;
         
         @Rule
     	public ExpectedException expectedException = ExpectedException.none();
 
         @Before
         public void setUp() {
-            delegate = new CheckAaiForCorrelationIdDelegate();
+            delegate = new CheckAaiForPnfCorrelationIdDelegate();
             delegate.setPnfManagement(new PnfManagementTestImpl());
         }
 
         @Test
-        public void shouldThrowExceptionWhenCorrelationIdIsNotSet() throws Exception {
+        public void shouldThrowExceptionWhenPnfCorrelationIdIsNotSet() throws Exception {
             // given
             DelegateExecution execution = mock(DelegateExecution.class);
-            when(execution.getVariable(CORRELATION_ID)).thenReturn(null);
+            when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(null);
             when(execution.getVariable("testProcessKey")).thenReturn("testProcessKeyValue");
             // when, then
             expectedException.expect(BpmnError.class);
@@ -72,7 +72,7 @@
         public void shouldSetCorrectVariablesWhenAaiDoesNotContainInfoAboutPnf() throws Exception {
             // given
             DelegateExecution execution = mock(DelegateExecution.class);
-            when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITHOUT_ENTRY);
+            when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(ID_WITHOUT_ENTRY);
             // when
             delegate.execute(execution);
             // then
@@ -83,7 +83,7 @@
         public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnfWithoutIp() throws Exception {
             // given
             DelegateExecution execution = mock(DelegateExecution.class);
-            when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITH_ENTRY);
+            when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(ID_WITH_ENTRY);
             // when
             delegate.execute(execution);
             // then
@@ -93,14 +93,14 @@
 
     public static class NoConnectionTests {
 
-        private CheckAaiForCorrelationIdDelegate delegate;
+        private CheckAaiForPnfCorrelationIdDelegate delegate;
         
         @Rule
     	public ExpectedException expectedException = ExpectedException.none();
 
         @Before
         public void setUp() {
-            delegate = new CheckAaiForCorrelationIdDelegate();
+            delegate = new CheckAaiForPnfCorrelationIdDelegate();
             delegate.setPnfManagement(new PnfManagementThrowingException());
         }
 
@@ -108,7 +108,7 @@
         public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() throws Exception {
             // given
             DelegateExecution execution = mock(DelegateExecution.class);
-            when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITH_ENTRY);
+            when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(ID_WITH_ENTRY);
             when(execution.getVariable("testProcessKey")).thenReturn("testProcessKey");
             // when, then
             expectedException.expect(BpmnError.class);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java
index 9c5f8f3..986edfe 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java
@@ -25,7 +25,7 @@
 import static org.mockito.BDDMockito.given;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
 
 import java.util.UUID;
@@ -43,14 +43,14 @@
         PnfManagementTestImpl pnfManagementTest = new PnfManagementTestImpl();
         delegate.setPnfManagement(pnfManagementTest);
         DelegateExecution execution = mock(DelegateExecution.class);
-        given(execution.getVariable(eq(CORRELATION_ID))).willReturn("testCorrelationId");
+        given(execution.getVariable(eq(PNF_CORRELATION_ID))).willReturn("testPnfCorrelationId");
         given(execution.getVariable(eq(PNF_UUID))).willReturn(pnfUuid);
         // when
         delegate.execute(execution);
         // then
-        Pnf createdEntry = pnfManagementTest.getCreated().get("testCorrelationId");
+        Pnf createdEntry = pnfManagementTest.getCreated().get("testPnfCorrelationId");
         assertThat(createdEntry.getPnfId()).isEqualTo(pnfUuid);
-        assertThat(createdEntry.getPnfName()).isEqualTo("testCorrelationId");
+        assertThat(createdEntry.getPnfName()).isEqualTo("testPnfCorrelationId");
         assertThat(createdEntry.isInMaint()).isNull();
     }
 }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java
index 2a78337..c743ee7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java
@@ -42,7 +42,7 @@
     public void setUp() {
         executionFake = new DelegateExecutionFake();
         executionFake.setVariable("serviceInstanceId", SERVICE_INSTANCE_ID);
-        executionFake.setVariable("correlationId", PNF_NAME);
+        executionFake.setVariable("pnfCorrelationId", PNF_NAME);
     }
 
     @Test
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
index f2a4205..19ba18f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
@@ -25,19 +25,19 @@
 
 public class DmaapClientTestImpl implements DmaapClient {
 
-    private String correlationId;
+    private String pnfCorrelationId;
     private Runnable informConsumer;
 
     @Override
-    public void registerForUpdate(String correlationId, Runnable informConsumer) {
-        this.correlationId = correlationId;
+    public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) {
+        this.pnfCorrelationId = pnfCorrelationId;
         this.informConsumer = informConsumer;
     }
 
     @Override
-    public Runnable unregister(String correlationId) {
-        if (Objects.equals(this.correlationId, correlationId)) {
-            this.correlationId = null;
+    public Runnable unregister(String pnfCorrelationId) {
+        if (Objects.equals(this.pnfCorrelationId, pnfCorrelationId)) {
+            this.pnfCorrelationId = null;
             Runnable informConsumer = this.informConsumer;
             this.informConsumer = null;
             return informConsumer;
@@ -45,8 +45,8 @@
         return null;
     }
 
-    public String getCorrelationId() {
-        return correlationId;
+    public String getPnfCorrelationId() {
+        return pnfCorrelationId;
     }
 
     public Runnable getInformConsumer() {
@@ -58,6 +58,6 @@
     }
 
     public boolean haveRegisteredConsumer() {
-        return correlationId != null;
+        return pnfCorrelationId != null;
     }
 }
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
index 23c8222..eb9f657 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
@@ -55,7 +55,7 @@
         // when
         informDmaapClient.execute(delegateExecution);
         // then
-        assertThat(dmaapClientTest.getCorrelationId()).isEqualTo("testCorrelationId");
+        assertThat(dmaapClientTest.getPnfCorrelationId()).isEqualTo("testPnfCorrelationId");
         assertThat(dmaapClientTest.getInformConsumer()).isNotNull();
         verifyZeroInteractions(messageCorrelationBuilder);
     }
@@ -66,7 +66,7 @@
         informDmaapClient.execute(delegateExecution);
         dmaapClientTest.getInformConsumer().run();
         // then
-        assertThat(dmaapClientTest.getCorrelationId()).isEqualTo("testCorrelationId");
+        assertThat(dmaapClientTest.getPnfCorrelationId()).isEqualTo("testPnfCorrelationId");
         InOrder inOrder = inOrder(messageCorrelationBuilder);
         inOrder.verify(messageCorrelationBuilder).processInstanceBusinessKey("testBusinessKey");
         inOrder.verify(messageCorrelationBuilder).correlateWithResult();
@@ -74,7 +74,7 @@
 
     private DelegateExecution mockDelegateExecution() {
         DelegateExecution delegateExecution = mock(DelegateExecution.class);
-        when(delegateExecution.getVariable(eq(ExecutionVariableNames.CORRELATION_ID))).thenReturn("testCorrelationId");
+        when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID))).thenReturn("testPnfCorrelationId");
         when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey");
         ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class);
         when(delegateExecution.getProcessEngineServices()).thenReturn(processEngineServices);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
index 80693d7..001815b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
@@ -21,7 +21,7 @@
 package org.onap.so.bpmn.infrastructure.pnf.delegate;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
 
@@ -39,7 +39,7 @@
     private static final String VALID_UUID = UUID.nameUUIDFromBytes("testUuid".getBytes()).toString();
     private static final String RESERVED_UUID = new UUID(0, 0).toString();
     private static final String DEFAULT_SERVICE_INSTANCE_ID = "da7d07d9-b71c-4128-809d-2ec01c807169";
-    private static final String DEFAULT_CORRELATION_ID = "testCorrelationId";
+    private static final String DEFAULT_PNF_CORRELATION_ID = "testPnfCorrelationId";
 
     private DelegateExecutionBuilder delegateExecutionBuilder;
 
@@ -49,9 +49,9 @@
     }
 
     @Test
-    public void shouldThrowException_whenCorrelationIdNotSet() {
+    public void shouldThrowException_whenPnfCorrelationIdNotSet() {
         PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT);
-        DelegateExecution execution = delegateExecutionBuilder.setCorrelationId(null).setPnfUuid(VALID_UUID).build();
+        DelegateExecution execution = delegateExecutionBuilder.setPnfCorrelationId(null).setPnfUuid(VALID_UUID).build();
         assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
     }
 
@@ -98,12 +98,12 @@
     }
 
     private static class DelegateExecutionBuilder {
-        private String correlationId = DEFAULT_CORRELATION_ID;
+        private String pnfCorrelationId = DEFAULT_PNF_CORRELATION_ID;
         private String pnfUuid = VALID_UUID;
         private String serviceInstanceId = DEFAULT_SERVICE_INSTANCE_ID;
 
-        public DelegateExecutionBuilder setCorrelationId(String correlationId) {
-            this.correlationId = correlationId;
+        public DelegateExecutionBuilder setPnfCorrelationId(String pnfCorrelationId) {
+            this.pnfCorrelationId = pnfCorrelationId;
             return this;
         }
 
@@ -120,7 +120,7 @@
         public DelegateExecution build() {
             DelegateExecution execution = new DelegateExecutionFake();
             execution.setVariable("testProcessKey", "testProcessKeyValue");
-            execution.setVariable(CORRELATION_ID, this.correlationId);
+            execution.setVariable(PNF_CORRELATION_ID, this.pnfCorrelationId);
             execution.setVariable(PNF_UUID, this.pnfUuid);
             execution.setVariable(SERVICE_INSTANCE_ID, this.serviceInstanceId);
             return execution;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
index 1377c82..3a9d6d0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
@@ -37,8 +37,8 @@
     private Map<String, Pnf> created = new HashMap<>();
 
     @Override
-    public Optional<Pnf> getEntryFor(String correlationId) {
-        if (Objects.equals(correlationId, ID_WITH_ENTRY)) {
+    public Optional<Pnf> getEntryFor(String pnfCorrelationId) {
+        if (Objects.equals(pnfCorrelationId, ID_WITH_ENTRY)) {
             return Optional.of(new Pnf());
         } else {
             return Optional.empty();
@@ -46,8 +46,8 @@
     }
 
     @Override
-    public void createEntry(String correlationId, Pnf entry) throws IOException {
-        created.put(correlationId, entry);
+    public void createEntry(String pnfCorrelationId, Pnf entry) throws IOException {
+        created.put(pnfCorrelationId, entry);
     }
 
     @Override
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementThrowingException.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementThrowingException.java
index 43315d3..f9b467c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementThrowingException.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementThrowingException.java
@@ -28,12 +28,12 @@
 public class PnfManagementThrowingException implements PnfManagement {
 
     @Override
-    public Optional<Pnf> getEntryFor(String correlationId) throws IOException {
+    public Optional<Pnf> getEntryFor(String pnfCorrelationId) throws IOException {
         throw new IOException();
     }
 
     @Override
-    public void createEntry(String correlationId, Pnf entry) throws IOException {
+    public void createEntry(String pnfCorrelationId, Pnf entry) throws IOException {
         throw new IOException();
     }
 
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java
deleted file mode 100644
index fde112b..0000000
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2018 Nokia.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.bpmn.infrastructure.pnf.dmaap;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.List;
-import org.junit.Test;
-
-public class JsonUtilForCorrelationIdTest {
-
-    private static final String JSON_EXAMPLE_WITH_CORRELATION_ID = "[{\"correlationId\": \"corrTest1\","
-            + "\"key1\":\"value1\"},{\"correlationId\": \"corrTest2\",\"key2\":\"value2\"}]";
-
-    private static final String JSON_WITH_ONE_CORRELATION_ID = "[{\"correlationId\":\"corrTest3\"}]";
-
-    private static final String JSON_WITH_TWO_CORRELATION_ID_AND_ESCAPED_CHARACTERS =
-            "[\"{\\\"correlationId\\\":\\\"corrTest4\\\"}\", \"{\\\"correlationId\\\":\\\"corrTest5\\\"}\"]";
-
-    private static final String JSON_WITH_NO_CORRELATION_ID = "[{\"key1\":\"value1\"}]";
-
-    @Test
-    public void parseJsonSuccessful() {
-        List<String> expectedResult = JsonUtilForCorrelationId
-                .parseJsonToGelAllCorrelationId(JSON_EXAMPLE_WITH_CORRELATION_ID);
-        assertThat(expectedResult).containsExactly("corrTest1", "corrTest2");
-
-        List<String> expectedResult2 = JsonUtilForCorrelationId
-                .parseJsonToGelAllCorrelationId(JSON_WITH_ONE_CORRELATION_ID);
-        assertThat(expectedResult2).containsExactly("corrTest3");
-    }
-
-    @Test
-    public void parseJsonWithEscapeCharacters_Successful() {
-        List<String> expectedResult = JsonUtilForCorrelationId
-                .parseJsonToGelAllCorrelationId(JSON_WITH_TWO_CORRELATION_ID_AND_ESCAPED_CHARACTERS);
-        assertThat(expectedResult).containsExactly("corrTest4", "corrTest5");
-    }
-
-    @Test
-    public void parseJson_emptyListReturnedWhenNothingFound() {
-        List<String> expectedResult = JsonUtilForCorrelationId
-                .parseJsonToGelAllCorrelationId(JSON_WITH_NO_CORRELATION_ID);
-        assertThat(expectedResult).isEmpty();
-    }
-
-}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
new file mode 100644
index 0000000..02a6f20
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2018 Nokia.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.dmaap;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+import org.junit.Test;
+
+public class JsonUtilForPnfCorrelationIdTest {
+
+    private static final String JSON_EXAMPLE_WITH_PNF_CORRELATION_ID = "[{\"pnfCorrelationId\": \"corrTest1\","
+            + "\"key1\":\"value1\"},{\"pnfCorrelationId\": \"corrTest2\",\"key2\":\"value2\"}]";
+
+    private static final String JSON_WITH_ONE_PNF_CORRELATION_ID = "[{\"pnfCorrelationId\":\"corrTest3\"}]";
+
+    private static final String JSON_WITH_TWO_PNF_CORRELATION_ID_AND_ESCAPED_CHARACTERS =
+            "[\"{\\\"pnfCorrelationId\\\":\\\"corrTest4\\\"}\", \"{\\\"pnfCorrelationId\\\":\\\"corrTest5\\\"}\"]";
+
+    private static final String JSON_WITH_NO_PNF_CORRELATION_ID = "[{\"key1\":\"value1\"}]";
+
+    @Test
+    public void parseJsonSuccessful() {
+        List<String> expectedResult = JsonUtilForPnfCorrelationId
+                .parseJsonToGelAllPnfCorrelationId(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID);
+        assertThat(expectedResult).containsExactly("corrTest1", "corrTest2");
+
+        List<String> expectedResult2 = JsonUtilForPnfCorrelationId
+                .parseJsonToGelAllPnfCorrelationId(JSON_WITH_ONE_PNF_CORRELATION_ID);
+        assertThat(expectedResult2).containsExactly("corrTest3");
+    }
+
+    @Test
+    public void parseJsonWithEscapeCharacters_Successful() {
+        List<String> expectedResult = JsonUtilForPnfCorrelationId
+                .parseJsonToGelAllPnfCorrelationId(JSON_WITH_TWO_PNF_CORRELATION_ID_AND_ESCAPED_CHARACTERS);
+        assertThat(expectedResult).containsExactly("corrTest4", "corrTest5");
+    }
+
+    @Test
+    public void parseJson_emptyListReturnedWhenNothingFound() {
+        List<String> expectedResult = JsonUtilForPnfCorrelationId
+                .parseJsonToGelAllPnfCorrelationId(JSON_WITH_NO_PNF_CORRELATION_ID);
+        assertThat(expectedResult).isEmpty();
+    }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
index b30239d..078c2f7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
@@ -56,12 +56,12 @@
 @RunWith(MockitoJUnitRunner.class)
 public class PnfEventReadyDmaapClientTest {
 
-    private static final String CORRELATION_ID = "corrTestId";
-    private static final String CORRELATION_ID_NOT_FOUND_IN_MAP = "otherCorrId";
-    private static final String JSON_EXAMPLE_WITH_CORRELATION_ID = "[{\"correlationId\": \"%s\","
-            + "\"value\":\"value1\"},{\"correlationId\": \"corr\",\"value\":\"value2\"}]";
+    private static final String PNF_CORRELATION_ID = "corrTestId";
+    private static final String PNF_CORRELATION_ID_NOT_FOUND_IN_MAP = "otherCorrId";
+    private static final String JSON_EXAMPLE_WITH_PNF_CORRELATION_ID = "[{\"pnfCorrelationId\": \"%s\","
+            + "\"value\":\"value1\"},{\"pnfCorrelationId\": \"corr\",\"value\":\"value2\"}]";
 
-    private static final String JSON_EXAMPLE_WITH_NO_CORRELATION_ID = "[{\"key1\":\"value1\"}]";
+    private static final String JSON_EXAMPLE_WITH_NO_PNF_CORRELATION_ID = "[{\"key1\":\"value1\"}]";
 
     private static final String HOST = "hostTest";
     private static final int PORT = 1234;
@@ -108,10 +108,10 @@
      * empty) and shutdown the executor because of empty map
      */
     @Test
-    public void correlationIdIsFoundInHttpResponse_notifyAboutPnfReady()
+    public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfReady()
             throws IOException {
         when(httpClientMock.execute(any(HttpGet.class))).
-                thenReturn(createResponse(String.format(JSON_EXAMPLE_WITH_CORRELATION_ID, CORRELATION_ID)));
+                thenReturn(createResponse(String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID, PNF_CORRELATION_ID)));
         testedObjectInnerClassThread.run();
         ArgumentCaptor<HttpGet> captor1 = ArgumentCaptor.forClass(HttpGet.class);
         verify(httpClientMock).execute(captor1.capture());      
@@ -128,16 +128,16 @@
     /**
      * Test run method, where the are following conditions:
      * <p> - DmaapThreadListener is running, flag is set to true
-     * <p> - map is filled with one entry with the correlationId that does not match to correlationId
+     * <p> - map is filled with one entry with the pnfCorrelationId that does not match to pnfCorrelationId
      * taken from http response. run method should not do anything with the map not run any thread to notify camunda
      * process
      */
     @Test
-    public void correlationIdIsFoundInHttpResponse_NotFoundInMap()
+    public void pnfCorrelationIdIsFoundInHttpResponse_NotFoundInMap()
             throws IOException {
         when(httpClientMock.execute(any(HttpGet.class))).
                 thenReturn(createResponse(
-                        String.format(JSON_EXAMPLE_WITH_CORRELATION_ID, CORRELATION_ID_NOT_FOUND_IN_MAP)));
+                        String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID, PNF_CORRELATION_ID_NOT_FOUND_IN_MAP)));
         testedObjectInnerClassThread.run();
         verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock);
     }
@@ -145,13 +145,13 @@
     /**
      * Test run method, where the are following conditions:
      * <p> - DmaapThreadListener is running, flag is set to true
-     * <p> - map is filled with one entry with the correlationId but no correlation id is taken from HttpResponse
+     * <p> - map is filled with one entry with the pnfCorrelationId but no correlation id is taken from HttpResponse
      * run method should not do anything with the map and not run any thread to notify camunda process
      */
     @Test
-    public void correlationIdIsNotFoundInHttpResponse() throws IOException {
+    public void pnfCorrelationIdIsNotFoundInHttpResponse() throws IOException {
         when(httpClientMock.execute(any(HttpGet.class))).
-                thenReturn(createResponse(JSON_EXAMPLE_WITH_NO_CORRELATION_ID));
+                thenReturn(createResponse(JSON_EXAMPLE_WITH_NO_PNF_CORRELATION_ID));
         testedObjectInnerClassThread.run();
         verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock);
     }
@@ -171,7 +171,7 @@
                 .getDeclaredField("pnfCorrelationIdToThreadMap");
         pnfCorrelationToThreadMapField.setAccessible(true);
         Map<String, Runnable> pnfCorrelationToThreadMap = new ConcurrentHashMap<>();
-        pnfCorrelationToThreadMap.put(CORRELATION_ID, threadMockToNotifyCamundaFlow);
+        pnfCorrelationToThreadMap.put(PNF_CORRELATION_ID, threadMockToNotifyCamundaFlow);
         pnfCorrelationToThreadMapField.set(testedObject, pnfCorrelationToThreadMap);
 
         Field threadRunFlag = testedObject.getClass().getDeclaredField("dmaapThreadListenerIsRunning");
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateAndActivatePnfResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateAndActivatePnfResource.bpmn
index 5defe21..8ffa32e 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateAndActivatePnfResource.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateAndActivatePnfResource.bpmn
@@ -5,8 +5,8 @@
     <bpmn:participant id="Participant_0atuyq0" name="AAI" />
     <bpmn:participant id="Participant_19w87ws" name="Workflow Message Service&#10;(communication with DMAAP)&#10;" />
     <bpmn:messageFlow id="MessageFlow_1h3xu88" sourceRef="CreatePnfEntryInAai" targetRef="Participant_0atuyq0" />
-    <bpmn:messageFlow id="MessageFlow_09ibv5a" sourceRef="CheckAiiForCorrelationId" targetRef="Participant_0atuyq0" />
-    <bpmn:messageFlow id="MessageFlow_0vjul4t" sourceRef="Participant_0atuyq0" targetRef="CheckAiiForCorrelationId" />
+    <bpmn:messageFlow id="MessageFlow_09ibv5a" sourceRef="CheckAiiForPnfCorrelationId" targetRef="Participant_0atuyq0" />
+    <bpmn:messageFlow id="MessageFlow_0vjul4t" sourceRef="Participant_0atuyq0" targetRef="CheckAiiForPnfCorrelationId" />
     <bpmn:messageFlow id="MessageFlow_1vrcp2d" sourceRef="Participant_19w87ws" targetRef="WaitForDmaapPnfReadyNotification" />
     <bpmn:messageFlow id="MessageFlow_0tg4hw9" sourceRef="InformDmaapClient" targetRef="Participant_19w87ws" />
     <bpmn:messageFlow id="MessageFlow_1py54jr" sourceRef="CancelDmaapClientSubscription" targetRef="Participant_19w87ws" />
@@ -20,13 +20,13 @@
     <bpmn:sequenceFlow id="SequenceFlow_0p09qgm" sourceRef="WaitForDmaapPnfReadyNotification" targetRef="CreateRelationId" />
     <bpmn:sequenceFlow id="SequenceFlow_17s9025" sourceRef="AaiEntryExists" targetRef="InformDmaapClient" />
     <bpmn:sequenceFlow id="SequenceFlow_1qr6cmf" sourceRef="CreatePnfEntryInAai" targetRef="AaiEntryExists" />
-    <bpmn:sequenceFlow id="SequenceFlow_1j4r3zt" sourceRef="CheckAiiForCorrelationId" targetRef="DoesAaiContainInfoAboutPnf" />
+    <bpmn:sequenceFlow id="SequenceFlow_1j4r3zt" sourceRef="CheckAiiForPnfCorrelationId" targetRef="DoesAaiContainInfoAboutPnf" />
     <bpmn:sequenceFlow id="SequenceFlow_0j5ksz1" sourceRef="CreateAndActivatePnf_StartEvent" targetRef="CheckInputs" />
     <bpmn:sequenceFlow id="SequenceFlow_1miyzfe" sourceRef="CancelDmaapClientSubscription" targetRef="ThrowTimeoutException" />
     <bpmn:sequenceFlow id="SequenceFlow_1l1t6ak" name="Yes" sourceRef="DoesAaiContainInfoAboutPnf" targetRef="AaiEntryExists">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{aaiContainsInfoAboutPnf}</bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_0967g8p" sourceRef="CheckInputs" targetRef="CheckAiiForCorrelationId" />
+    <bpmn:sequenceFlow id="SequenceFlow_0967g8p" sourceRef="CheckInputs" targetRef="CheckAiiForPnfCorrelationId" />
     <bpmn:serviceTask id="CheckInputs" name="Check inputs" camunda:delegateExpression="${PnfCheckInputs}">
       <bpmn:incoming>SequenceFlow_0j5ksz1</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0967g8p</bpmn:outgoing>
@@ -48,7 +48,7 @@
       <bpmn:outgoing>SequenceFlow_1l1t6ak</bpmn:outgoing>
       <bpmn:outgoing>SequenceFlow_0v5ffpe</bpmn:outgoing>
     </bpmn:exclusiveGateway>
-    <bpmn:serviceTask id="CheckAiiForCorrelationId" name="Check AAI for correlation_id" camunda:delegateExpression="${CheckAaiForCorrelationIdDelegate}">
+    <bpmn:serviceTask id="CheckAiiForPnfCorrelationId" name="Check AAI for pnf_correlation_id" camunda:delegateExpression="${CheckAaiForPnfCorrelationIdDelegate}">
       <bpmn:incoming>SequenceFlow_0967g8p</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1j4r3zt</bpmn:outgoing>
     </bpmn:serviceTask>
@@ -86,7 +86,7 @@
     <bpmn:textAnnotation id="TextAnnotation_1eyzes8">
       <bpmn:text><![CDATA[Inputs:
  - timeoutForPnfEntryNotification - String
- - correlationId - String
+ - pnfCorrelationId - String
  - uuid - String]]></bpmn:text>
     </bpmn:textAnnotation>
   </bpmn:process>
@@ -115,7 +115,7 @@
           <dc:Bounds x="-80" y="228" width="90" height="20" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_0a5uk9o_di" bpmnElement="CheckAiiForCorrelationId">
+      <bpmndi:BPMNShape id="ServiceTask_0a5uk9o_di" bpmnElement="CheckAiiForPnfCorrelationId">
         <dc:Bounds x="219" y="167" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0iimk5v_di" bpmnElement="CreatePnfEntryInAai">
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustServiceV2.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustServiceV2.bpmn
index 2dbf127..22b0996 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustServiceV2.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustServiceV2.bpmn
@@ -586,7 +586,7 @@
     <bpmn2:callActivity id="Task_14l19kv" name="Create And Activate Pnf Resource" calledElement="CreateAndActivatePnfResource">
       <bpmn2:extensionElements>
         <camunda:in source="timeoutForPnfEntryNotification" target="timeoutForPnfEntryNotification" />
-        <camunda:in source="correlationId" target="correlationId" />
+        <camunda:in source="pnfCorrelationId" target="pnfCorrelationId" />
         <camunda:in businessKey="#{execution.processBusinessKey}" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_0gj4vud</bpmn2:incoming>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService_simplified.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService_simplified.bpmn
index c8a5cf0..9579f77 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService_simplified.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService_simplified.bpmn
@@ -359,7 +359,7 @@
     <bpmn2:callActivity id="Task_14l19kv" name="Create And Activate Pnf Resource" calledElement="CreateAndActivatePnfResource">
       <bpmn2:extensionElements>
         <camunda:in source="timeoutForPnfEntryNotification" target="timeoutForPnfEntryNotification" />
-        <camunda:in source="correlationId" target="correlationId" />
+        <camunda:in source="pnfCorrelationId" target="pnfCorrelationId" />
         <camunda:in businessKey="#{execution.processBusinessKey}" />
         <camunda:in source="pnfUuid" target="pnfUuid" />
         <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java
index b6bfda1..ea241aa 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java
@@ -41,8 +41,6 @@
 	private String vfModuleInstanceId;
 	@JsonProperty("configurationId")
 	private String configurationId;
-	@JsonProperty("correlationId")
-	private String correlationId;
 	@JsonProperty("instanceGroupId")
 	private String instanceGroupId;
 
@@ -102,14 +100,6 @@
 		this.configurationId = configurationId;
 	}
 
-	public String getCorrelationId() {
-		return correlationId;
-	}
-
-	public void setCorrelationId(String correlationId) {
-		this.correlationId = correlationId;
-	}
-	
 	public String getInstanceGroupId() {
 		return instanceGroupId;
 	}
@@ -128,7 +118,6 @@
 		sb.append(", volumeGroupInstanceId='").append(volumeGroupInstanceId).append('\'');
 		sb.append(", vfModuleInstanceId='").append(vfModuleInstanceId).append('\'');
 		sb.append(", configurationId='").append(configurationId).append('\'');
-		sb.append(", correlationId='").append(correlationId).append('\'');
 		sb.append('}');
 		return sb.toString();
 	}
diff --git a/common/src/test/java/org/onap/so/client/grm/exception/GRMClientCallFailedTest.java b/common/src/test/java/org/onap/so/client/grm/exception/GRMClientCallFailedTest.java
new file mode 100644
index 0000000..989a753
--- /dev/null
+++ b/common/src/test/java/org/onap/so/client/grm/exception/GRMClientCallFailedTest.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 IBM.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.client.grm.exception;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.so.client.grm.exceptions.GRMClientCallFailed;
+
+public class GRMClientCallFailedTest {
+
+    @Test
+    public void testGRMClientCallFailedException() {
+        GRMClientCallFailed gRMClientCallFailed = new GRMClientCallFailed("failed", new Throwable("throwable"));
+        assertEquals("failed", gRMClientCallFailed.getMessage());
+        assertEquals("throwable", gRMClientCallFailed.getCause().getMessage());
+    }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java
index 829f8ce..7e9eed3 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java
@@ -35,7 +35,7 @@
 	CommonConstants.REQUEST_ID_HEADER,
 	CommonConstants.IS_BASE_VF_MODULE_VARIABLE, CommonConstants.RECIPE_TIMEOUT_VARIABLE,
 	CommonConstants.REQUEST_ACTION_VARIABLE, CommonConstants.SERVICE_INSTANCE_ID_VARIABLE,
-	CommonConstants.CORRELATION_ID, CommonConstants.VNF_ID_VARIABLE, CommonConstants.VF_MODULE_ID_VARIABLE,
+	CommonConstants.PNF_CORRELATION_ID, CommonConstants.VNF_ID_VARIABLE, CommonConstants.VF_MODULE_ID_VARIABLE,
 	CommonConstants.VOLUME_GROUP_ID_VARIABLE, CommonConstants.NETWORK_ID_VARIABLE,
 	CommonConstants.CONFIGURATION_ID_VARIABLE, CommonConstants.SERVICE_TYPE_VARIABLE, 
 	CommonConstants.VNF_TYPE_VARIABLE, CommonConstants.VF_MODULE_TYPE_VARIABLE, 
@@ -68,8 +68,8 @@
 	@JsonProperty(CommonConstants.SERVICE_INSTANCE_ID_VARIABLE)
 	private CamundaInput serviceInstanceId;
 
-	@JsonProperty(CommonConstants.CORRELATION_ID)
-	private CamundaInput correlationId;
+	@JsonProperty(CommonConstants.PNF_CORRELATION_ID)
+	private CamundaInput pnfCorrelationId;
 
 	@JsonProperty(CommonConstants.VNF_ID_VARIABLE)
 	private CamundaInput vnfId;
@@ -192,14 +192,14 @@
 		this.serviceInstanceId = serviceInstanceId;
 	}
 
-	@JsonProperty(CommonConstants.CORRELATION_ID)
-	public CamundaInput getCorrelationId() {
-		return correlationId;
+	@JsonProperty(CommonConstants.PNF_CORRELATION_ID)
+	public CamundaInput getPnfCorrelationId() {
+		return pnfCorrelationId;
 	}
 
-	@JsonProperty(CommonConstants.CORRELATION_ID)
-	public void setCorrelationId(CamundaInput correlationId) {
-		this.correlationId = correlationId;
+	@JsonProperty(CommonConstants.PNF_CORRELATION_ID)
+	public void setPnfCorrelationId(CamundaInput pnfCorrelationId) {
+		this.pnfCorrelationId = pnfCorrelationId;
 	}
 
 	@JsonProperty(CommonConstants.VNF_ID_VARIABLE)
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java
index 34cfe18..0ca85f0 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java
@@ -128,7 +128,7 @@
 		HttpPost post = new HttpPost(url);
 		msoLogger.debug(CAMUNDA_URL_MESAGE+ url);
 		String jsonReq = wrapVIDRequest(parameterObject.getRequestId(), parameterObject.isBaseVfModule(), parameterObject.getRecipeTimeout(), parameterObject.getRequestAction(),
-				parameterObject.getServiceInstanceId(), parameterObject.getCorrelationId(), parameterObject.getVnfId(), parameterObject.getVfModuleId(), parameterObject.getVolumeGroupId(), parameterObject.getNetworkId(), parameterObject.getConfigurationId(),
+				parameterObject.getServiceInstanceId(), parameterObject.getPnfCorrelationId(), parameterObject.getVnfId(), parameterObject.getVfModuleId(), parameterObject.getVolumeGroupId(), parameterObject.getNetworkId(), parameterObject.getConfigurationId(),
 				parameterObject.getServiceType(), parameterObject.getVnfType(), parameterObject.getVfModuleType(), parameterObject.getNetworkType(), parameterObject.getRequestDetails(), parameterObject.getApiVersion(), parameterObject.isaLaCarte(), parameterObject.getRequestUri(), parameterObject.getRecipeParamXsd(),
 				parameterObject.getInstanceGroupId());
 
@@ -198,7 +198,7 @@
 	
 
 	protected String wrapVIDRequest(String requestId, boolean isBaseVfModule,
-			int recipeTimeout, String requestAction, String serviceInstanceId, String correlationId,
+			int recipeTimeout, String requestAction, String serviceInstanceId, String pnfCorrelationId,
 			String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
 			String serviceType, String vnfType, String vfModuleType, String networkType,
 			String requestDetails, String apiVersion, boolean aLaCarte, String requestUri, String paramXsd,
@@ -214,7 +214,7 @@
 			CamundaIntegerInput recipeTimeoutInput = new CamundaIntegerInput();
 			CamundaInput requestActionInput = new CamundaInput();
 			CamundaInput serviceInstanceIdInput = new CamundaInput();
-			CamundaInput correlationIdInput = new CamundaInput();
+			CamundaInput pnfCorrelationIdInput = new CamundaInput();
 			CamundaInput vnfIdInput = new CamundaInput();
 			CamundaInput vfModuleIdInput = new CamundaInput();
 			CamundaInput volumeGroupIdInput = new CamundaInput();
@@ -236,7 +236,7 @@
 			recipeTimeoutInput.setValue(recipeTimeout);
 			requestActionInput.setValue(StringUtils.defaultString(requestAction));
 			serviceInstanceIdInput.setValue(StringUtils.defaultString(serviceInstanceId));
-			correlationIdInput.setValue(StringUtils.defaultString(correlationId));
+			pnfCorrelationIdInput.setValue(StringUtils.defaultString(pnfCorrelationId));
 			vnfIdInput.setValue(StringUtils.defaultString(vnfId));
 			vfModuleIdInput.setValue(StringUtils.defaultString(vfModuleId));
 			volumeGroupIdInput.setValue(StringUtils.defaultString(volumeGroupId));
@@ -261,7 +261,7 @@
 			camundaRequest.setRecipeTimeout(recipeTimeoutInput);
 			camundaRequest.setRequestAction(requestActionInput);
 			camundaRequest.setServiceInstanceId(serviceInstanceIdInput);
-			camundaRequest.setCorrelationId(correlationIdInput);
+			camundaRequest.setPnfCorrelationId(pnfCorrelationIdInput);
 			camundaRequest.setVnfId(vnfIdInput);
 			camundaRequest.setVfModuleId(vfModuleIdInput);
 			camundaRequest.setVolumeGroupId(volumeGroupIdInput);
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
index b75ad9e..24fb0e0 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
@@ -54,7 +54,7 @@
 	public static final String RECIPE_TIMEOUT_VARIABLE = "recipeTimeout";
 	public static final String REQUEST_ACTION_VARIABLE = "requestAction";
 	public static final String SERVICE_INSTANCE_ID_VARIABLE = "serviceInstanceId";
-	public static final String CORRELATION_ID = "correlationId";
+	public static final String PNF_CORRELATION_ID = "pnfCorrelationId";
 	public static final String VNF_ID_VARIABLE = "vnfId";
 	public static final String VF_MODULE_ID_VARIABLE = "vfModuleId";
 	public static final String VOLUME_GROUP_ID_VARIABLE = "volumeGroupId";
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java
index 1d18e2b..209f337 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java
@@ -28,7 +28,7 @@
     private int recipeTimeout;
     private String requestAction;
     private String serviceInstanceId;
-    private String correlationId;
+    private String pnfCorrelationId;
     private String vnfId;
     private String vfModuleId;
     private String volumeGroupId;
@@ -51,7 +51,7 @@
         recipeTimeout = builder.recipeTimeout;
         requestAction = builder.requestAction;
         serviceInstanceId = builder.serviceInstanceId;
-        correlationId = builder.correlationId;
+        pnfCorrelationId = builder.pnfCorrelationId;
         vnfId = builder.vnfId;
         vfModuleId = builder.vfModuleId;
         volumeGroupId = builder.volumeGroupId;
@@ -90,8 +90,8 @@
         return serviceInstanceId;
     }
 
-    public String getCorrelationId() {
-        return correlationId;
+    public String getPnfCorrelationId() {
+        return pnfCorrelationId;
     }
 
     public String getVnfId() {
@@ -160,7 +160,7 @@
         private int recipeTimeout;
         private String requestAction;
         private String serviceInstanceId;
-        private String correlationId;
+        private String pnfCorrelationId;
         private String vnfId;
         private String vfModuleId;
         private String volumeGroupId;
@@ -202,8 +202,8 @@
             return this;
         }
 
-        public Builder setCorrelationId(String correlationId) {
-            this.correlationId = correlationId;
+        public Builder setPnfCorrelationId(String pnfCorrelationId) {
+            this.pnfCorrelationId = pnfCorrelationId;
             return this;
         }
 
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
index 7a03ce0..0958905 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
@@ -148,7 +148,7 @@
     	int recipeTimeout = 10000;
     	String requestAction = "createInstance";
     	String serviceInstanceId = "12345679";
-    	String correlationId = "12345679";
+    	String pnfCorrelationId = "12345679";
     	String vnfId = "234567891";
     	String vfModuleId = "345678912";
     	String volumeGroupId = "456789123";
@@ -164,7 +164,7 @@
     	String requestUri = "v7/serviceInstances/assign";
     	String instanceGroupId = "ff305d54-75b4-431b-adb2-eb6b9e5ff000";
     	
-    	String testResult = testClient.wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction, serviceInstanceId, correlationId,
+    	String testResult = testClient.wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction, serviceInstanceId, pnfCorrelationId,
     						vnfId, vfModuleId, volumeGroupId, networkId, configurationId, serviceType, 
     						vnfType, vfModuleType, networkType, requestDetails, apiVersion, aLaCarte, requestUri, "", instanceGroupId);
     	String expected = inputStream("/WrappedVIDRequest.json");
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json
index 4c716c2..b9d0a8c 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json
+++ b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json
@@ -1 +1 @@
-{"variables":{"bpmnRequest":{"value":"{requestDetails: }","type":"String"},"requestId":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"mso-request-id":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"isBaseVfModule":{"value":true,"type":"Boolean"},"recipeTimeout":{"value":10000,"type":"Integer"},"requestAction":{"value":"createInstance","type":"String"},"serviceInstanceId":{"value":"12345679","type":"String"},"correlationId":{"value":"12345679","type":"String"},"vnfId":{"value":"234567891","type":"String"},"vfModuleId":{"value":"345678912","type":"String"},"volumeGroupId":{"value":"456789123","type":"String"},"networkId":{"value":"567891234","type":"String"},"configurationId":{"value":"678912345","type":"String"},"serviceType":{"value":"testService","type":"String"},"vnfType":{"value":"testVnf","type":"String"},"vfModuleType":{"value":"vfModuleType","type":"String"},"networkType":{"value":"networkType","type":"String"},"recipeParams":{"value":"","type":"String"},"host":{"value":null,"type":"String"},"apiVersion":{"value":"6","type":"String"},"aLaCarte":{"value":true,"type":"Boolean"},"requestUri":{"value":"v7/serviceInstances/assign","type":"String"},"instanceGroupId":{"value":"ff305d54-75b4-431b-adb2-eb6b9e5ff000","type":"String"}}}
\ No newline at end of file
+{"variables":{"bpmnRequest":{"value":"{requestDetails: }","type":"String"},"requestId":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"mso-request-id":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"isBaseVfModule":{"value":true,"type":"Boolean"},"recipeTimeout":{"value":10000,"type":"Integer"},"requestAction":{"value":"createInstance","type":"String"},"serviceInstanceId":{"value":"12345679","type":"String"},"pnfCorrelationId":{"value":"12345679","type":"String"},"vnfId":{"value":"234567891","type":"String"},"vfModuleId":{"value":"345678912","type":"String"},"volumeGroupId":{"value":"456789123","type":"String"},"networkId":{"value":"567891234","type":"String"},"configurationId":{"value":"678912345","type":"String"},"serviceType":{"value":"testService","type":"String"},"vnfType":{"value":"testVnf","type":"String"},"vfModuleType":{"value":"vfModuleType","type":"String"},"networkType":{"value":"networkType","type":"String"},"recipeParams":{"value":"","type":"String"},"host":{"value":null,"type":"String"},"apiVersion":{"value":"6","type":"String"},"aLaCarte":{"value":true,"type":"Boolean"},"requestUri":{"value":"v7/serviceInstances/assign","type":"String"},"instanceGroupId":{"value":"ff305d54-75b4-431b-adb2-eb6b9e5ff000","type":"String"}}}
\ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
index e3b218b..a473b09 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
@@ -809,7 +809,7 @@
 		String vfModuleId = "";
 		String volumeGroupId = "";
 		String networkId = "";
-		String correlationId = "";
+		String pnfCorrelationId = "";
 		String instanceGroupId = null;
 		if(sir.getServiceInstanceId () != null){
 			serviceInstanceId = sir.getServiceInstanceId ();
@@ -834,7 +834,7 @@
 			instanceGroupId = sir.getInstanceGroupId();
 		}
 
-        correlationId = getCorrelationId(sir);
+        pnfCorrelationId = getPnfCorrelationId(sir);
 
         try{
             infraActiveRequestsClient.save(currentActiveReq);
@@ -858,7 +858,7 @@
 						.setRecipeTimeout(recipeLookupResult.getRecipeTimeout())
 						.setRequestAction(action.toString())
 						.setServiceInstanceId(serviceInstanceId)
-						.setCorrelationId(correlationId)
+						.setPnfCorrelationId(pnfCorrelationId)
 						.setVnfId(vnfId)
 						.setVfModuleId(vfModuleId)
 						.setVolumeGroupId(volumeGroupId)
@@ -944,7 +944,7 @@
 		return postBPELRequest(currentActiveReq, requestClientParameter, recipeLookupResult.getOrchestrationURI(), requestScope);
 	}
 
-	private String getCorrelationId(ServiceInstancesRequest sir) {
+	private String getPnfCorrelationId(ServiceInstancesRequest sir) {
 		return Optional.of(sir)
 				.map(ServiceInstancesRequest::getRequestDetails)
 				.map(RequestDetails::getRequestParameters)
@@ -1860,7 +1860,7 @@
 		
 		serviceInstanceId = "";
 		String configurationId = "";
-		String correlationId = "";
+		String pnfCorrelationId = "";
 
 		if(sir.getServiceInstanceId () != null){
 			serviceInstanceId = sir.getServiceInstanceId ();
@@ -1870,7 +1870,7 @@
             configurationId = sir.getConfigurationId();
         }
 
-        correlationId = getCorrelationId(sir);
+        pnfCorrelationId = getPnfCorrelationId(sir);
 
 		try{
 			infraActiveRequestsClient.save(currentActiveReq);
@@ -1893,7 +1893,7 @@
 				.setRecipeTimeout(Integer.parseInt(timeOut))
 				.setRequestAction(action.toString())
 				.setServiceInstanceId(serviceInstanceId)
-				.setCorrelationId(correlationId)
+				.setPnfCorrelationId(pnfCorrelationId)
 				.setConfigurationId(configurationId)
 				.setRequestDetails(mapJSONtoMSOStyle(requestJSON, sir, aLaCarte, action))
 				.setApiVersion(apiVersion)
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/exceptions/AAIClientCallFailedTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/exceptions/AAIClientCallFailedTest.java
new file mode 100644
index 0000000..2cb02e9
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/exceptions/AAIClientCallFailedTest.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 IBM.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.apihandlerinfra.tenantisolation.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.so.apihandlerinfra.BaseTest;
+
+public class AAIClientCallFailedTest extends BaseTest {
+
+    @Test
+    public void testAAIClientCallFailedException() {
+        AAIClientCallFailed aAIClientCallFailed = new AAIClientCallFailed("failed", new Throwable("throwable"));
+        assertEquals("failed", aAIClientCallFailed.getMessage());
+        assertEquals("throwable", aAIClientCallFailed.getCause().getMessage());
+    }
+}
diff --git a/so-monitoring/so-monitoring-service/src/test/resources/camundaResponses/processInstanceVariables.json b/so-monitoring/so-monitoring-service/src/test/resources/camundaResponses/processInstanceVariables.json
index 15c87ea..7762da7 100644
--- a/so-monitoring/so-monitoring-service/src/test/resources/camundaResponses/processInstanceVariables.json
+++ b/so-monitoring/so-monitoring-service/src/test/resources/camundaResponses/processInstanceVariables.json
@@ -287,7 +287,7 @@
     },
     {
         "type": "String",
-        "value": "{\"requestDetails\":{\"modelInfo\":{\"modelInvariantUuid\":\"8e2be9fa-fffb-4e23-89a5-65497709f507\",\"modelType\":\"service\",\"modelName\":\"PNFSERVICE\",\"modelVersion\":\"1.0\",\"modelUuid\":\"4f7afc34-e475-41ca-be73-40f9a0f7ffa4\"},\"requestInfo\":{\"productFamilyId\":\"c8d92bf2-2c2e-4802-94e0-3f9e0825cc08\",\"source\":\"UUI\",\"instanceName\":\"AFRPOSTMAN51\",\"suppressRollback\":false,\"requestorId\":\"demo\"},\"subscriberInfo\":{\"globalSubscriberId\":\"Demonstration\"},\"cloudConfiguration\":{\"tenantId\":\"3e001881bcb342418ab5f2788a73255d\",\"lcpCloudRegionId\":\"regionOne_aaa_bbb\"},\"requestParameters\":{\"alaCarte\":false,\"subscriptionServiceType\":\"vCPE\",\"userParams\":[{\"name\":\"Homing_Solution\",\"value\":\"dummy\"}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-Demonstration\"},\"owningEntity\":{\"owningEntityId\":\"c77274d4-4881-493a-ad46-368ea0996eb3\",\"owningEntityName\":\"OE-Demonstration\"}},\"correlationId\":\"afr\"}",
+        "value": "{\"requestDetails\":{\"modelInfo\":{\"modelInvariantUuid\":\"8e2be9fa-fffb-4e23-89a5-65497709f507\",\"modelType\":\"service\",\"modelName\":\"PNFSERVICE\",\"modelVersion\":\"1.0\",\"modelUuid\":\"4f7afc34-e475-41ca-be73-40f9a0f7ffa4\"},\"requestInfo\":{\"productFamilyId\":\"c8d92bf2-2c2e-4802-94e0-3f9e0825cc08\",\"source\":\"UUI\",\"instanceName\":\"AFRPOSTMAN51\",\"suppressRollback\":false,\"requestorId\":\"demo\"},\"subscriberInfo\":{\"globalSubscriberId\":\"Demonstration\"},\"cloudConfiguration\":{\"tenantId\":\"3e001881bcb342418ab5f2788a73255d\",\"lcpCloudRegionId\":\"regionOne_aaa_bbb\"},\"requestParameters\":{\"alaCarte\":false,\"subscriptionServiceType\":\"vCPE\",\"userParams\":[{\"name\":\"Homing_Solution\",\"value\":\"dummy\"}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-Demonstration\"},\"owningEntity\":{\"owningEntityId\":\"c77274d4-4881-493a-ad46-368ea0996eb3\",\"owningEntityName\":\"OE-Demonstration\"}},\"pnfCorrelationId\":\"afr\"}",
         "valueInfo": {
             
         },
@@ -314,7 +314,7 @@
             
         },
         "id": "595745ec-9736-11e8-8caf-022ac9304eeb",
-        "name": "correlationId",
+        "name": "pnfCorrelationId",
         "processDefinitionKey": "AFRFLOW",
         "processDefinitionId": "AFRFLOW:1:c6eea1b7-9722-11e8-8caf-022ac9304eeb",
         "processInstanceId": "5956a99d-9736-11e8-8caf-022ac9304eeb",
@@ -4203,7 +4203,7 @@
     },
     {
         "type": "String",
-        "value": "{\"requestDetails\":{\"modelInfo\":{\"modelInvariantUuid\":\"8e2be9fa-fffb-4e23-89a5-65497709f507\",\"modelType\":\"service\",\"modelName\":\"PNFSERVICE\",\"modelVersion\":\"1.0\",\"modelUuid\":\"4f7afc34-e475-41ca-be73-40f9a0f7ffa4\"},\"requestInfo\":{\"productFamilyId\":\"c8d92bf2-2c2e-4802-94e0-3f9e0825cc08\",\"source\":\"UUI\",\"instanceName\":\"AFRPOSTMAN51\",\"suppressRollback\":false,\"requestorId\":\"demo\"},\"subscriberInfo\":{\"globalSubscriberId\":\"Demonstration\"},\"cloudConfiguration\":{\"tenantId\":\"3e001881bcb342418ab5f2788a73255d\",\"lcpCloudRegionId\":\"regionOne_aaa_bbb\"},\"requestParameters\":{\"alaCarte\":false,\"subscriptionServiceType\":\"vCPE\",\"userParams\":[{\"name\":\"Homing_Solution\",\"value\":\"dummy\"}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-Demonstration\"},\"owningEntity\":{\"owningEntityId\":\"c77274d4-4881-493a-ad46-368ea0996eb3\",\"owningEntityName\":\"OE-Demonstration\"}},\"correlationId\":\"afr\"}",
+        "value": "{\"requestDetails\":{\"modelInfo\":{\"modelInvariantUuid\":\"8e2be9fa-fffb-4e23-89a5-65497709f507\",\"modelType\":\"service\",\"modelName\":\"PNFSERVICE\",\"modelVersion\":\"1.0\",\"modelUuid\":\"4f7afc34-e475-41ca-be73-40f9a0f7ffa4\"},\"requestInfo\":{\"productFamilyId\":\"c8d92bf2-2c2e-4802-94e0-3f9e0825cc08\",\"source\":\"UUI\",\"instanceName\":\"AFRPOSTMAN51\",\"suppressRollback\":false,\"requestorId\":\"demo\"},\"subscriberInfo\":{\"globalSubscriberId\":\"Demonstration\"},\"cloudConfiguration\":{\"tenantId\":\"3e001881bcb342418ab5f2788a73255d\",\"lcpCloudRegionId\":\"regionOne_aaa_bbb\"},\"requestParameters\":{\"alaCarte\":false,\"subscriptionServiceType\":\"vCPE\",\"userParams\":[{\"name\":\"Homing_Solution\",\"value\":\"dummy\"}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-Demonstration\"},\"owningEntity\":{\"owningEntityId\":\"c77274d4-4881-493a-ad46-368ea0996eb3\",\"owningEntityName\":\"OE-Demonstration\"}},\"pnfCorrelationId\":\"afr\"}",
         "valueInfo": {
             
         },
