aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java3
-rw-r--r--cps-service/src/main/java/org/onap/cps/utils/YangUtils.java6
2 files changed, 6 insertions, 3 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
index 9d7f38ae84..d1a773c1e7 100644
--- a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
@@ -19,6 +19,7 @@
package org.onap.cps.rest.exceptions;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.onap.cps.rest.controller.AdminRestController;
import org.onap.cps.rest.controller.DataRestController;
@@ -35,6 +36,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
+@Slf4j
@RestControllerAdvice(assignableTypes = {AdminRestController.class, DataRestController.class})
public class CpsRestExceptionHandler {
@@ -74,6 +76,7 @@ public class CpsRestExceptionHandler {
private static ResponseEntity<Object> buildErrorResponse(final HttpStatus status, final String message,
final String details) {
+ log.error("An error has occurred : {} Status: {} Details: {}", message, status, details);
final ErrorMessage errorMessage = new ErrorMessage();
errorMessage.setStatus(status.toString());
errorMessage.setMessage(message);
diff --git a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
index b96480a670..8743b7df1b 100644
--- a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
+++ b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
@@ -25,8 +25,8 @@ import java.io.StringReader;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.logging.Logger;
import java.util.stream.Collectors;
+import lombok.extern.slf4j.Slf4j;
import org.onap.cps.api.impl.Fragment;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -46,8 +46,8 @@ import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+@Slf4j
public class YangUtils {
- private static final Logger LOGGER = Logger.getLogger(YangUtils.class.getName());
private YangUtils() {
throw new IllegalStateException("Utility class");
@@ -103,7 +103,7 @@ public class YangUtils {
} else if (normalizedNode instanceof LeafSetNode) {
inspectLeafList(currentFragment, (LeafSetNode) normalizedNode);
} else {
- LOGGER.warning("Cannot normalize " + normalizedNode.getClass());
+ log.warn("Cannot normalize " + normalizedNode.getClass());
}
}