diff options
author | r.bogacki <r.bogacki@samsung.com> | 2019-03-13 14:05:22 +0100 |
---|---|---|
committer | Robert Bogacki <r.bogacki@samsung.com> | 2019-03-14 06:56:02 +0000 |
commit | 2a1c1ccabf1d8d681870578f54ae66455fadf9e7 (patch) | |
tree | 190af79b6f7254b7bdd8423e54a1429dd78094ab | |
parent | 4bbd2d022b31509ba01a0518fc76fb26d91d5dac (diff) |
Reduced content of MsoLogger
Cleaned java code dependencies for
'setLogContext' and 'getServiceName'
methods from MsoLogger.
Fixed imports.
Change-Id: I33251c837088ce580ffa1c44e69766c77283004b
Issue-ID: LOG-631
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
20 files changed, 76 insertions, 138 deletions
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 25d8e564da..d0ffa27027 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 @@ -126,9 +126,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - String error; - MsoLogger.setLogContext (msoRequest); logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); // Use the synchronous method to perform the actual Create @@ -252,7 +250,6 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { MsoRequest msoRequest, String notificationUrl) { - MsoLogger.setLogContext (msoRequest); logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId); // Use the synchronous method to perform the actual Create @@ -342,9 +339,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - String error; - MsoLogger.setLogContext (msoRequest); logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId); String errorCreateNetworkMessage = "{} {} Error sending createNetwork notification {} "; @@ -440,8 +435,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - String error; - MsoLogger.setLogContext (msoRequest); + String serviceName = "DeleteNetworkA"; logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId); @@ -507,7 +501,6 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { return; } - MsoLogger.setLogContext (rollback.getMsoRequest ()); logger.info("{} {}", MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId()); // Use the synchronous method to perform the actual Create 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 bcb6b1be42..fc2fc4844b 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 @@ -266,7 +266,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { Holder <String> networkFqdn, Holder <Map <String, String>> subnetIdMap, Holder <NetworkRollback> rollback) throws NetworkException { - MsoLogger.setLogContext (msoRequest); logger.debug("*** CREATE Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); // Will capture execution time for metrics @@ -712,7 +711,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { MsoRequest msoRequest, Holder <Map <String, String>> subnetIdMap, Holder <NetworkRollback> rollback) throws NetworkException { - MsoLogger.setLogContext (msoRequest); + logger.debug("***UPDATE Network adapter with Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); @@ -1147,7 +1146,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { Holder <List <Integer>> vlans, Holder <List <RouteTarget>> routeTargets, Holder <Map <String, String>> subnetIdMap) throws NetworkException { - MsoLogger.setLogContext (msoRequest); + logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId); // Will capture execution time for metrics @@ -1285,7 +1284,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { String networkId, MsoRequest msoRequest, Holder <Boolean> networkDeleted) throws NetworkException { - MsoLogger.setLogContext (msoRequest); + logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId); // Will capture execution time for metrics @@ -1386,8 +1385,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { return; } - MsoLogger.setLogContext (rollback.getMsoRequest()); - // Get the elements of the VnfRollback object for easier access String cloudSiteId = rollback.getCloudId (); String tenantId = rollback.getTenantId (); 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 a937bd9499..f46a95df91 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 @@ -88,7 +88,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter { MsoRequest msoRequest, Holder <String> tenantId, Holder <TenantRollback> rollback) throws TenantException { - MsoLogger.setLogContext (msoRequest); logger.debug("Call to MSO createTenant adapter. Creating Tenant: {} in {}", tenantName, cloudSiteId); @@ -152,7 +151,7 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter { Holder <String> tenantId, Holder <String> tenantName, Holder <Map <String, String>> metadata) throws TenantException { - MsoLogger.setLogContext (msoRequest); + logger.debug ("Querying Tenant {} in {}", tenantNameOrId, cloudSiteId); MsoTenantUtils tUtils; @@ -196,7 +195,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter { String tenantId, MsoRequest msoRequest, Holder <Boolean> tenantDeleted) throws TenantException { - MsoLogger.setLogContext (msoRequest); logger.debug ("Deleting Tenant {} in {}", tenantId, cloudSiteId); @@ -238,7 +236,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter { String cloudSiteId = rollback.getCloudId (); String tenantId = rollback.getTenantId (); - MsoLogger.setLogContext (rollback.getMsoRequest ()); logger.debug("Rolling Back Tenant {} in {}", rollback.getTenantId(), cloudSiteId); if (rollback.getTenantCreated ()) { 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 b445dc8a26..cf52280b3f 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 @@ -132,7 +132,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - MsoLogger.setLogContext (msoRequest); + logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF); // Use the synchronous method to perform the actual Create MsoVnfAdapter vnfAdapter = vnfImpl; @@ -213,7 +213,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - MsoLogger.setLogContext (msoRequest); + logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF); // Use the synchronous method to perform the actual Create @@ -289,9 +289,8 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - String error; + String serviceName = "QueryVnfA"; - MsoLogger.setLogContext (msoRequest); logger.info("{}", MessageEnum.RA_ASYNC_QUERY_VNF); // Use the synchronous method to perform the actual query @@ -376,9 +375,8 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { String messageId, MsoRequest msoRequest, String notificationUrl) { - String error; + String serviceName = "DeleteVnfA"; - MsoLogger.setLogContext (msoRequest); logger.info("{}", MessageEnum.RA_ASYNC_DELETE_VNF); // Use the synchronous method to perform the actual delete @@ -441,7 +439,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { return; } - MsoLogger.setLogContext (rollback.getMsoRequest ()); logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF); // Use the synchronous method to perform the actual rollback diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index a1d7698ad1..4d915f9e84 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -302,7 +302,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { Holder <String> vnfId, Holder <VnfStatus> status, Holder <Map <String, String>> outputs) throws VnfException { - MsoLogger.setLogContext (msoRequest); + logger.debug("Querying VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId); // Will capture execution time for metrics @@ -361,7 +361,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String tenantId, String vnfName, MsoRequest msoRequest) throws VnfException { - MsoLogger.setLogContext (msoRequest); + logger.debug("Deleting VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId); // Will capture execution time for metrics long startTime = System.currentTimeMillis (); @@ -409,15 +409,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String tenantId = rollback.getTenantId (); String vnfId = rollback.getVnfId (); - MsoLogger.setLogContext (rollback.getMsoRequest()); - logger.debug("Rolling Back VNF {} in {}", vnfId, cloudSiteId + "/" + tenantId); // Use the MsoHeatUtils to delete the stack. Set the polling flag to true. // The possible outcomes of deleteStack are a StackInfo object with status // of NOTFOUND (on success) or FAILED (on error). Also, MsoOpenstackException // could be thrown. - long subStartTime = System.currentTimeMillis (); try { heat.deleteStack (tenantId, cloudSiteId, vnfId, true); } catch (MsoException me) { @@ -600,7 +597,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { useMCUuid = true; } } - MsoLogger.setLogContext (msoRequest); + String requestTypeString = ""; if (requestType != null && !"".equals(requestType)) { requestTypeString = requestType; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index bba960cddf..833e200ce9 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -206,7 +206,6 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { Holder <Map <String, String>> outputs) throws VnfException { - MsoLogger.setLogContext (msoRequest); logger.debug ("Querying VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId); // Will capture execution time for metrics @@ -264,7 +263,6 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { String tenantId, String vnfName, MsoRequest msoRequest) throws VnfException { - MsoLogger.setLogContext (msoRequest); // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. logger.debug("DeleteVNF command attempted but not supported"); @@ -285,8 +283,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { long startTime = System.currentTimeMillis (); // rollback may be null (e.g. if stack already existed when Create was called) if (rollback == null) { - logger.info ("{} {} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf", MsoLogger - .getServiceName()); + logger.info ("{} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf"); return; } @@ -300,8 +297,6 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { String tenantId = rollback.getTenantId (); String vfModuleId = rollback.getVfModuleStackId (); - MsoLogger.setLogContext (rollback.getMsoRequest()); - logger.debug("Rolling Back VF Module {} in {}", vfModuleId, cloudSiteId + "/" + tenantId); DeploymentInfo deployment = null; @@ -576,8 +571,6 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { // Will capture execution time for metrics long startTime = System.currentTimeMillis (); - MsoLogger.setLogContext (msoRequest); - // Require a model customization ID. Every VF Module definition must have one. if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) { logger.debug("Missing required input: modelCustomizationUuid"); @@ -1179,7 +1172,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { String vnfName, MsoRequest msoRequest, Holder <Map <String, String>> outputs) throws VnfException { - MsoLogger.setLogContext (msoRequest); + logger.debug ("Deleting VF " + vnfName + " in " + cloudSiteId + "/" + tenantId); // Will capture execution time for metrics long startTime = System.currentTimeMillis (); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index 704d54c918..b1b97b695e 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -225,7 +225,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { Holder <Map <String, String>> outputs) throws VnfException { - MsoLogger.setLogContext (msoRequest); logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId); // Will capture execution time for metrics @@ -281,7 +280,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { String tenantId, String vnfName, MsoRequest msoRequest) throws VnfException { - MsoLogger.setLogContext (msoRequest); // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. logger.debug("DeleteVNF command attempted but not supported"); @@ -302,8 +300,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { long startTime = System.currentTimeMillis (); // rollback may be null (e.g. if stack already existed when Create was called) if (rollback == null) { - logger.info("{} {} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf", - MsoLogger.getServiceName()); + logger.info("{} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf"); return; } @@ -319,8 +316,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { String vfModuleId = rollback.getVfModuleStackId (); - MsoLogger.setLogContext (rollback.getMsoRequest()); - logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId); VduInstance vduInstance = null; @@ -618,8 +613,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { // Will capture execution time for metrics long startTime = System.currentTimeMillis (); - MsoLogger.setLogContext (msoRequest); - // Require a model customization ID. Every VF Module definition must have one. if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) { logger.debug("Missing required input: modelCustomizationUuid"); @@ -1165,7 +1158,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { MsoRequest msoRequest, Holder <Map <String, String>> outputs) throws VnfException { - MsoLogger.setLogContext (msoRequest); logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId); // Will capture execution time for metrics diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java index db7f1da10f..61f92313f7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java @@ -131,7 +131,7 @@ public class WorkflowContextHolder { Thread.currentThread().interrupt(); } catch (Exception e) { logger.debug("WorkflowContextHolder timeout thread caught exception: ", e); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), "Error in WorkflowContextHolder timeout thread"); } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java index d43218c584..916d24e8dc 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java @@ -54,8 +54,8 @@ public class ExceptionBuilder { } } - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg.toString()); + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), msg.toString()); execution.setVariable(errorVariable, exception.getMessage()); } catch (Exception ex){ //log trace, allow process to complete gracefully @@ -83,8 +83,8 @@ public class ExceptionBuilder { break; } } - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg.toString()); + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), msg.toString()); execution.setVariable(errorVariable, exception.getMessage()); } catch (Exception ex){ //log trace, allow process to complete gracefully diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java index f4617f9978..4ab22f4616 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java @@ -220,7 +220,7 @@ public class CallbackHandlerService { + " = '" + correlationValue + "'; last exception was:" + queryException; logger.debug(msg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), msg, queryException); } @@ -263,8 +263,8 @@ public class CallbackHandlerService { + " with " + correlationVariable + " = '" + correlationValue + "': " + ole; logger.debug(msg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, ole); + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -", + MsoLogger.ErrorCode.UnknownError.getValue(), msg, ole); //Retry for OptimisticLocking Exceptions int retryCount = 0; @@ -296,14 +296,14 @@ public class CallbackHandlerService { //oleFlag = ex instanceof org.camunda.bpm.engine.OptimisticLockingException; String strMsg = "Received exception, OptimisticLockingException retry failed, retryCount:" + retryCount + " | exception returned: " + olex; logger.debug(strMsg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), strMsg, olex); } catch (Exception excep) { retryCount = 0; //oleFlag = ex instanceof org.camunda.bpm.engine.OptimisticLockingException; String strMsg = "Received exception, OptimisticLockingException retry failed, retryCount:" + retryCount + " | exception returned: " + excep; logger.debug(strMsg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), strMsg, excep); } @@ -317,7 +317,7 @@ public class CallbackHandlerService { + " with " + correlationVariable + " = '" + correlationValue + "': " + e; logger.debug(msg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), msg, e); } } catch (Exception e) { @@ -327,8 +327,8 @@ public class CallbackHandlerService { + " with " + correlationVariable + " = '" + correlationValue + "': " + e; logger.debug(msg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, e); + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -", + MsoLogger.ErrorCode.UnknownError.getValue(), msg, e); } return true; @@ -363,10 +363,10 @@ public class CallbackHandlerService { */ protected void logCallbackError(String method, long startTime, String msg, Exception e) { if (e == null) { - logger.error("{} {} {} {} {}", MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), msg); } else { - logger.error("{} {} {} {} {}", MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), msg, e); } } diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java index 072dec28c6..a5af553e1c 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java @@ -90,7 +90,7 @@ public class WorkflowMessageResource{ if (messageType == null || messageType.isEmpty()) { String msg = "Missing message type"; logger.debug(LOGMARKER + " " + msg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.DataError.getValue(), LOGMARKER + ":" + msg); return Response.status(400).entity(msg).build(); } @@ -98,7 +98,7 @@ public class WorkflowMessageResource{ if (correlator == null || correlator.isEmpty()) { String msg = "Missing correlator"; logger.debug(LOGMARKER + " " + msg); - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.ErrorCode.DataError.getValue(), LOGMARKER + ":" + msg); return Response.status(400).entity(msg).build(); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java index 5534a39685..8dd55d9eac 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java @@ -120,8 +120,8 @@ public class AAICreateTasks { if (null == customer) { String errorMessage = "Exception in creating ServiceSubscription. Customer not present for ServiceInstanceID: " + serviceInstance.getServiceInstanceId(); - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), errorMessage, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), errorMessage); + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), errorMessage, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), errorMessage); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage); } aaiSIResources.createServiceSubscription(customer); @@ -165,14 +165,14 @@ public class AAICreateTasks { } else { if (owningEntityName == null || "".equals(owningEntityName)) { String msg = "Exception in AAICreateOwningEntity. Can't create an owningEntity with no owningEntityName."; - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg); + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), msg); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg); } else { if(aaiSIResources.existsOwningEntityName(owningEntityName)){ String msg = "Exception in AAICreateOwningEntity. Can't create OwningEntity as name already exists in AAI associated with a different owning-entity-id (name must be unique)"; - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg); + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), msg); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg); }else{ aaiSIResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java index 1402cebfbc..dc8f72c7a5 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java @@ -135,8 +135,8 @@ public class ExecuteActivity implements JavaDelegate { } protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) { - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, ex); + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), msg, ex); execution.setVariable("ExecuteActivityErrorMessage", msg); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java index e0516ce9af..5ed84e006a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java @@ -134,8 +134,8 @@ public class AppcRunTasks { mapRollbackVariables(execution, action, appcCode); } catch (Exception e) { - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), - "Caught exception in runAppcCommand", "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), + "Caught exception in runAppcCommand", "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); appcMessage = e.getMessage(); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java index ba04b16b14..6c0cdb39f6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java @@ -153,9 +153,9 @@ public class ConfigurationScaleOut { appcMessage = appCClient.getErrorMessage(); } catch (Exception e) { - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "Caught exception in runAppcCommand in ConfigurationScaleOut", "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); + MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); appcMessage = e.getMessage(); } logger.error("Error Message: " + appcMessage); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java index bb33b521d6..feb9fb81b4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java @@ -110,23 +110,22 @@ public class GenericVnfHealthCheck { appcCode = appCClient.getErrorCode(); appcMessage = appCClient.getErrorMessage(); } catch (BpmnError ex) { - logger.error("", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Caught exception in GenericVnfHealthCheck", "BPMN", - MsoLogger - .getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), ex); - appcMessage = ex.getMessage(); + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), + "Caught exception in GenericVnfHealthCheck", "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), ex); + appcMessage = ex.getMessage(); exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } catch (Exception e) { if (e instanceof java.util.concurrent.TimeoutException ) { appcMessage = "Request to APPC timed out. "; - logger.error("{} {} {} {} {} {}", MessageEnum.RA_CONNECTION_EXCEPTION.toString(), + logger.error("{} {} {} {} {}", MessageEnum.RA_CONNECTION_EXCEPTION.toString(), "Caught timedOut exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); + MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); throw e; } else { - logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), - "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), + "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); appcMessage = e.getMessage(); exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java index 787b811501..17fa10a186 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java @@ -51,8 +51,8 @@ public class NamingClientResponseValidator { public String validateNameGenResponse(ResponseEntity<NameGenResponse> response) throws BadResponseException { if (response == null) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE, - "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE); } @@ -61,8 +61,8 @@ public class NamingClientResponseValidator { String generatedName = ""; NameGenResponse responseBody = response.getBody(); if (responseBody == null) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE, - "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), NULL_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE); } @@ -91,16 +91,16 @@ public class NamingClientResponseValidator { errorMessageString = error.getMessage(); } String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString); - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), errorMessage); + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", + MsoLogger.ErrorCode.DataError.getValue(), errorMessage); throw new BadResponseException(errorMessage); } } public String validateNameGenDeleteResponse(ResponseEntity<NameGenDeleteResponse> response) throws BadResponseException { if (response == null) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE, - "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE); } @@ -109,8 +109,8 @@ public class NamingClientResponseValidator { String responseMessage = ""; NameGenDeleteResponse responseBody = response.getBody(); if (responseBody == null) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE, - "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), NULL_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE); } @@ -122,7 +122,7 @@ public class NamingClientResponseValidator { String errorMessageString = NAMING_SERVICE_ERROR; String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString); - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.ErrorCode.DataError.getValue(), errorMessage); throw new BadResponseException(errorMessage); } @@ -142,7 +142,7 @@ public class NamingClientResponseValidator { errorMessageString = error.getMessage(); } String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString); - logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.getServiceName(), + logger.error("{} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.ErrorCode.DataError.getValue(), errorMessage); return errorMessage; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java index 2f9c8da5f0..8513b26a5d 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java @@ -67,9 +67,9 @@ public class SdnCommonTasks { try { jsonRequest = objMapper.writerWithDefaultPrettyPrinter().writeValueAsString(request); } catch (JsonProcessingException e) { - logger.error("{} {} {} {} {} {}", MessageEnum.JAXB_EXCEPTION.toString(), + logger.error("{} {} {} {} {}", MessageEnum.JAXB_EXCEPTION.toString(), COULD_NOT_CONVERT_SDNC_POJO_TO_JSON, - "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), e.getMessage()); + "BPMN", MsoLogger.ErrorCode.DataError.getValue(), e.getMessage()); throw new MapperException(COULD_NOT_CONVERT_SDNC_POJO_TO_JSON); } jsonRequest = "{\"input\":" + jsonRequest + "}"; @@ -100,8 +100,8 @@ public class SdnCommonTasks { */ public String validateSDNResponse(LinkedHashMap<String, Object> output) throws BadResponseException { if (CollectionUtils.isEmpty(output)) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC); + logger.error("{} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC); throw new BadResponseException(NO_RESPONSE_FROM_SDNC); } LinkedHashMap<String, Object> embeddedResponse =(LinkedHashMap<String, Object>) output.get("output"); @@ -127,8 +127,8 @@ public class SdnCommonTasks { return jsonResponse; } else { String errorMessage = String.format(SDNC_CODE_NOT_0_OR_IN_200_299, responseMessage); - logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), errorMessage, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), errorMessage); + logger.error("{} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), errorMessage, "BPMN", + MsoLogger.ErrorCode.DataError.getValue(), errorMessage); throw new BadResponseException(errorMessage); } } @@ -141,8 +141,8 @@ public class SdnCommonTasks { */ public String validateSDNGetResponse(LinkedHashMap<String, Object> output) throws BadResponseException { if (CollectionUtils.isEmpty(output)) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC); + logger.error("{} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC); throw new BadResponseException(NO_RESPONSE_FROM_SDNC); } ObjectMapper objMapper = new ObjectMapper(); @@ -152,8 +152,8 @@ public class SdnCommonTasks { stringOutput = objMapper.writeValueAsString(output); } catch (Exception e) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), BAD_RESPONSE_FROM_SDNC, - "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + logger.error("{} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), BAD_RESPONSE_FROM_SDNC, + "BPMN", MsoLogger.ErrorCode.UnknownError.getValue(), BAD_RESPONSE_FROM_SDNC); throw new BadResponseException(BAD_RESPONSE_FROM_SDNC); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java index f70ac8399f..5124435a79 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java @@ -173,8 +173,8 @@ public class VfModuleTopologyOperationRequestMapper { GenericResourceApiVfModuleResponseInformation assignResponseInfo = mapper.readValue(sdncAssignResponse, GenericResourceApiVfModuleResponseInformation.class); objectPath = assignResponseInfo.getVfModuleResponseInformation().getObjectPath(); } catch (Exception e) { - logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), e.getMessage(), "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), e.getMessage()); + logger.error("{} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), e.getMessage(), "BPMN", + MsoLogger.ErrorCode.UnknownError.getValue(), e.getMessage()); } } return objectPath; diff --git a/common/src/main/java/org/onap/so/logger/MsoLogger.java b/common/src/main/java/org/onap/so/logger/MsoLogger.java index 341d7996a9..f8ff530c3b 100644 --- a/common/src/main/java/org/onap/so/logger/MsoLogger.java +++ b/common/src/main/java/org/onap/so/logger/MsoLogger.java @@ -888,16 +888,6 @@ public class MsoLogger { MDC.remove(TARGETSERVICENAME); } - - public void logStackTrace(Exception ex){ - StringWriter errors = new StringWriter(); - ex.printStackTrace(new PrintWriter(errors)); - logger.error(errors.toString()); - } - - public boolean isDebugEnabled() { - return logger.isDebugEnabled(); - } private void prepareMsg(String loggingLevel) { prepareMsg(loggingLevel, null, null); @@ -959,7 +949,6 @@ public class MsoLogger { MDC.put(ERRORDESC, errorDesc); MDC.put(TARGETENTITY, targetEntity); MDC.put(TARGETSERVICENAME, targetServiceName); - MDC.put(SERVICE_NAME, getFinalServiceName(getServiceName())); } private void prepareMetricMsg(long startTime, StatusCode statusCode, int responseCode, String responseDesc, @@ -1042,7 +1031,7 @@ public class MsoLogger { /** * Set the requestId and serviceInstanceId - * + * * @param reqId * The requestId * @param svcId @@ -1067,22 +1056,6 @@ public class MsoLogger { return MDC.get(SERVICE_NAME); } - /** - * Set the requestId and serviceInstanceId based on the mso request - * - * @param msoRequest - * The mso request - */ - public static void setLogContext(MsoRequest msoRequest) { - if (msoRequest != null) { - MDC.put(REQUEST_ID, msoRequest.getRequestId()); - MDC.put(SERVICE_INSTANCE_ID, msoRequest.getServiceInstanceId()); - } else { - MDC.put(REQUEST_ID, DUMMY_VALUE); - MDC.put(SERVICE_INSTANCE_ID, DUMMY_VALUE); - } - } - private String normalize(String input) { if (input == null) { return null; |