aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramohamad <a.mohamad@queensu.ca>2020-06-26 12:40:11 -0400
committeramohamad <a.mohamad@queensu.ca>2020-07-29 15:47:42 -0400
commit9ee60949d3ceca3ab1fcf47c9214f7bf6baf89c6 (patch)
tree67bf3fbecf8b3bbd4beaccc1378e3914c5c51ed2
parent3c54913a795813ead9dd8a50f22a846ad10ee415 (diff)
Upgrade Vulnerable Direct Dependencies [log4j]
Signed-off-by: amohamad <a.mohamad@queensu.ca> Issue-ID: SDC-3051 Upgrade from the vulnerable log4j 1.x to log4j 2.13.1 Add a log4j version property in sdc-main pom.xml Add two maven dependencies to respective child pom.xml Change name of log4j .properties and .xml config files to reflect log4j2 naming Update the configuration files to the totally new log4j 2 config syntax Replace PropertyConfigurator with LoggerContext Remove the abandoned log4j.lf5.util.ResourceUtils Signed-off-by: amohamad <a.mohamad@queensu.ca> Change-Id: Ie0f141eb2e0337ee5b63b61dc1395ccd8040558d
-rw-r--r--catalog-dao/src/test/resources/log4j.properties8
-rw-r--r--catalog-dao/src/test/resources/log4j2.properties13
-rw-r--r--pom.xml1
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh2
-rw-r--r--test-apis-ci/pom.xml6
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j.properties34
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties46
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh2
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java5
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java4
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java4
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java4
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java4
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java11
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java12
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java5
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java5
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java7
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java5
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/log4j.properties34
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/log4j.xml32
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/log4j2.properties46
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/log4j2.xml13
-rw-r--r--test-apis-ci/src/main/resources/ci/scripts/startTest.sh2
-rw-r--r--test-apis-ci/src/main/resources/log4j.properties34
-rw-r--r--test-apis-ci/src/main/resources/log4j.xml32
-rw-r--r--test-apis-ci/src/main/resources/log4j2.properties46
-rw-r--r--test-apis-ci/src/main/resources/log4j2.xml13
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j.properties34
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties46
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh2
-rw-r--r--ui-ci/src/main/resources/ci/conf/log4j.properties34
-rw-r--r--ui-ci/src/main/resources/ci/conf/log4j2.properties46
-rw-r--r--ui-ci/src/main/resources/ci/scripts/startTest.sh2
-rw-r--r--utils/webseal-simulator/pom.xml6
-rw-r--r--utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j.properties26
-rw-r--r--utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j2.properties36
-rw-r--r--utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb6
-rw-r--r--utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java5
39 files changed, 363 insertions, 310 deletions
diff --git a/catalog-dao/src/test/resources/log4j.properties b/catalog-dao/src/test/resources/log4j.properties
deleted file mode 100644
index c18c3daa0e..0000000000
--- a/catalog-dao/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# Root logger option
-log4j.rootLogger=info, stdout
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
diff --git a/catalog-dao/src/test/resources/log4j2.properties b/catalog-dao/src/test/resources/log4j2.properties
new file mode 100644
index 0000000000..f028cd07c8
--- /dev/null
+++ b/catalog-dao/src/test/resources/log4j2.properties
@@ -0,0 +1,13 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+rootLogger.level = info
+rootLogger.appenderRef.stdout.ref = STDOUT \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 9bbb733c71..52328783d5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,6 +87,7 @@ Modifications copyright (c) 2018-2019 Nokia
<commons-codec>1.10</commons-codec>
<commons-logging>1.2</commons-logging>
<janino.version>3.0.6</janino.version>
+ <log4j.version>2.13.1</log4j.version>
<!-- aspects -->
<jcabi.version>0.20.1</jcabi.version>
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index 7880578ae4..5ea66527ec 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -30,7 +30,7 @@ OS_USER="onap"
BE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=4000,server=y,suspend=n -Xmx1536m -Xms1536m"
FE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=6000,server=y,suspend=n -Xmx256m -Xms256m"
ONBOARD_BE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=4001,server=y,suspend=n -Xmx1g -Xms1g"
-SIM_JAVA_OPTIONS=" -Xmx128m -Xms128m -Xss1m -Dlog4j.configuration=file:///${JETTY_BASE}/config/sdc-simulator/log4j.properties"
+SIM_JAVA_OPTIONS=" -Xmx128m -Xms128m -Xss1m -Dlog4j.configuration=file:///${JETTY_BASE}/config/sdc-simulator/log4j2.properties"
API_TESTS_JAVA_OPTIONS="-Xmx512m -Xms512m"
UI_TESTS_JAVA_OPTIONS="-Xmx1024m -Xms1024m"
#Define this as variable, so it can be excluded in run commands on Docker for OSX, as /etc/localtime cant be mounted there.
diff --git a/test-apis-ci/pom.xml b/test-apis-ci/pom.xml
index 4d1b8c4795..2ae8752423 100644
--- a/test-apis-ci/pom.xml
+++ b/test-apis-ci/pom.xml
@@ -79,9 +79,9 @@
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j.properties b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j.properties
deleted file mode 100644
index 02f783076a..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Define the root logger with appender file
-log4j.rootLogger = INFO, FILE, stdout
-
-# Define the file appender
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${targetlog}logs/ci-log.out
-
-# Define the layout for file appender
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-
-# Set the maximum file size before rollover
-log4j.appender.FILE.maxFileSize=5MB
-
-# Set the the backup index
-log4j.appender.FILE.maxBackupIndex=10
-
-
-#############################################################
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-
-log4j.logger.org.apache.cassandra.service.StorageProxy=INFO
-log4j.logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction=INFO, FILE, stdout
-
-log4j.logger.org.openecomp.sdc.ci.tests.utils=INFO, FILE, stdout
-log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
-
-
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties
new file mode 100644
index 0000000000..a0ed4f0c42
--- /dev/null
+++ b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties
@@ -0,0 +1,46 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+property.filename = ${targetlog}logs/ci-log.out
+
+#filter.threshold.type = ThresholdFilter
+#filter.threshold.level = debug
+
+appender.rolling.type = RollingFile
+appender.rolling.name = RollingFile
+appender.rolling.fileName = ${filename}
+appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
+appender.rolling.layout.type = PatternLayout
+appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+appender.rolling.policies.type = Policies
+appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+appender.rolling.policies.size.size=5MB
+appender.rolling.strategy.type = DefaultRolloverStrategy
+appender.rolling.strategy.max = 10
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+logger.rolling.name = RollingAppender
+logger.rolling.level = info
+logger.rolling.additivity = false
+logger.rolling.appenderRef.rolling.ref = RollingFile
+
+logger.org.apache.cassandra.service.StorageProxy.level=info
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
+
+logger.org.openecomp.sdc.ci.tests.utils.level = info
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
+logger.org.openecomp.sdc.ci.tests.utils.additivity = false
+
+rootLogger.level = info
+rootLogger.appenderRef.stdout.ref = STDOUT
+rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh
index 562bfe4ffc..a5ad7e239a 100644
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh
+++ b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh
@@ -93,7 +93,7 @@ then
else
FULL_PATH=$CURRENT_DIR/$BASEDIR
fi
-LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
+LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j2.properties
#############################################
TARGET_DIR=${FULL_PATH}/target
CONF_FILE=${FULL_PATH}/conf/sdc.yaml
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
index 8f6d9db4c2..beef13afc6 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
@@ -26,7 +26,8 @@ import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.Status;
import org.janusgraph.core.JanusGraph;
import org.apache.commons.collections.CollectionUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.rules.TestName;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
@@ -62,7 +63,7 @@ import static org.testng.AssertJUnit.assertNotNull;
public abstract class ComponentBaseTest {
- protected static Logger logger = Logger.getLogger(ComponentBaseTest.class);
+ protected static Logger logger = LogManager.getLogger(ComponentBaseTest.class);
protected static final String REPORT_FOLDER = "." + File.separator + "ExtentReport" + File.separator;
private static final String VERSIONS_INFO_FILE_NAME = "versions.info";
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
index 358e425cc5..b623aea33b 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
@@ -20,7 +20,7 @@
package org.openecomp.sdc.ci.tests.execute.lifecycle;
-import org.apache.log4j.lf5.util.ResourceUtils;
+
import org.junit.rules.TestName;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.LifecycleStateEnum;
@@ -71,7 +71,7 @@ public abstract class LCSbaseTest extends ComponentBaseTest {
protected ArtifactReqDetails heatNetArtifactDetails;
protected ArtifactReqDetails defaultArtifactDetails;
- protected ResourceUtils resourceUtils;
+
protected ArtifactUtils artifactUtils;
// protected static ServiceUtils serviceUtils = new ServiceUtils();
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
index fd59f8ed33..2b62a558ab 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
@@ -20,7 +20,7 @@
package org.openecomp.sdc.ci.tests.execute.product;
-import org.apache.log4j.lf5.util.ResourceUtils;
+
import org.junit.Before;
import org.junit.rules.TestName;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
@@ -53,7 +53,7 @@ public class ProductTestBase extends ProductBaseTest {
protected User sdncUserDetails;
protected ArtifactReqDetails heatArtifactDetails;
protected ArtifactReqDetails defaultArtifactDetails;
- protected ResourceUtils resourceUtils;
+
protected ArtifactUtils artifactUtils;
protected Resource resource;
protected Service service;
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
index a512206035..b02f211767 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
@@ -20,7 +20,7 @@
package org.openecomp.sdc.ci.tests.preRequisites;
-import org.apache.log4j.lf5.util.ResourceUtils;
+
import org.junit.rules.TestName;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.Service;
@@ -53,7 +53,7 @@ public class DownloadArtifactBaseTest extends ComponentBaseTest {
protected ArtifactReqDetails heatArtifactDetails;
protected ArtifactReqDetails defaultArtifactDetails;
- protected ResourceUtils resourceUtils;
+
protected ArtifactUtils artifactUtils;
protected Service service;
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
index 319109a604..913b2852ac 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
@@ -20,7 +20,7 @@
package org.openecomp.sdc.ci.tests.preRequisites;
-import org.apache.log4j.lf5.util.ResourceUtils;
+
import org.junit.rules.TestName;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
@@ -57,7 +57,7 @@ public abstract class SimpleOneRsrcOneServiceTest extends ComponentBaseTest {
protected User sdncDesignerDetails;
protected ArtifactReqDetails defaultArtifactDetails;
- protected ResourceUtils resourceUtils;
+
protected ArtifactUtils artifactUtils;
protected Utils utils;
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
index c1a4e39905..4bd8f58a08 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
@@ -20,7 +20,9 @@
package org.openecomp.sdc.ci.tests.run;
-import org.apache.log4j.PropertyConfigurator;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.utils.Utils;
import org.slf4j.Logger;
@@ -99,14 +101,17 @@ public class StartTest {
String log4jPropsFile = System.getProperty("log4j.configuration");
if (System.getProperty("os.name").contains("Windows")) {
- String logProps = "src/main/resources/ci/conf/log4j.properties";
+ String logProps = "src/main/resources/ci/conf/log4j2.properties";
if (log4jPropsFile == null) {
System.setProperty("targetlog", "target/");
log4jPropsFile = logProps;
}
}
- PropertyConfigurator.configureAndWatch(log4jPropsFile);
+
+ LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
+ File file = new File(log4jPropsFile);
+ context.setConfigLocation(file.toURI());
}
}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
index bb53610802..cbaf8be40b 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
@@ -20,7 +20,9 @@
package org.openecomp.sdc.ci.tests.run;
-import org.apache.log4j.PropertyConfigurator;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
@@ -113,15 +115,17 @@ public class StartTest2backup {
String log4jPropsFile = System.getProperty("log4j.configuration");
if (System.getProperty("os.name").contains("Windows")) {
- String logProps = "src/main/resources/ci/conf/log4j.properties";
+ String logProps = "src/main/resources/ci/conf/log4j2.properties";
if (log4jPropsFile == null) {
System.setProperty("targetlog", "target/");
log4jPropsFile = logProps;
}
}
- PropertyConfigurator.configureAndWatch(log4jPropsFile);
-
+
+ LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
+ File file = new File(log4jPropsFile);
+ context.setConfigLocation(file.toURI());
}
}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
index ea6ef62618..73e99011c3 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
@@ -25,7 +25,8 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
@@ -54,7 +55,7 @@ public final class Utils {
Gson gson = new Gson();
- static Logger logger = Logger.getLogger(Utils.class.getName());
+ static Logger logger = LogManager.getLogger(Utils.class);
String contentTypeHeaderData = "application/json";
String acceptHeaderDate = "application/json";
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
index 30e54d3914..5254db84fa 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
@@ -56,7 +56,8 @@ import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.gson.*;
import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.simple.JSONObject;
@@ -118,7 +119,7 @@ public class ResponseParser {
public static final String ORIGIN_TYPE = "originType";
public static final String TOSCA_RESOURCE_NAME = "toscaResourceName";
- static Logger logger = Logger.getLogger(ResponseParser.class.getName());
+ static Logger logger = LogManager.getLogger(ResponseParser.class);
public static String getValueFromJsonResponse(String response, String fieldName) {
try {
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
index 06dbc12a99..1758fce232 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
@@ -22,7 +22,8 @@ package org.openecomp.sdc.ci.tests.utils.validation;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.Row;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
@@ -64,14 +65,14 @@ import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
public class AuditValidationUtils {
- protected static Logger logger = Logger.getLogger(AuditValidationUtils.class.getName());
+ protected static Logger logger = LogManager.getLogger(AuditValidationUtils.class);
private static final String auditKeySpaceName = "sdcaudit";
public AuditValidationUtils() {
super();
StartTest.enableLogger();
- logger = Logger.getLogger(AuditValidationUtils.class.getName());
+ logger = LogManager.getLogger(AuditValidationUtils.class);
}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
index 18c9f9f4c0..f2ef0826f2 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
@@ -20,7 +20,8 @@
package org.openecomp.sdc.ci.tests.utils.validation;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
@@ -43,7 +44,7 @@ import static org.testng.AssertJUnit.*;
public class ProductValidationUtils {
- static Logger logger = Logger.getLogger(ProductValidationUtils.class.getName());
+ static Logger logger = LogManager.getLogger(ProductValidationUtils.class);
public static void compareExpectedAndActualProducts(Product expectedProduct, Product actualProduct) {
compareExpectedAndActualProducts(expectedProduct, actualProduct, null);
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j.properties b/test-apis-ci/src/main/resources/ci/conf/log4j.properties
deleted file mode 100644
index 02f783076a..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Define the root logger with appender file
-log4j.rootLogger = INFO, FILE, stdout
-
-# Define the file appender
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${targetlog}logs/ci-log.out
-
-# Define the layout for file appender
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-
-# Set the maximum file size before rollover
-log4j.appender.FILE.maxFileSize=5MB
-
-# Set the the backup index
-log4j.appender.FILE.maxBackupIndex=10
-
-
-#############################################################
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-
-log4j.logger.org.apache.cassandra.service.StorageProxy=INFO
-log4j.logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction=INFO, FILE, stdout
-
-log4j.logger.org.openecomp.sdc.ci.tests.utils=INFO, FILE, stdout
-log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
-
-
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j.xml b/test-apis-ci/src/main/resources/ci/conf/log4j.xml
deleted file mode 100644
index 6db233a1da..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/log4j.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
- debug="false">
-
- <appender name="fileAppender" class="org.apache.log4j.FileAppender">
-
- <param name="Threshold" value="INFO" />
-
- <param name="File" value="logfile.log" />
-
- <layout class="org.apache.log4j.PatternLayout">
-
- <param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
-
- </layout>
-
- </appender>
-
- <root>
-
- <level value="INFO" />
-
- <appender-ref ref="fileAppender" />
-
- </root>
-
-
-
-</log4j:configuration>
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j2.properties b/test-apis-ci/src/main/resources/ci/conf/log4j2.properties
new file mode 100644
index 0000000000..a8944dba13
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/log4j2.properties
@@ -0,0 +1,46 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+property.filename = ${targetlog}logs/ci-log.out
+
+#filter.threshold.type = ThresholdFilter
+#filter.threshold.level = debug
+
+appender.rolling.type = RollingFile
+appender.rolling.name = RollingFile
+appender.rolling.fileName = ${filename}
+appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
+appender.rolling.layout.type = PatternLayout
+appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+appender.rolling.policies.type = Policies
+appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+appender.rolling.policies.size.size=5MB
+appender.rolling.strategy.type = DefaultRolloverStrategy
+appender.rolling.strategy.max = 10
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+logger.rolling.name = RollingAppender
+logger.rolling.level = info
+logger.rolling.additivity = false
+logger.rolling.appenderRef.rolling.ref = RollingFile
+
+logger.org.apache.cassandra.service.StorageProxy.level=info
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
+
+logger.org.openecomp.sdc.ci.tests.utils.level = info
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
+logger.org.openecomp.sdc.ci.tests.utils.additivity = false
+
+rootLogger.level = info
+rootLogger.appenderRef.stdout.ref = STDOUT
+rootLogger.appenderRef.rolling.ref = RollingFile
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j2.xml b/test-apis-ci/src/main/resources/ci/conf/log4j2.xml
new file mode 100644
index 0000000000..5295d45a47
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/log4j2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="ERROR">
+ <Appenders>
+ <File name="fileAppender" fileName="logfile.log" append="false">
+ <PatternLayout pattern="%d %-5p [%c{1}] %m %n"/>
+ </File>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <AppenderRef ref="fileAppender"/>
+ </Root>
+ </Loggers>
+</Configuration> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/scripts/startTest.sh b/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
index 719bca4459..f8285ef506 100644
--- a/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
+++ b/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
@@ -69,7 +69,7 @@ then
else
FULL_PATH=$CURRENT_DIR/$BASEDIR
fi
-LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
+LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j2.properties
#############################################
TARGET_DIR=${FULL_PATH}/target
CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
diff --git a/test-apis-ci/src/main/resources/log4j.properties b/test-apis-ci/src/main/resources/log4j.properties
deleted file mode 100644
index 31c4ba091b..0000000000
--- a/test-apis-ci/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Define the root logger with appender file
-log4j.rootLogger = INFO, FILE, stdout
-
-# Define the file appender
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${targetlog}logs/ci-log.out
-
-# Define the layout for file appender
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-
-# Set the maximum file size before rollover
-log4j.appender.FILE.maxFileSize=5MB
-
-# Set the the backup index
-log4j.appender.FILE.maxBackupIndex=10
-
-
-#############################################################
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-
-log4j.logger.org.apache.cassandra.service.StorageProxy=INFO
-log4j.logger.org.janusgraph.diskstorage.cql.CassandraTransaction=INFO, FILE, stdout
-
-log4j.logger.org.openecomp.sdc.ci.tests.utils=INFO, FILE, stdout
-log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
-
-
diff --git a/test-apis-ci/src/main/resources/log4j.xml b/test-apis-ci/src/main/resources/log4j.xml
deleted file mode 100644
index 6db233a1da..0000000000
--- a/test-apis-ci/src/main/resources/log4j.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
- debug="false">
-
- <appender name="fileAppender" class="org.apache.log4j.FileAppender">
-
- <param name="Threshold" value="INFO" />
-
- <param name="File" value="logfile.log" />
-
- <layout class="org.apache.log4j.PatternLayout">
-
- <param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
-
- </layout>
-
- </appender>
-
- <root>
-
- <level value="INFO" />
-
- <appender-ref ref="fileAppender" />
-
- </root>
-
-
-
-</log4j:configuration>
diff --git a/test-apis-ci/src/main/resources/log4j2.properties b/test-apis-ci/src/main/resources/log4j2.properties
new file mode 100644
index 0000000000..242714cb78
--- /dev/null
+++ b/test-apis-ci/src/main/resources/log4j2.properties
@@ -0,0 +1,46 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+property.filename = ${targetlog}logs/ci-log.out
+
+#filter.threshold.type = ThresholdFilter
+#filter.threshold.level = debug
+
+appender.rolling.type = RollingFile
+appender.rolling.name = RollingFile
+appender.rolling.fileName = ${filename}
+appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
+appender.rolling.layout.type = PatternLayout
+appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+appender.rolling.policies.type = Policies
+appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+appender.rolling.policies.size.size=5MB
+appender.rolling.strategy.type = DefaultRolloverStrategy
+appender.rolling.strategy.max = 10
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+logger.rolling.name = RollingAppender
+logger.rolling.level = info
+logger.rolling.additivity = false
+logger.rolling.appenderRef.rolling.ref = RollingFile
+
+logger.org.apache.cassandra.service.StorageProxy.level=info
+logger.org.janusgraph.diskstorage.cql.CassandraTransaction.level =info
+logger.org.janusgraph.diskstorage.cql.CassandraTransaction.appendRef.rolling.ref = RollingFile
+logger.org.janusgraph.diskstorage.cql.CassandraTransaction.appendRef.stdout.ref = STDOUT
+
+logger.org.openecomp.sdc.ci.tests.utils.level = info
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
+logger.org.openecomp.sdc.ci.tests.utils.additivity = false
+
+rootLogger.level = info
+rootLogger.appenderRef.stdout.ref = STDOUT
+rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/log4j2.xml b/test-apis-ci/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..97a07f95e0
--- /dev/null
+++ b/test-apis-ci/src/main/resources/log4j2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="ERROR">
+<Appenders>
+ <File name="fileAppender" fileName="logfile.log" append="false">
+ <PatternLayout pattern="%d %-5p [%c{1}] %m %n"/>
+ </File>
+</Appenders>
+<Loggers>
+ <Root level="info">
+ <AppenderRef ref="fileAppender"/>
+ </Root>
+</Loggers>
+</Configuration> \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j.properties b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j.properties
deleted file mode 100644
index 31c4ba091b..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Define the root logger with appender file
-log4j.rootLogger = INFO, FILE, stdout
-
-# Define the file appender
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${targetlog}logs/ci-log.out
-
-# Define the layout for file appender
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-
-# Set the maximum file size before rollover
-log4j.appender.FILE.maxFileSize=5MB
-
-# Set the the backup index
-log4j.appender.FILE.maxBackupIndex=10
-
-
-#############################################################
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-
-log4j.logger.org.apache.cassandra.service.StorageProxy=INFO
-log4j.logger.org.janusgraph.diskstorage.cql.CassandraTransaction=INFO, FILE, stdout
-
-log4j.logger.org.openecomp.sdc.ci.tests.utils=INFO, FILE, stdout
-log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
-
-
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties
new file mode 100644
index 0000000000..4735d086a0
--- /dev/null
+++ b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties
@@ -0,0 +1,46 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+property.filename = ${targetlog}logs/ci-log.out
+
+#filter.threshold.type = ThresholdFilter
+#filter.threshold.level = debug
+
+appender.rolling.type = RollingFile
+appender.rolling.name = RollingFile
+appender.rolling.fileName = ${filename}
+appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
+appender.rolling.layout.type = PatternLayout
+appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+appender.rolling.policies.type = Policies
+appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+appender.rolling.policies.size.size=5MB
+appender.rolling.strategy.type = DefaultRolloverStrategy
+appender.rolling.strategy.max = 10
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+logger.rolling.name = RollingAppender
+logger.rolling.level = info
+logger.rolling.additivity = false
+logger.rolling.appenderRef.rolling.ref = RollingFile
+
+logger.org.apache.cassandra.service.StorageProxy.level=info
+logger.org.janusgraph.diskstorage.cql.CassandraTransaction.level =info
+logger.org.janusgraph.diskstorage.cql.CassandraTransaction.appendRef.rolling.ref = RollingFile
+logger.org.janusgraph.diskstorage.cql.CassandraTransaction.appendRef.stdout.ref = STDOUT
+
+logger.org.openecomp.sdc.ci.tests.utils.level = info
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
+logger.org.openecomp.sdc.ci.tests.utils.additivity = false
+
+rootLogger.level = info
+rootLogger.appenderRef.stdout.ref = STDOUT
+rootLogger.appenderRef.rolling.ref = RollingFile
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
index c4415578ee..42153251f4 100644
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
+++ b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
@@ -93,7 +93,7 @@ then
else
FULL_PATH=$CURRENT_DIR/$BASEDIR
fi
-LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
+LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j2.properties
#############################################
TARGET_DIR=${FULL_PATH}/target
CONF_FILE=${FULL_PATH}/conf/sdc.yaml
diff --git a/ui-ci/src/main/resources/ci/conf/log4j.properties b/ui-ci/src/main/resources/ci/conf/log4j.properties
deleted file mode 100644
index 0bdf0fad8c..0000000000
--- a/ui-ci/src/main/resources/ci/conf/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Define the root logger with appender file
-log4j.rootLogger = DEBUG, FILE, stdout
-
-# Define the file appender
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${targetlog}logs/ci-log.out
-
-# Define the layout for file appender
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-
-# Set the maximum file size before rollover
-log4j.appender.FILE.maxFileSize=5MB
-
-# Set the the backup index
-log4j.appender.FILE.maxBackupIndex=10
-
-
-#############################################################
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-
-log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG
-log4j.logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction=INFO, FILE, stdout
-
-log4j.logger.org.openecomp.sdc.ci.tests.utils=TRACE, FILE, stdout
-log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
-
-
diff --git a/ui-ci/src/main/resources/ci/conf/log4j2.properties b/ui-ci/src/main/resources/ci/conf/log4j2.properties
new file mode 100644
index 0000000000..0dde1c99c3
--- /dev/null
+++ b/ui-ci/src/main/resources/ci/conf/log4j2.properties
@@ -0,0 +1,46 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+property.filename = ${targetlog}logs/ci-log.out
+
+#filter.threshold.type = ThresholdFilter
+#filter.threshold.level = debug
+
+appender.rolling.type = RollingFile
+appender.rolling.name = RollingFile
+appender.rolling.fileName = ${filename}
+appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
+appender.rolling.layout.type = PatternLayout
+appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+appender.rolling.policies.type = Policies
+appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+appender.rolling.policies.size.size=5MB
+appender.rolling.strategy.type = DefaultRolloverStrategy
+appender.rolling.strategy.max = 10
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+logger.rolling.name = RollingAppender
+logger.rolling.level = info
+logger.rolling.additivity = false
+logger.rolling.appenderRef.rolling.ref = RollingFile
+
+logger.org.apache.cassandra.service.StorageProxy.level=debug
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
+logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
+
+logger.org.openecomp.sdc.ci.tests.utils.level = trace
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
+logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
+logger.org.openecomp.sdc.ci.tests.utils.additivity = false
+
+rootLogger.level = debug
+rootLogger.appenderRef.stdout.ref = STDOUT
+rootLogger.appenderRef.rolling.ref = RollingFile
diff --git a/ui-ci/src/main/resources/ci/scripts/startTest.sh b/ui-ci/src/main/resources/ci/scripts/startTest.sh
index 93064d0678..20afd86414 100644
--- a/ui-ci/src/main/resources/ci/scripts/startTest.sh
+++ b/ui-ci/src/main/resources/ci/scripts/startTest.sh
@@ -90,7 +90,7 @@ then
else
FULL_PATH=$CURRENT_DIR/$BASEDIR
fi
-LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
+LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j2.properties
#############################################
TARGET_DIR=${FULL_PATH}/target
CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
diff --git a/utils/webseal-simulator/pom.xml b/utils/webseal-simulator/pom.xml
index 00e84a206d..10787cc6b1 100644
--- a/utils/webseal-simulator/pom.xml
+++ b/utils/webseal-simulator/pom.xml
@@ -80,9 +80,9 @@
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j.properties b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j.properties
deleted file mode 100644
index 4bf9084d14..0000000000
--- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# Define the root logger with appender file
-log4j.rootLogger = INFO, FILE, stdout
-
-# Define the file appender
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=logs/ws-log.out
-
-# Define the layout for file appender
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-
-# Set the maximum file size before rollover
-log4j.appender.FILE.maxFileSize=5MB
-
-# Set the the backup index
-log4j.appender.FILE.maxBackupIndex=10
-
-
-#############################################################
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j2.properties b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j2.properties
new file mode 100644
index 0000000000..77acad8915
--- /dev/null
+++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/log4j2.properties
@@ -0,0 +1,36 @@
+status = error
+dest = err
+name = PropertiesConfig
+
+property.filename = logs/ws-log.out
+
+#filter.threshold.type = ThresholdFilter
+#filter.threshold.level = debug
+
+appender.rolling.type = RollingFile
+appender.rolling.name = RollingFile
+appender.rolling.fileName = ${filename}
+appender.rolling.filePattern = logs/ws-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
+appender.rolling.layout.type = PatternLayout
+appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+appender.rolling.policies.type = Policies
+appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+appender.rolling.policies.size.size=5MB
+appender.rolling.strategy.type = DefaultRolloverStrategy
+appender.rolling.strategy.max = 10
+
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+appender.console.filter.threshold.type = ThresholdFilter
+appender.console.filter.threshold.level = info
+
+logger.rolling.name = RollingAppender
+logger.rolling.level = info
+logger.rolling.additivity = false
+logger.rolling.appenderRef.rolling.ref = RollingFile
+
+rootLogger.level = info
+rootLogger.appenderRef.stdout.ref = STDOUT
+rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb
index 06151fe1fc..14f83c34de 100644
--- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb
+++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb
@@ -1,6 +1,6 @@
-cookbook_file "log4j.properties" do
- path "#{ENV['JETTY_BASE']}/config/sdc-simulator/log4j.properties"
- source "log4j.properties"
+cookbook_file "log4j2.properties" do
+ path "#{ENV['JETTY_BASE']}/config/sdc-simulator/log4j2.properties"
+ source "log4j2.properties"
owner "jetty"
group "jetty"
mode "0755"
diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
index 29babc4b25..014b6c4031 100644
--- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
+++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
@@ -35,7 +35,8 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.ssl.SSLContextBuilder;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.openecomp.sdc.webseal.simulator.conf.Conf;
import javax.net.ssl.SSLContext;
@@ -75,7 +76,7 @@ public class SdcProxy extends HttpServlet {
private static final Set<String> RESERVED_HEADERS = Arrays.stream(ReservedHeaders.values()).map(h -> h.getValue()).collect(Collectors.toSet());
- private final static Logger logger = Logger.getLogger(SdcProxy.class);
+ private final static Logger logger = LogManager.getLogger(SdcProxy.class);
public void init(ServletConfig config) throws ServletException {
super.init(config);