aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/org')
-rw-r--r--common/src/main/java/org/onap/so/client/RestClientSSL.java2
-rw-r--r--common/src/main/java/org/onap/so/client/RestTemplateConfig.java7
-rw-r--r--common/src/main/java/org/onap/so/logger/LogConstants.java26
-rw-r--r--common/src/main/java/org/onap/so/logger/MsoLogger.java23
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java10
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java12
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java42
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java98
-rw-r--r--common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java42
9 files changed, 217 insertions, 45 deletions
diff --git a/common/src/main/java/org/onap/so/client/RestClientSSL.java b/common/src/main/java/org/onap/so/client/RestClientSSL.java
index cb2839ae1f..ac4a8d1a7c 100644
--- a/common/src/main/java/org/onap/so/client/RestClientSSL.java
+++ b/common/src/main/java/org/onap/so/client/RestClientSSL.java
@@ -56,7 +56,7 @@ public abstract class RestClientSSL extends RestClient {
KeyStore ks = getKeyStore();
if(ks != null) {
client = ClientBuilder.newBuilder().keyStore(ks, System.getProperty(RestClientSSL.SSL_KEY_STORE_PASSWORD_KEY)).build();
- logger.debug("RestClientSSL not using default SSL context - setting keystore here.");
+ logger.info("RestClientSSL not using default SSL context - setting keystore here.");
return client;
}
}
diff --git a/common/src/main/java/org/onap/so/client/RestTemplateConfig.java b/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
index ad833208dc..14556f1211 100644
--- a/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
+++ b/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
@@ -20,8 +20,10 @@
package org.onap.so.client;
+import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@@ -30,6 +32,9 @@ public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate() {
- return new RestTemplate( new HttpComponentsClientHttpRequestFactory());
+ RestTemplate restTemplate = new RestTemplate();
+ restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
+ restTemplate.getInterceptors().add(new SpringClientFilter());
+ return restTemplate;
}
}
diff --git a/common/src/main/java/org/onap/so/logger/LogConstants.java b/common/src/main/java/org/onap/so/logger/LogConstants.java
new file mode 100644
index 0000000000..ea3c8e2c4a
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logger/LogConstants.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 ONAP - SO
+ * ================================================================================
+ * 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.logger;
+
+public class LogConstants {
+ public static final String TARGET_ENTITY_HEADER="X-Target-Entity";
+ public static final String UNKNOWN_TARGET_ENTITY="Unknown-Target-Entity";
+}
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 94ffa71169..c4fba671bb 100644
--- a/common/src/main/java/org/onap/so/logger/MsoLogger.java
+++ b/common/src/main/java/org/onap/so/logger/MsoLogger.java
@@ -207,30 +207,9 @@ public class MsoLogger {
private MsoLogger(MsoLogger.Catalog cat, Class<?> clazz) {
this.logger = LoggerFactory.getLogger(clazz);
this.auditLogger = LoggerFactory.getLogger("AUDIT");
- this.metricsLogger = LoggerFactory.getLogger("METRIC");
- MsoLogger.initialization();
+ this.metricsLogger = LoggerFactory.getLogger("METRIC");
setDefaultLogCatalog(cat);
}
-
- private static synchronized void initialization() {
- if (instanceUUID == null || ("").equals(instanceUUID)) {
- instanceUUID = getInstanceUUID();
- }
-
- if (serverIP == null || serverName == null || ("").equals(serverIP) || ("").equals(serverName)) {
- try {
- InetAddress server = InetAddress.getLocalHost();
- serverIP = server.getHostAddress();
- serverName = server.getHostName();
- } catch (UnknownHostException e) {
- initLOGGER.error("Could not get local hostname", e);
- serverIP = "";
- serverName = "";
- }
- }
- }
-
-
public static MsoLogger getMsoLogger(MsoLogger.Catalog cat, Class<?> clazz) {
return new MsoLogger(cat,clazz);
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java
index 49dc71e773..6c2a96c87d 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java
@@ -64,7 +64,7 @@ public class JaxRsClientLogging implements ClientRequestFilter,ClientResponseFil
private static Logger logger = LoggerFactory.getLogger(JaxRsClientLogging.class);
public void setTargetService(TargetEntity targetEntity){
- MDC.put("TargetEntity", targetEntity.toString());
+ MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, targetEntity.toString());
}
@Override
@@ -90,7 +90,7 @@ public class JaxRsClientLogging implements ClientRequestFilter,ClientResponseFil
MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, clientRequest.getUri().toString());
MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
setInvocationId();
- MDC.put("TargetEntity",MDC.get("TargetEntity"));
+ MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY,MDC.get(ONAPLogConstants.MDCs.TARGET_ENTITY));
}
private String extractRequestID(ClientRequestContext clientRequest) {
@@ -123,7 +123,7 @@ public class JaxRsClientLogging implements ClientRequestFilter,ClientResponseFil
MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(responseContext.getStatus()));
MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION,getStringFromInputStream(responseContext));
MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
- logger.info(MarkerFactory.getMarker("INVOKE_RETURN"), "InvokeReturn");
+ logger.info(ONAPLogConstants.Markers.INVOKE_RETURN, "InvokeReturn");
clearClientMDCs();
} catch ( Exception e) {
logger.warn("Error in outgoing JAX-RS Inteceptor", e);
@@ -136,6 +136,10 @@ public class JaxRsClientLogging implements ClientRequestFilter,ClientResponseFil
MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
+ MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
+ MDC.remove(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP);
}
private static String getStringFromInputStream(ClientResponseContext clientResponseContext) {
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
index 7d02136860..85a6498748 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
@@ -76,7 +76,7 @@ public class JaxRsFilterLogging implements ContainerRequestFilter,ContainerRespo
mdcSetup.setClientIPAddress(httpServletRequest);
mdcSetup.setInstanceUUID();
mdcSetup.setEntryTimeStamp();
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, "INPROGRESS");
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
} catch (Exception e) {
logger.warn("Error in incoming JAX-RS Inteceptor", e);
@@ -163,6 +163,16 @@ public class JaxRsFilterLogging implements ContainerRequestFilter,ContainerRespo
MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, containerRequest.getUriInfo().getPath());
}
+ private void clearClientMDCs() {
+ MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
+ MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
+ }
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java
new file mode 100644
index 0000000000..cc2ccb5c2e
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.logging.jaxrs.filter;
+
+import java.util.Map;
+
+import org.slf4j.MDC;
+import org.springframework.core.task.TaskDecorator;
+
+public class MDCTaskDecorator implements TaskDecorator {
+
+ @Override
+ public Runnable decorate(Runnable runnable) {
+ Map<String, String> contextMap = MDC.getCopyOfContextMap();
+ return () -> {
+ try {
+ MDC.setContextMap(contextMap);
+ runnable.run();
+ } finally {
+ MDC.clear();
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
index 6af7a916d0..cecef1945b 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
@@ -20,8 +20,12 @@
package org.onap.so.logging.jaxrs.filter;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.LogConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
@@ -30,20 +34,31 @@ import org.springframework.util.StreamUtils;
import java.io.IOException;
import java.nio.charset.Charset;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.UUID;
+import javax.ws.rs.core.Response;
public class SpringClientFilter implements ClientHttpRequestInterceptor {
private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+ private static final String TRACE = "trace-#";
+ private static final String SO = "SO";
@Override
public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
- logRequest(request, body);
+ processRequest(request, body);
ClientHttpResponse response = execution.execute(request, body);
- logResponse(response);
+ processResponse(response);
return response;
}
- private void logRequest(HttpRequest request, byte[] body) throws IOException {
+ private void processRequest(HttpRequest request, byte[] body) throws IOException {
+ setupHeaders(request);
+ setupMDC(request);
if (log.isDebugEnabled()) {
log.debug("===========================request begin================================================");
log.debug("URI : {}", request.getURI());
@@ -53,8 +68,60 @@ public class SpringClientFilter implements ClientHttpRequestInterceptor {
log.debug("==========================request end================================================");
}
}
+
+ private void setupHeaders(HttpRequest clientRequest) {
+ HttpHeaders headers = clientRequest.getHeaders();
+ headers.add(ONAPLogConstants.Headers.REQUEST_ID, extractRequestID(clientRequest));
+ headers.add(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+ headers.add(ONAPLogConstants.Headers.PARTNER_NAME, SO);
+ }
+
+ private String extractRequestID(HttpRequest clientRequest) {
+ String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
+ if(requestId == null || requestId.isEmpty() || requestId.equals(TRACE)){
+ requestId = UUID.randomUUID().toString();
+ log.warn("Could not Find Request ID Generating New One: {}",clientRequest.getURI());
+ }
+ return requestId;
+ }
+
+ private void setupMDC(HttpRequest clientRequest) {
+ MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP, ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
+ MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, clientRequest.getURI().toString());
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+ setInvocationId();
+ MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY,extractTargetEntity(clientRequest));
+ }
+
+ private String extractTargetEntity(HttpRequest clientRequest) {
+ HttpHeaders headers = clientRequest.getHeaders();
+ String headerTargetEntity = null;
+ List<String> headerTargetEntityList = headers.get(LogConstants.TARGET_ENTITY_HEADER);
+ if(headerTargetEntityList!= null && !headerTargetEntityList.isEmpty())
+ headerTargetEntity = headerTargetEntityList.get(0);
+ String targetEntity = MDC.get(ONAPLogConstants.MDCs.TARGET_ENTITY);
+ if(targetEntity != null &&
+ !targetEntity.isEmpty() ){
+ return targetEntity;
+ }else if(headerTargetEntity != null &&
+ !headerTargetEntity.isEmpty()){
+ targetEntity = headerTargetEntity;
+ }else{
+ targetEntity = LogConstants.UNKNOWN_TARGET_ENTITY;
+ log.warn("Could not Target Entity: {}",clientRequest.getURI());
+ }
+ return targetEntity;
+ }
+
+ private void setInvocationId() {
+ String invocationId = MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID);
+ if(invocationId == null || invocationId.isEmpty())
+ invocationId =UUID.randomUUID().toString();
+ MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+ }
+
- private void logResponse(ClientHttpResponse response) throws IOException {
+ private void processResponse(ClientHttpResponse response) throws IOException {
if (log.isDebugEnabled()) {
log.debug("============================response begin==========================================");
log.debug("Status code : {}", response.getStatusCode());
@@ -63,5 +130,28 @@ public class SpringClientFilter implements ClientHttpRequestInterceptor {
log.debug("Response body: {}", StreamUtils.copyToString(response.getBody(), Charset.defaultCharset()));
log.debug("=======================response end=================================================");
}
+ String statusCode;
+ if(Response.Status.Family.familyOf(response.getRawStatusCode()).equals(Response.Status.Family.SUCCESSFUL)){
+ statusCode=ONAPLogConstants.ResponseStatus.COMPLETED.toString();
+ }else{
+ statusCode=ONAPLogConstants.ResponseStatus.ERROR.toString();
+ }
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(response.getRawStatusCode()));
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION,"");
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
+ log.info(ONAPLogConstants.Markers.INVOKE_RETURN, "InvokeReturn");
+ clearClientMDCs();
+ }
+
+ private void clearClientMDCs() {
+ MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
+ MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
+ MDC.remove(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP);
}
}
diff --git a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java b/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
index 194a445ce2..4084ad3ff0 100644
--- a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
+++ b/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
@@ -45,7 +45,7 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
Logger logger = LoggerFactory.getLogger(LoggingInterceptor.class);
@Autowired
- MDCSetup mdcSetup;
+ private MDCSetup mdcSetup;
@Context
private Providers providers;
@@ -53,7 +53,8 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
- Map<String, String> headers = Collections.list(((HttpServletRequest) request).getHeaderNames())
+
+ Map<String, String> headers = Collections.list((request).getHeaderNames())
.stream()
.collect(Collectors.toMap(h -> h, request::getHeader));
setRequestId(headers);
@@ -64,12 +65,27 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
mdcSetup.setEntryTimeStamp();
mdcSetup.setInstanceUUID();
mdcSetup.setServerFQDN();
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, "INPROGRESS");
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
+ if (logger.isDebugEnabled())
+ logRequestInformation(request);
return true;
}
- @Override
+ protected void logRequestInformation(HttpServletRequest request) {
+ Map<String, String> headers = Collections.list((request).getHeaderNames())
+ .stream()
+ .collect(Collectors.toMap(h -> h, request::getHeader));
+
+ logger.debug("===========================request begin================================================");
+ logger.debug("URI : {}", request.getRequestURI());
+ logger.debug("Method : {}", request.getMethod());
+ logger.debug("Headers : {}", headers);
+ logger.debug("==========================request end================================================");
+
+ }
+
+ @Override
public void postHandle(
HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
throws Exception {
@@ -80,7 +96,7 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
MDC.clear();
}
- private void setResponseStatusCode(HttpServletResponse response) {
+ protected void setResponseStatusCode(HttpServletResponse response) {
String statusCode;
if(Response.Status.Family.familyOf(response.getStatus()).equals(Response.Status.Family.SUCCESSFUL)){
statusCode=ONAPLogConstants.ResponseStatus.COMPLETED.toString();
@@ -90,26 +106,26 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
}
- private void setServiceName(HttpServletRequest request) {
+ protected void setServiceName(HttpServletRequest request) {
MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
}
- private void setRequestId(Map<String, String> headers) {
- String requestId=headers.get(ONAPLogConstants.Headers.REQUEST_ID);
+ protected void setRequestId(Map<String, String> headers) {
+ String requestId=headers.get(ONAPLogConstants.Headers.REQUEST_ID.toLowerCase());
if(requestId == null || requestId.isEmpty())
- requestId = UUID.randomUUID().toString();
+ requestId = UUID.randomUUID().toString();
MDC.put(ONAPLogConstants.MDCs.REQUEST_ID,requestId);
}
- private void setInvocationId(Map<String, String> headers) {
- String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID);
+ protected void setInvocationId(Map<String, String> headers) {
+ String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID.toLowerCase());
if(invocationId == null || invocationId.isEmpty())
invocationId =UUID.randomUUID().toString();
MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
}
- private void setMDCPartnerName(Map<String, String> headers) {
- String partnerName=headers.get(ONAPLogConstants.Headers.PARTNER_NAME);
+ protected void setMDCPartnerName(Map<String, String> headers) {
+ String partnerName=headers.get(ONAPLogConstants.Headers.PARTNER_NAME.toLowerCase());
if(partnerName == null || partnerName.isEmpty())
partnerName = "";
MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME,partnerName);
'>1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644