aboutsummaryrefslogtreecommitdiffstats
path: root/test-apis-ci/src/main
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 /test-apis-ci/src/main
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
Diffstat (limited to 'test-apis-ci/src/main')
-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
20 files changed, 159 insertions, 159 deletions
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