aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management
diff options
context:
space:
mode:
authorTaka Cho <takamune.cho@att.com>2021-08-03 13:28:28 -0400
committerTaka Cho <takamune.cho@att.com>2021-08-06 13:13:13 -0400
commitaabb9e500132bbcd639bc4b8bda34e8fde3a3676 (patch)
tree15d2d58f918ca30f0160c550fd1d2814d04d5816 /policy-management
parent1744dac574fb771301027be74c9257eb070125f7 (diff)
Use slf4j Marker from common repo
using slf4j Marker from common repo Issue-ID: POLICY-3087 Change-Id: Iefbd6fa9ab2dfa6388508cb6ffd6cf1358b45ccc Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'policy-management')
-rw-r--r--policy-management/pom.xml6
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java4
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/Main.java11
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java5
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java8
5 files changed, 21 insertions, 13 deletions
diff --git a/policy-management/pom.xml b/policy-management/pom.xml
index fa603734..6aa7b87f 100644
--- a/policy-management/pom.xml
+++ b/policy-management/pom.xml
@@ -148,6 +148,12 @@
</dependency>
<dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-pdp</artifactId>
<version>${policy.models.version}</version>
diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
index 4374eb81..dfcfe438 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
@@ -65,6 +65,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
import org.onap.policy.common.endpoints.event.comm.TopicSource;
import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;
+import org.onap.policy.common.utils.logging.LoggerUtils;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.features.PolicyControllerFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
@@ -79,7 +80,6 @@ import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyControllerConstants;
import org.onap.policy.drools.system.PolicyEngine;
import org.onap.policy.drools.system.PolicyEngineConstants;
-import org.onap.policy.drools.utils.logging.LoggerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -2071,7 +2071,7 @@ public class RestManager {
.entity(new Error("logger level: " + NOT_ACCEPTABLE_MSG))
.build();
}
- newLevel = LoggerUtil.setLevel(loggerName, loggerLevel);
+ newLevel = LoggerUtils.setLevel(loggerName, loggerLevel);
} catch (final IllegalArgumentException e) {
logger.warn("{}: invalid operation for logger {} and level {}", this, loggerName, loggerLevel, e);
return Response.status(Status.NOT_FOUND).build();
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/Main.java b/policy-management/src/main/java/org/onap/policy/drools/system/Main.java
index c28d4c96..e92d05d2 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/Main.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/Main.java
@@ -28,6 +28,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.utils.logging.LoggerUtils;
import org.onap.policy.common.utils.resources.MessageConstants;
import org.onap.policy.common.utils.security.CryptoUtils;
import org.onap.policy.drools.persistence.SystemPersistenceConstants;
@@ -142,7 +143,7 @@ public class Main {
if (!success) {
trans.setStatusCode(false).setResponseDescription("partial start").flush();
logger.warn(
- LoggerUtil.TRANSACTION_LOG_MARKER,
+ LoggerUtils.TRANSACTION_LOG_MARKER,
"Main: {} has been partially started",
PolicyEngineConstants.getManager());
throw new PolicyDroolsPdpRuntimeException(
@@ -157,7 +158,7 @@ public class Main {
.setResponseDescription(e.getMessage())
.flush();
logger.warn(
- LoggerUtil.TRANSACTION_LOG_MARKER,
+ LoggerUtils.TRANSACTION_LOG_MARKER,
"Main: cannot start {} (bad state)",
PolicyEngineConstants.getManager());
throw new PolicyDroolsPdpRuntimeException(
@@ -169,7 +170,7 @@ public class Main {
.setResponseDescription(e.getMessage())
.flush();
logger.warn(
- LoggerUtil.TRANSACTION_LOG_MARKER,
+ LoggerUtils.TRANSACTION_LOG_MARKER,
"Main: cannot start {}",
PolicyEngineConstants.getManager());
throw new PolicyDroolsPdpRuntimeException(
@@ -205,7 +206,7 @@ public class Main {
.setResponseDescription(e.getMessage())
.flush();
logger.error(
- LoggerUtil.TRANSACTION_LOG_MARKER,
+ LoggerUtils.TRANSACTION_LOG_MARKER,
"Main: cannot instantiate policy-controller {}",
controllerName);
throw new PolicyDroolsPdpRuntimeException(
@@ -217,7 +218,7 @@ public class Main {
.setResponseDescription(e.getMessage())
.flush();
logger.warn(
- LoggerUtil.TRANSACTION_LOG_MARKER,
+ LoggerUtils.TRANSACTION_LOG_MARKER,
"Main: cannot instantiate policy-controller {} (linkage)",
controllerName);
throw new PolicyDroolsPdpRuntimeException(
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
index 664f7c7f..d5f7ae05 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
@@ -56,6 +56,7 @@ import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInst
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
import org.onap.policy.common.gson.annotation.GsonJsonProperty;
+import org.onap.policy.common.utils.logging.LoggerUtils;
import org.onap.policy.common.utils.services.FeatureApiUtils;
import org.onap.policy.drools.controller.DroolsControllerConstants;
import org.onap.policy.drools.core.PolicyContainer;
@@ -398,7 +399,7 @@ class PolicyEngineManager implements PolicyEngine {
} else {
final String msg = "Configuration Entity is not supported: " + entity;
mdcTrans.resetSubTransaction().setStatusCode(false).setResponseDescription(msg).flush();
- logger.warn(LoggerUtil.TRANSACTION_LOG_MARKER, msg);
+ logger.warn(LoggerUtils.TRANSACTION_LOG_MARKER, msg);
throw new IllegalArgumentException(msg);
}
}
@@ -468,7 +469,7 @@ class PolicyEngineManager implements PolicyEngine {
} catch (final Exception e) {
mdcTrans.setStatusCode(false).setResponseCode(e.getClass().getName())
.setResponseDescription(e.getMessage()).flush();
- logger.error(LoggerUtil.TRANSACTION_LOG_MARKER,
+ logger.error(LoggerUtils.TRANSACTION_LOG_MARKER,
"{}: cannot update-policy-controllers because of {}", this, e.getMessage(), e);
}
}
diff --git a/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java b/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java
index db2062f4..b71403e7 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 2021 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.
@@ -51,9 +51,9 @@ import org.kie.api.event.rule.ObjectUpdatedEvent;
import org.kie.api.event.rule.RuleFlowGroupActivatedEvent;
import org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent;
import org.kie.api.event.rule.RuleRuntimeEventListener;
+import org.onap.policy.common.utils.logging.LoggerUtils;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.util.KieUtils;
-import org.onap.policy.drools.utils.logging.LoggerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,8 +105,8 @@ public class MavenDroolsControllerUpgradesTest {
Paths.get(DROOLS_RESOURCES_DIR + "rules2" + DRL_EXT).toFile())
.collect(Collectors.toList()));
- LoggerUtil.setLevel("ROOT", "WARN");
- LoggerUtil.setLevel("org.onap.policy.drools.controller.internal", "INFO");
+ LoggerUtils.setLevel("ROOT", "WARN");
+ LoggerUtils.setLevel("org.onap.policy.drools.controller.internal", "INFO");
}
/**