1212import org .json .JSONObject ;
1313import org .json .XML ;
1414
15-
16-
17-
1815public class PropertyLogHandlerESB extends AbstractMediator {
1916
2017 Log logHandler = LogFactory .getLog ("REQUEST_RESPONSE_LOGGER" );
@@ -89,15 +86,15 @@ private void logResponsePropertiesESB(MessageContext messageContext,
8986 String xmlString = axis2MessageContext .getEnvelope ().toString ();
9087 JSONObject xmlJsonObj = XML .toJSONObject (xmlString );
9188 jsonBody = xmlJsonObj .toString ();
92- FAULT = jsonBody ;
89+ FAULT = "true" ;
9390 }
9491 catch (Exception e ){
9592 e .printStackTrace ();
9693 }
9794 }
9895 else {
9996 jsonBody = JsonUtil .jsonPayloadToString (axis2MessageContext );
100- FAULT = "NULL " ;
97+ FAULT = "false " ;
10198 }
10299
103100 if (direction .equals ("nb response" )) {
@@ -113,7 +110,7 @@ private void logResponsePropertiesESB(MessageContext messageContext,
113110 "-wso2telco_value,OPERATOR_NAME:wso2telco_value:" + messageContext .getProperty (OPERATOR_NAME ) +
114111 "-wso2telco_value,OPERATOR_ID:wso2telco_value:" + messageContext .getProperty (OPERATOR_ID ) +
115112 "-wso2telco_value,Body:wso2telco_value:" + jsonBody .replaceAll ("\n " , "" ) +
116- "-wso2telco_value,FAULT:wso2telco_value: " + FAULT . replaceAll ( " \n " , "" ) );
113+ "-wso2telco_value,ERROR: " + FAULT );
117114 }
118115 else if (direction .equals ("sb response" )){
119116 logHandler .info ("SOUTHBOUND_RESPONSE_LOGGER-" +"API_REQUEST_ID:wso2telco_value:" + messageContext .getProperty (REQUESTID ) +
@@ -128,7 +125,7 @@ else if(direction.equals("sb response")){
128125 "-wso2telco_value,OPERATOR_NAME:wso2telco_value:" + messageContext .getProperty (OPERATOR_NAME ) +
129126 "-wso2telco_value,OPERATOR_ID:wso2telco_value:" + messageContext .getProperty (OPERATOR_ID ) +
130127 "-wso2telco_value,Body:wso2telco_value:" + jsonBody .replaceAll ("\n " , "" ) +
131- "-wso2telco_value,FAULT:wso2telco_value: " + FAULT . replaceAll ( " \n " , "" ) );
128+ "-wso2telco_value,ERROR: " + FAULT );
132129
133130 }
134131 }
0 commit comments