summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2020-04-16 14:59:07 +0100
committerefiacor <fiachra.corcoran@est.tech>2020-04-16 15:03:50 +0100
commit5906de2465975e42e4983abe411f30fa16050fdf (patch)
tree81bf98d48c6e09f9d545f993bcd9416c510ea109
parent8552e04175c7091d0d748e0c0f4b14a0d9321b40 (diff)
Fix sonar issues and reporting
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I29aa54e62d2dfaa6eddb16eb67c325254dfc0e06 Issue-ID: DMAAP-1426
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java4
-rwxr-xr-xdatarouter-prov/pom.xml5
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/package.html10
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/package.html8
-rwxr-xr-xdatarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java7
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/package.html12
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/package.html22
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/package.html10
-rwxr-xr-xdatarouter-subscriber/pom.xml21
-rw-r--r--datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SampleSubscriberServlet.java5
-rw-r--r--datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberMain.java5
-rw-r--r--datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java7
-rw-r--r--datarouter-subscriber/src/main/resources/docker/Dockerfile6
-rw-r--r--datarouter-subscriber/src/main/resources/log4j.properties31
-rw-r--r--datarouter-subscriber/src/main/resources/logback.xml112
-rw-r--r--datarouter-subscriber/src/test/resources/log4j.properties31
-rw-r--r--datarouter-subscriber/src/test/resources/logback-test.xml112
-rwxr-xr-xpom.xml26
18 files changed, 301 insertions, 133 deletions
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
index 388b6793..0d030683 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
@@ -424,7 +424,9 @@ public class NodeServlet extends HttpServlet {
mw.write("X-DMAAP-DR-ROUTING\t" + t.getRouting() + "\n");
}
mw.close();
- meta.renameTo(new File(dbase + ".M"));
+ if (!meta.renameTo(new File(dbase + ".M"))) {
+ eelfLogger.error("Rename of file " + dbase + " failed.");
+ }
}
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
try {
diff --git a/datarouter-prov/pom.xml b/datarouter-prov/pom.xml
index 54f6d85b..223261c6 100755
--- a/datarouter-prov/pom.xml
+++ b/datarouter-prov/pom.xml
@@ -141,11 +141,6 @@
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
- <groupId>org.dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>2.1.1</version>
- </dependency>
- <dependency>
<groupId>org.sonatype.http-testing-harness</groupId>
<artifactId>junit-runner</artifactId>
<scope>test</scope>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/package.html b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/package.html
index 0d051db3..58055eaa 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/package.html
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/package.html
@@ -1,4 +1,4 @@
-#-------------------------------------------------------------------------------
+<!------------------------------------------------------------------------------
# ============LICENSE_START==================================================
# * org.onap.dmaap
# * ===========================================================================
@@ -19,10 +19,12 @@
# *
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
# *
-#-------------------------------------------------------------------------------
+#------------------------------------------------------------------------------->
-<html>
+<!DOCTYPE html>
+<html lang="en">
<head>
+ <title>DMaaP DR Authz Impl package</title>
</head>
<body>
<p>
@@ -55,8 +57,6 @@ class defined in this package, passing it an instance of the <code>ProvDataProvi
implementation.
</li>
</ul>
-</p>
-<p>
Example:
<pre>
<code>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/package.html b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/package.html
index 3b484500..be7e333e 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/package.html
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/package.html
@@ -1,4 +1,4 @@
-#-------------------------------------------------------------------------------
+<!-------------------------------------------------------------------------------
# ============LICENSE_START==================================================
# * org.onap.dmaap
# * ===========================================================================
@@ -19,10 +19,12 @@
# *
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
# *
-#-------------------------------------------------------------------------------
+#------------------------------------------------------------------------------->
-<html>
+<!DOCTYPE html>
+<html lang="en">
<head>
+ <title>DMaaP DR Authz package</title>
</head>
<body>
<p>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java
index 76991ca0..c564db86 100755
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java
@@ -32,6 +32,8 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
@@ -511,10 +513,9 @@ public class StatisticsServlet extends BaseServlet {
ResultSet rs = ps.executeQuery()) {
if ("csv".equals(outputType)) {
resp.setContentType("application/octet-stream");
- Date date = new Date();
- SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-YYYY HH:mm:ss");
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss");
resp.setHeader("Content-Disposition",
- "attachment; filename=\"result:" + dateFormat.format(date) + ".csv\"");
+ "attachment; filename=\"result:" + LocalDateTime.now().format(formatter) + ".csv\"");
eventlogger.info("Generating CSV file from Statistics resultset");
rsToCSV(rs, out);
} else {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/package.html b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/package.html
index c33902cd..f05b765b 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/package.html
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/package.html
@@ -1,4 +1,4 @@
-#-------------------------------------------------------------------------------
+<!-------------------------------------------------------------------------------
# ============LICENSE_START==================================================
# * org.onap.dmaap
# * ===========================================================================
@@ -19,13 +19,17 @@
# *
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
# *
-#-------------------------------------------------------------------------------
+#------------------------------------------------------------------------------->
-<html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>DMaaP DR Provisioning Beans</title>
+</head>
<body>
<p>
This package provides beans to represent the basic provisioning objects of the Data Router application.
-These objects are defined by the document <b>Data Router Release 1 Provisioning API</b> <i>Version 1.2</i>.
+These objects are defined by the document <strong>Data Router Release 1 Provisioning API</strong> <em>Version 1.2</em>.
</p>
</body>
</html>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/package.html b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/package.html
index af08391a..c6263e15 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/package.html
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/package.html
@@ -1,4 +1,4 @@
-#-------------------------------------------------------------------------------
+<!-------------------------------------------------------------------------------
# ============LICENSE_START==================================================
# * org.onap.dmaap
# * ===========================================================================
@@ -19,22 +19,26 @@
# *
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
# *
-#-------------------------------------------------------------------------------
+#------------------------------------------------------------------------------->
-<html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>DMaaP DR Provisioning Servlets</title>
+</head>
<body>
<p>
This package provides the servlets used by the provisioning server for the Data Router application.
-URLs are from the document <b>URLs for DR Release 1</b> <i>Version 1.2</i>.
+URLs are from the document <strong>URLs for DR Release 1</strong> <em>Version 1.2</em>.
</p>
<div class="contentContainer">
-<table class="packageSummary" border="0" cellpadding="3" cellspacing="0">
+<table class="packageSummary" border="0">
<caption><span>URL Path Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr class="altColor">
- <th class="colFirst">URL Path</th>
- <th class="colOne">Symbolic Name</th>
- <th class="colLast">Servlet Name</th>
- <th class="colLast" colspan="4">Allowed Methods</th>
+ <th class="colFirst" scope="col">URL Path</th>
+ <th class="colOne" scope="col">Symbolic Name</th>
+ <th class="colLast" scope="col">Servlet Name</th>
+ <th class="colLast" colspan="4" scope="col">Allowed Methods</th>
</tr>
<tr>
<td class="colFirst" class="colOne">/</td>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/package.html b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/package.html
index 09517fea..a110f130 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/package.html
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/package.html
@@ -1,4 +1,4 @@
-#-------------------------------------------------------------------------------
+<!-------------------------------------------------------------------------------
# ============LICENSE_START==================================================
# * org.onap.dmaap
# * ===========================================================================
@@ -19,9 +19,13 @@
# *
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
# *
-#-------------------------------------------------------------------------------
+#------------------------------------------------------------------------------->
-<html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>DMaaP DR Provisioning Utils</title>
+</head>
<body>
<p>
This package provide various helper classes used by the provisioning server.
diff --git a/datarouter-subscriber/pom.xml b/datarouter-subscriber/pom.xml
index 9390050f..2d97b175 100755
--- a/datarouter-subscriber/pom.xml
+++ b/datarouter-subscriber/pom.xml
@@ -45,6 +45,14 @@
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
@@ -141,10 +149,14 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- <scope>compile</scope>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>powermock-api-mockito</artifactId>
+ <groupId>org.powermock</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
<profiles>
@@ -209,6 +221,7 @@
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
+ <include>**/logback.xml</include>
</includes>
</resource>
</resources>
diff --git a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SampleSubscriberServlet.java b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SampleSubscriberServlet.java
index 993d3253..34a844c6 100644
--- a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SampleSubscriberServlet.java
+++ b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SampleSubscriberServlet.java
@@ -23,6 +23,8 @@
package org.onap.dmaap.datarouter.subscriber;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -37,12 +39,11 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
public class SampleSubscriberServlet extends HttpServlet {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.subscriber.SampleSubscriberServlet");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SampleSubscriberServlet.class);
private static String outputDirectory;
private static String basicAuth;
diff --git a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberMain.java b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberMain.java
index 2e02c88c..6894ddcf 100644
--- a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberMain.java
+++ b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberMain.java
@@ -23,8 +23,9 @@
package org.onap.dmaap.datarouter.subscriber;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.util.Arrays;
-import org.apache.log4j.Logger;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConfiguration;
@@ -40,7 +41,7 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
public class SubscriberMain {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.subscriber.SubscriberMain");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SubscriberMain.class);
/**
* Main class for Subscriber.
diff --git a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java
index ba7aa7af..49cad503 100644
--- a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java
+++ b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java
@@ -23,15 +23,16 @@
package org.onap.dmaap.datarouter.subscriber;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.IOException;
import java.util.Properties;
-import org.apache.log4j.Logger;
public class SubscriberProps {
private static SubscriberProps instance = null;
- private static Logger subLogger = Logger.getLogger("org.onap.dmaap.datarouter.subscriber.internal");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SubscriberProps.class);
private Properties properties;
private SubscriberProps(String propsPath) throws IOException {
@@ -50,7 +51,7 @@ public class SubscriberProps {
try {
instance = new SubscriberProps(propsPath);
} catch (IOException ioe) {
- subLogger.error("IO Exception: " + ioe.getMessage(), ioe);
+ logger.error("IO Exception: " + ioe.getMessage(), ioe);
}
}
return instance;
diff --git a/datarouter-subscriber/src/main/resources/docker/Dockerfile b/datarouter-subscriber/src/main/resources/docker/Dockerfile
index 20a2ca2b..81c9dcca 100644
--- a/datarouter-subscriber/src/main/resources/docker/Dockerfile
+++ b/datarouter-subscriber/src/main/resources/docker/Dockerfile
@@ -36,7 +36,7 @@ RUN chmod 0700 startup.sh
ENTRYPOINT ["sh", "startup.sh"]
RUN groupadd -g 1001 onap \
- && useradd -u 1000 datarouter -g onap \
- && chown -R datarouter:onap /opt/
+ && useradd -u 1000 dradmin -g onap \
+ && chown -R dradmin:onap /opt/ /var/
-USER datarouter \ No newline at end of file
+USER dradmin \ No newline at end of file
diff --git a/datarouter-subscriber/src/main/resources/log4j.properties b/datarouter-subscriber/src/main/resources/log4j.properties
deleted file mode 100644
index bb66ef42..00000000
--- a/datarouter-subscriber/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START==================================================
-# * org.onap.dmaap
-# * ===========================================================================
-# * Copyright � 2017 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====================================================
-# *
-# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
-# *
-#-------------------------------------------------------------------------------
-
-log4j.rootLogger=info,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=/opt/app/subscriber/logs/subscriber.log
-log4j.appender.Root.datePattern='.'yyyyMMdd
-log4j.appender.Root.append=true
-log4j.appender.Root.layout=org.apache.log4j.PatternLayout
-log4j.appender.Root.layout.ConversionPattern=%d %p %t %m%n
diff --git a/datarouter-subscriber/src/main/resources/logback.xml b/datarouter-subscriber/src/main/resources/logback.xml
new file mode 100644
index 00000000..24ffe67f
--- /dev/null
+++ b/datarouter-subscriber/src/main/resources/logback.xml
@@ -0,0 +1,112 @@
+<!--
+ ============LICENSE_START==================================================
+ * org.onap.dmaap
+ * ===========================================================================
+ * Copyright © 2017 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====================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
+-->
+<configuration scan="true" scanPeriod="3 seconds" debug="false">
+ <property name="logDir" value="/var/log/onap/datarouter" />
+ <property name="generalLogName" value="application" />
+ <property name="errorLogName" value="errors" />
+ <property name="defaultPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%X{RequestId}|%X{InvocationId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%msg%n" />
+ <property name="logDirectory" value="${logDir}" />
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF Appenders -->
+ <!-- ============================================================================ -->
+
+ <!-- The EELFAppender is used to record events to the general application
+ log -->
+
+
+ <appender name="EELF"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELF" />
+ </appender>
+
+ <appender name="EELFError"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${errorLogName}.log</file>
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFError"/>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF loggers -->
+ <!-- ============================================================================ -->
+ <logger name="com.att.eelf" level="info" additivity="false">
+ <appender-ref ref="asyncEELF" />
+ </logger>
+
+ <logger name="com.att.eelf.error" level="error" additivity="false">
+ <appender-ref ref="asyncEELFError" />
+ </logger>
+
+ <root level="INFO">
+ <appender-ref ref="asyncEELF" />
+ <appender-ref ref="asyncEELFError" />
+ </root>
+
+</configuration>
diff --git a/datarouter-subscriber/src/test/resources/log4j.properties b/datarouter-subscriber/src/test/resources/log4j.properties
deleted file mode 100644
index b8d349e6..00000000
--- a/datarouter-subscriber/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START==================================================
-# * org.onap.dmaap
-# * ===========================================================================
-# * Copyright � 2017 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====================================================
-# *
-# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
-# *
-#-------------------------------------------------------------------------------
-
-log4j.rootLogger=info,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=./logs/subscriber.log
-log4j.appender.Root.datePattern='.'yyyyMMdd
-log4j.appender.Root.append=true
-log4j.appender.Root.layout=org.apache.log4j.PatternLayout
-log4j.appender.Root.layout.ConversionPattern=%d %p %t %m%n
diff --git a/datarouter-subscriber/src/test/resources/logback-test.xml b/datarouter-subscriber/src/test/resources/logback-test.xml
new file mode 100644
index 00000000..76390505
--- /dev/null
+++ b/datarouter-subscriber/src/test/resources/logback-test.xml
@@ -0,0 +1,112 @@
+<!--
+ ============LICENSE_START==================================================
+ * org.onap.dmaap
+ * ===========================================================================
+ * Copyright © 2017 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====================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
+-->
+<configuration scan="true" scanPeriod="3 seconds" debug="false">
+ <property name="logDir" value="logs/EELF" />
+ <property name="generalLogName" value="application" />
+ <property name="errorLogName" value="errors" />
+ <property name="defaultPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%X{RequestId}|%X{InvocationId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%msg%n" />
+ <property name="logDirectory" value="${logDir}" />
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF Appenders -->
+ <!-- ============================================================================ -->
+
+ <!-- The EELFAppender is used to record events to the general application
+ log -->
+
+
+ <appender name="EELF"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELF" />
+ </appender>
+
+ <appender name="EELFError"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${errorLogName}.log</file>
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFError"/>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF loggers -->
+ <!-- ============================================================================ -->
+ <logger name="com.att.eelf" level="info" additivity="false">
+ <appender-ref ref="asyncEELF" />
+ </logger>
+
+ <logger name="com.att.eelf.error" level="error" additivity="false">
+ <appender-ref ref="asyncEELFError" />
+ </logger>
+
+ <root level="DEBUG">
+ <appender-ref ref="asyncEELF" />
+ <appender-ref ref="asyncEELFError" />
+ </root>
+
+</configuration>
diff --git a/pom.xml b/pom.xml
index 0f2ebfbd..a72ed462 100755
--- a/pom.xml
+++ b/pom.xml
@@ -300,7 +300,7 @@
<exclude>IntegrationSuite.java</exclude>
</excludes>
<argLine>
- --illegal-access=permit
+ ${surefireArgLine} --illegal-access=permit
</argLine>
</configuration>
</plugin>
@@ -374,7 +374,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>3.0.1</version>
+ <version>3.2.0</version>
<configuration>
<failOnError>false</failOnError>
</configuration>
@@ -473,28 +473,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <dataFile>${project.build.directory}/code-coverage/jacoco.exec</dataFile>
- <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</pluginManagement>
</build>