summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmettCox <emmett.cox@est.tech>2019-04-08 10:34:31 +0000
committerConor Ward <conor.ward@est.tech>2019-04-08 15:49:44 +0000
commitb60213dc26540543f500b3442b061565907c3cf8 (patch)
tree3d40d1853ed1c545103bbe28cac504d1fa9e704c
parent0fa019897cb79de1def349b8fd0b660d1951681a (diff)
update DR logging to log under one system
Change-Id: I7e21a9c698e49601b090cee350c5a5cc7deb8315 Issue-ID: DMAAP-1050 Signed-off-by: EmmettCox <emmett.cox@est.tech>
-rw-r--r--datarouter-docker-compose/src/main/resources/docker-compose.yml4
-rwxr-xr-xdatarouter-node/pom.xml18
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DRNodeCadiFilter.java13
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/Delivery.java5
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java16
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/IsFrom.java11
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfig.java6
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java50
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java10
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java140
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java17
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java8
-rw-r--r--datarouter-node/src/main/resources/EelfMessages.properties2
-rw-r--r--datarouter-node/src/main/resources/log4j.properties32
-rw-r--r--datarouter-node/src/main/resources/log4j.properties.tmpl11
-rw-r--r--datarouter-node/src/main/resources/logback.xml35
-rw-r--r--datarouter-node/src/main/resources/misc/log4j.properties.tmpl11
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java3
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java1
-rwxr-xr-xdatarouter-prov/pom.xml20
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/ProvAuthorizer.java7
-rwxr-xr-xdatarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/BaseServlet.java64
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServlet.java72
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/FeedServlet.java84
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/GroupServlet.java56
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/InternalServlet.java60
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java32
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java17
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java8
-rwxr-xr-xdatarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/ProxyServlet.java2
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/PublishServlet.java30
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/RouteServlet.java22
-rwxr-xr-xdatarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java6
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java68
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServlet.java96
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SynchronizerTask.java7
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRoute.java5
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EventLogRecord.java2
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Feed.java24
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java10
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/IngressRoute.java5
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/LogRecord.java6
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRoute.java5
-rwxr-xr-xdatarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java6
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Parameters.java5
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Subscription.java27
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/eelf/DebugTraceFilter.java36
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java19
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java41
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/HttpServletUtils.java4
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java23
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/PurgeLogDirTask.java8
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilter.java5
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java18
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/ReportBase.java7
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/VolumeReport.java5
-rw-r--r--datarouter-prov/src/main/resources/log4j.properties68
-rw-r--r--datarouter-prov/src/main/resources/logback.xml30
-rw-r--r--datarouter-prov/src/main/resources/misc/log4j.properties.tmpl76
-rwxr-xr-xdatarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServletTest.java1
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/InternalServletTest.java2
-rwxr-xr-xdatarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/PublishServletTest.java4
-rw-r--r--datarouter-prov/src/test/resources/log4j.properties68
63 files changed, 644 insertions, 910 deletions
diff --git a/datarouter-docker-compose/src/main/resources/docker-compose.yml b/datarouter-docker-compose/src/main/resources/docker-compose.yml
index bd4726aa..f67d7d4c 100644
--- a/datarouter-docker-compose/src/main/resources/docker-compose.yml
+++ b/datarouter-docker-compose/src/main/resources/docker-compose.yml
@@ -24,7 +24,7 @@
version: '2.1'
services:
datarouter-prov:
- image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov
+ image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov
container_name: datarouter-prov
hostname: dmaap-dr-prov
ports:
@@ -49,7 +49,7 @@ services:
- dmaap-dr-prov
datarouter-node:
- image: nexus3.onap.org:10001/onap/dmaap/datarouter-node
+ image: nexus3.onap.org:10001/onap/dmaap/datarouter-node
container_name: datarouter-node
hostname: dmaap-dr-node
ports:
diff --git a/datarouter-node/pom.xml b/datarouter-node/pom.xml
index a12164dc..cab4ce1e 100755
--- a/datarouter-node/pom.xml
+++ b/datarouter-node/pom.xml
@@ -82,6 +82,11 @@
<version>${thoughtworks.version}</version>
</dependency>
<dependency>
+ <groupId>org.codehaus.janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>3.0.7</version>
+ </dependency>
+ <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${qos.logback.version}</version>
@@ -191,12 +196,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
@@ -330,13 +329,6 @@
<include>**/EelfMessages.properties</include>
</includes>
</resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/log4j.properties</include>
- </includes>
- </resource>
</resources>
<plugins>
<plugin>
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DRNodeCadiFilter.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DRNodeCadiFilter.java
index b0122596..30ad1618 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DRNodeCadiFilter.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DRNodeCadiFilter.java
@@ -19,7 +19,8 @@
*/
package org.onap.dmaap.datarouter.node;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.filter.CadiFilter;
@@ -33,7 +34,7 @@ import java.io.IOException;
public class DRNodeCadiFilter extends CadiFilter {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeServlet");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(NodeServlet.class);
DRNodeCadiFilter(boolean init, PropAccess access) throws ServletException {
super(init, access);
@@ -69,11 +70,11 @@ public class DRNodeCadiFilter extends CadiFilter {
HttpServletResponse resp = (HttpServletResponse) response;
String fileid = req.getPathInfo();
if (fileid == null) {
- logger.info("NODE0105 Rejecting bad URI for PUT " + req.getPathInfo() + " from " + req.getRemoteAddr());
+ logger.error("NODE0105 Rejecting bad URI for PUT " + req.getPathInfo() + " from " + req.getRemoteAddr());
try {
resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid request URI. Expecting <feed-publishing-url>/<fileid>.");
} catch (IOException e) {
- logger.error("NODE0541 DRNodeCadiFilter.getFeedId: ", e);
+ logger.error("NODE0541 DRNodeCadiFilter.getFeedId: ", e.getMessage());
}
return null;
}
@@ -83,11 +84,11 @@ public class DRNodeCadiFilter extends CadiFilter {
fileid = fileid.substring(9);
int i = fileid.indexOf('/');
if (i == -1 || i == fileid.length() - 1) {
- logger.info("NODE0105 Rejecting bad URI for PUT (publish) of " + req.getPathInfo() + " from " + req.getRemoteAddr());
+ logger.error("NODE0105 Rejecting bad URI for PUT (publish) of " + req.getPathInfo() + " from " + req.getRemoteAddr());
try {
resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid request URI. Expecting <feed-publishing-url>/<fileid>. Possible missing fileid.");
} catch (IOException e) {
- logger.error("NODE0542 DRNodeCadiFilter.getFeedId: ", e);
+ logger.error("NODE0542 DRNodeCadiFilter.getFeedId: ", e.getMessage());
}
return null;
}
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/Delivery.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/Delivery.java
index d2600d23..501e489c 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/Delivery.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/Delivery.java
@@ -26,7 +26,8 @@ package org.onap.dmaap.datarouter.node;
import java.util.*;
import java.io.*;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
/**
* Main control point for delivering files to destinations.
@@ -41,7 +42,7 @@ import org.apache.log4j.Logger;
* that queue has more files to deliver.
*/
public class Delivery {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.Delivery");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(Delivery.class);
private static class DelItem implements Comparable<DelItem> {
private String pubid;
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java
index 46c46675..cca61707 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java
@@ -31,7 +31,6 @@ import java.util.zip.GZIPInputStream;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Logger;
import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
import org.slf4j.MDC;
@@ -46,8 +45,7 @@ import static org.onap.dmaap.datarouter.node.NodeUtils.isFiletypeGzip;
* the file and its delivery data as well as to attempt delivery.
*/
public class DeliveryTask implements Runnable, Comparable<DeliveryTask> {
- private static Logger loggerDeliveryTask = Logger.getLogger("org.onap.dmaap.datarouter.node.DeliveryTask");
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(DeliveryTask.class);
private DeliveryTaskHelper deliveryTaskHelper;
private String pubid;
@@ -129,7 +127,7 @@ public class DeliveryTask implements Runnable, Comparable<DeliveryTask> {
hdrv.add(new String[]{h, v});
}
} catch (Exception e) {
- loggerDeliveryTask.error("Exception "+ Arrays.toString(e.getStackTrace()), e);
+ eelfLogger.error("Exception "+ Arrays.toString(e.getStackTrace()), e.getMessage());
}
hdrs = hdrv.toArray(new String[hdrv.size()][]);
url = deliveryTaskHelper.getDestURL(fileid);
@@ -249,7 +247,7 @@ public class DeliveryTask implements Runnable, Comparable<DeliveryTask> {
}
deliveryTaskHelper.reportStatus(this, rc, xpubid, rmsg);
} catch (Exception e) {
- loggerDeliveryTask.error("Exception " + Arrays.toString(e.getStackTrace()), e);
+ eelfLogger.error("Exception "+ Arrays.toString(e.getStackTrace()),e);
deliveryTaskHelper.reportException(this, e);
}
}
@@ -274,7 +272,7 @@ public class DeliveryTask implements Runnable, Comparable<DeliveryTask> {
outputStream.close();
} catch (IOException e) {
httpURLConnection.setRequestProperty("Decompression_Status", "FAILURE");
- loggerDeliveryTask.info("Could not decompress file");
+ eelfLogger.info("Could not decompress file");
sendFile(httpURLConnection);
}
@@ -328,7 +326,7 @@ public class DeliveryTask implements Runnable, Comparable<DeliveryTask> {
} catch (ProtocolException pe) {
deliveryTaskHelper.reportDeliveryExtra(this, -1L);
// Rcvd error instead of 100-continue
- loggerDeliveryTask.error("Exception " + Arrays.toString(pe.getStackTrace()), pe);
+ eelfLogger.error("Exception " + Arrays.toString(pe.getStackTrace()), pe);
}
return outputStream;
}
@@ -339,8 +337,8 @@ public class DeliveryTask implements Runnable, Comparable<DeliveryTask> {
void clean() {
datafile.delete();
metafile.delete();
- eelflogger.info(EelfMsgs.INVOKE, newInvocationId);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.INVOKE, newInvocationId);
+ eelfLogger.info(EelfMsgs.EXIT);
hdrs = null;
}
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/IsFrom.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/IsFrom.java
index b8db0309..f7cedd22 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/IsFrom.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/IsFrom.java
@@ -24,7 +24,8 @@
package org.onap.dmaap.datarouter.node;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.IOException;
import java.util.*;
@@ -37,7 +38,7 @@ public class IsFrom {
private long nextcheck;
private String[] ips;
private String fqdn;
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.IsFrom");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(IsFrom.class);
/**
* Configure the JVM DNS cache to have a 10 second TTL. This needs to be called very very early or it won't have any effect.
@@ -70,7 +71,7 @@ public class IsFrom {
hostAddrArray.add(addr.getHostAddress());
}
} catch (UnknownHostException e) {
- logger.debug("IsFrom: UnknownHostEx: " + e.toString(), e);
+ logger.error("IsFrom: UnknownHostEx: " + e.toString(), e.getMessage());
}
ips = hostAddrArray.toArray(new String[0]);
logger.info("IsFrom: DNS ENTRIES FOR FQDN " + fqdn + " : " + Arrays.toString(ips));
@@ -89,9 +90,9 @@ public class IsFrom {
return true;
}
} catch (UnknownHostException e) {
- logger.debug("IsFrom: UnknownHostEx: " + e.toString(), e);
+ logger.error("IsFrom: UnknownHostEx: " + e.toString(), e.getMessage());
} catch (IOException e) {
- logger.debug("IsFrom: Failed to parse IP : " + ip + " : " + e.toString(), e);
+ logger.error("IsFrom: Failed to parse IP : " + ip + " : " + e.toString(), e.getMessage());
}
return false;
}
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfig.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfig.java
index 791eee12..23512a14 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfig.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfig.java
@@ -24,12 +24,14 @@
package org.onap.dmaap.datarouter.node;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Vector;
-import org.apache.log4j.Logger;
/**
* Processed configuration for this node.
@@ -39,7 +41,7 @@ import org.apache.log4j.Logger;
* discarded.
*/
public class NodeConfig {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeConfig");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(NodeConfig.class);
/**
* Raw configuration entry for a data router node
*/
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java
index 8011c632..feee19c1 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java
@@ -26,8 +26,6 @@ package org.onap.dmaap.datarouter.node;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Logger;
-import org.onap.aaf.cadi.PropAccess;
import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
import java.io.File;
@@ -43,7 +41,7 @@ import java.util.Timer;
* Maintain the configuration of a Data Router node
* <p>
* The NodeConfigManager is the single point of contact for servlet, delivery, event logging, and log retention
- * subsystems to access configuration information. (Log4J has its own configuration mechanism).
+ * subsystems to access configuration information.
* <p>
* There are two basic sets of configuration data. The static local configuration data, stored in a local configuration
* file (created as part of installation by SWM), and the dynamic global configuration data fetched from the data router
@@ -51,9 +49,8 @@ import java.util.Timer;
*/
public class NodeConfigManager implements DeliveryQueueHelper {
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(NodeConfigManager.class);
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeConfigManager");
private static NodeConfigManager base = new NodeConfigManager();
private Timer timer = new Timer("Node Configuration Timer", true);
@@ -119,14 +116,12 @@ public class NodeConfigManager implements DeliveryQueueHelper {
Properties drNodeProperties = new Properties();
try {
- logger.info("NODE0301 Loading local config file node.properties");
+ eelfLogger.info("NODE0301 Loading local config file node.properties");
drNodeProperties.load(new FileInputStream(System
.getProperty("org.onap.dmaap.datarouter.node.properties", "/opt/app/datartr/etc/node.properties")));
} catch (Exception e) {
NodeUtils.setIpAndFqdnForEelf("NodeConfigManager");
- eelflogger.error(EelfMsgs.MESSAGE_PROPERTIES_LOAD_ERROR);
- logger.error("NODE0301 Unable to load local configuration file " + System
- .getProperty("org.onap.dmaap.datarouter.node.properties", "/opt/app/datartr/etc/node.properties"), e);
+ eelfLogger.error(EelfMsgs.MESSAGE_PROPERTIES_LOAD_ERROR, System.getProperty("org.onap.dmaap.datarouter.node.properties", "/opt/app/datartr/etc/node.properties"));
}
provurl = drNodeProperties.getProperty("ProvisioningURL", "https://dmaap-dr-prov:8443/internal/prov");
/*
@@ -149,11 +144,10 @@ public class NodeConfigManager implements DeliveryQueueHelper {
provhost = (new URL(provurl)).getHost();
} catch (Exception e) {
NodeUtils.setIpAndFqdnForEelf("NodeConfigManager");
- eelflogger.error(EelfMsgs.MESSAGE_BAD_PROV_URL, provurl);
- logger.error("NODE0302 Bad provisioning server URL " + provurl);
+ eelfLogger.error(EelfMsgs.MESSAGE_BAD_PROV_URL, provurl);
System.exit(1);
}
- logger.info("NODE0303 Provisioning server is " + provhost);
+ eelfLogger.info("NODE0303 Provisioning server is " + provhost);
eventlogurl = drNodeProperties.getProperty("LogUploadURL", "https://feeds-drtr.web.att.com/internal/logs");
provcheck = new IsFrom(provhost);
gfport = Integer.parseInt(drNodeProperties.getProperty("IntHttpPort", "8080"));
@@ -192,11 +186,11 @@ public class NodeConfigManager implements DeliveryQueueHelper {
myname = NodeUtils.getCanonicalName(kstype, ksfile, kspass);
if (myname == null) {
NodeUtils.setIpAndFqdnForEelf("NodeConfigManager");
- eelflogger.error(EelfMsgs.MESSAGE_KEYSTORE_FETCH_ERROR, ksfile);
- logger.error("NODE0309 Unable to fetch canonical name from keystore file " + ksfile);
+ eelfLogger.error(EelfMsgs.MESSAGE_KEYSTORE_FETCH_ERROR, ksfile);
+ eelfLogger.error("NODE0309 Unable to fetch canonical name from keystore file " + ksfile);
System.exit(1);
}
- logger.info("NODE0304 My certificate says my name is " + myname);
+ eelfLogger.info("NODE0304 My certificate says my name is " + myname);
pid = new PublishId(myname);
rdmgr = new RedirManager(redirfile, minrsinterval, timer);
pfetcher = new RateLimitedOperation(minpfinterval, timer) {
@@ -204,7 +198,7 @@ public class NodeConfigManager implements DeliveryQueueHelper {
fetchconfig();
}
};
- logger.info("NODE0305 Attempting to fetch configuration at " + provurl);
+ eelfLogger.info("NODE0305 Attempting to fetch configuration at " + provurl);
pfetcher.request();
}
@@ -277,7 +271,7 @@ public class NodeConfigManager implements DeliveryQueueHelper {
private void fetchconfig() {
try {
- logger.info("NodeConfigMan.fetchConfig: provurl:: " + provurl);
+ eelfLogger.info("NodeConfigMan.fetchConfig: provurl:: " + provurl);
Reader r = new InputStreamReader((new URL(provurl)).openStream());
config = new NodeConfig(new ProvData(r), myname, spooldir, port, nak);
localconfig();
@@ -287,13 +281,13 @@ public class NodeConfigManager implements DeliveryQueueHelper {
try {
rr.run();
} catch (Exception e) {
- logger.error("NODE0518 Exception fetchconfig: " + e);
+ eelfLogger.error("NODE0518 Exception fetchconfig: " + e);
}
}
} catch (Exception e) {
NodeUtils.setIpAndFqdnForEelf("fetchconfigs");
- eelflogger.error(EelfMsgs.MESSAGE_CONF_FAILED, e.toString());
- logger.error("NODE0306 Configuration failed " + e.toString() + " - try again later", e);
+ eelfLogger.error(EelfMsgs.MESSAGE_CONF_FAILED, e.toString());
+ eelfLogger.error("NODE0306 Configuration failed " + e.toString() + " - try again later", e.getMessage());
pfetcher.request();
}
}
@@ -304,11 +298,11 @@ public class NodeConfigManager implements DeliveryQueueHelper {
* seconds), wait a while before fetching again.
*/
public synchronized void gofetch(String remoteAddr) {
- if (provcheck.isReachable(remoteAddr)) {
- logger.info("NODE0307 Received configuration fetch request from provisioning server " + remoteAddr);
+ if (provcheck.isFrom(remoteAddr)) {
+ eelfLogger.info("NODE0307 Received configuration fetch request from provisioning server " + remoteAddr);
pfetcher.request();
} else {
- logger.info("NODE0308 Received configuration fetch request from unexpected server " + remoteAddr);
+ eelfLogger.info("NODE0308 Received configuration fetch request from unexpected server " + remoteAddr);
}
}
@@ -379,7 +373,7 @@ public class NodeConfigManager implements DeliveryQueueHelper {
public String isPublishPermitted(String feedid, String ip) {
return(config.isPublishPermitted(feedid, ip));
}
-
+
/**
* Check who the user is given the feed ID and the offered credentials.
*
@@ -785,15 +779,15 @@ public class NodeConfigManager implements DeliveryQueueHelper {
if (provcheck.isFrom(remoteaddr)) {
String sdir = config.getSpoolDir(subid);
if (sdir != null) {
- logger.info("NODE0310 Received subscription reset request for subscription " + subid
+ eelfLogger.info("NODE0310 Received subscription reset request for subscription " + subid
+ " from provisioning server " + remoteaddr);
} else {
- logger.info("NODE0311 Received subscription reset request for unknown subscription " + subid
+ eelfLogger.info("NODE0311 Received subscription reset request for unknown subscription " + subid
+ " from provisioning server " + remoteaddr);
}
return (sdir);
} else {
- logger.info("NODE0312 Received subscription reset request from unexpected server " + remoteaddr);
+ eelfLogger.info("NODE0312 Received subscription reset request from unexpected server " + remoteaddr);
return (null);
}
}
@@ -848,7 +842,7 @@ public class NodeConfigManager implements DeliveryQueueHelper {
}
return type + "|" + aafInstance + "|" + action;
} catch (Exception e) {
- logger.error("NODE0543 NodeConfigManager.getPermission: ", e);
+ eelfLogger.error("NODE0543 NodeConfigManager.getPermission: ", e.getMessage());
}
return null;
}
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java
index 7ff33ff9..058295d3 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java
@@ -23,7 +23,9 @@
package org.onap.dmaap.datarouter.node;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.servlet.FilterHolder;
@@ -46,7 +48,7 @@ public class NodeMain {
private NodeMain() {
}
- private static Logger nodeMainLogger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeMain");
+ private static EELFLogger nodeMainLogger = EELFManager.getInstance().getLogger(NodeMain.class);
class Inner {
InputStream getCadiProps() {
@@ -80,7 +82,7 @@ public class NodeMain {
wait();
} catch (Exception exception) {
nodeMainLogger
- .debug("NodeMain: waitForConfig exception. Exception Message:- " + exception.toString(),
+ .error("NodeMain: waitForConfig exception. Exception Message:- " + exception.toString(),
exception);
}
}
@@ -197,7 +199,7 @@ public class NodeMain {
server.start();
nodeMainLogger.info("NODE00006 Node Server started-" + server.getState());
} catch (Exception e) {
- nodeMainLogger.info("NODE00006 Jetty failed to start. Reporting will we unavailable", e);
+ nodeMainLogger.info("NODE00006 Jetty failed to start. Reporting will we unavailable", e.getMessage());
}
server.join();
nodeMainLogger.info("NODE00007 Node Server joined - " + server.getState());
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 41661377..a9842116 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
@@ -26,7 +26,6 @@ package org.onap.dmaap.datarouter.node;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Logger;
import org.jetbrains.annotations.Nullable;
import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
import org.slf4j.MDC;
@@ -62,10 +61,9 @@ import static org.onap.dmaap.datarouter.node.NodeUtils.sendResponseError;
*/
public class NodeServlet extends HttpServlet {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeServlet");
private static NodeConfigManager config;
private static Pattern MetaDataPattern;
- private static EELFLogger eelflogger = EELFManager.getInstance().getLogger(NodeServlet.class);
+ private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(NodeServlet.class);
private final Delivery delivery;
static {
@@ -90,13 +88,13 @@ public class NodeServlet extends HttpServlet {
@Override
public void init() {
config = NodeConfigManager.getInstance();
- logger.info("NODE0101 Node Servlet Configured");
+ eelfLogger.info("NODE0101 Node Servlet Configured");
}
private boolean down(HttpServletResponse resp) throws IOException {
if (config.isShutdown() || !config.isConfigured()) {
- sendResponseError(resp, HttpServletResponse.SC_SERVICE_UNAVAILABLE, logger);
- logger.info("NODE0102 Rejecting request: Service is being quiesced");
+ sendResponseError(resp, HttpServletResponse.SC_SERVICE_UNAVAILABLE, eelfLogger);
+ eelfLogger.info("NODE0102 Rejecting request: Service is being quiesced");
return true;
}
return false;
@@ -109,9 +107,9 @@ public class NodeServlet extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
NodeUtils.setIpAndFqdnForEelf("doGet");
NodeUtils.setRequestIdAndInvocationId(req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
getIdFromPath(req) + "");
try {
if (down(resp)) {
@@ -119,7 +117,7 @@ public class NodeServlet extends HttpServlet {
}
} catch (IOException ioe) {
- logger.error("IOException" + ioe.getMessage());
+ eelfLogger.error("IOException" + ioe.getMessage());
}
String path = req.getPathInfo();
String qs = req.getQueryString();
@@ -140,10 +138,10 @@ public class NodeServlet extends HttpServlet {
}
}
- logger.info("NODE0103 Rejecting invalid GET of " + path + " from " + ip);
- sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, logger);
+ eelfLogger.info("NODE0103 Rejecting invalid GET of " + path + " from " + ip);
+ sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, eelfLogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -154,14 +152,14 @@ public class NodeServlet extends HttpServlet {
protected void doPut(HttpServletRequest req, HttpServletResponse resp) {
NodeUtils.setIpAndFqdnForEelf("doPut");
NodeUtils.setRequestIdAndInvocationId(req);
- eelflogger.info(EelfMsgs.ENTRY);
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
+ eelfLogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
getIdFromPath(req) + "");
try {
common(req, resp, true);
} catch (IOException ioe) {
- logger.error("IOException" + ioe.getMessage());
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.error("IOException" + ioe.getMessage());
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -172,14 +170,14 @@ public class NodeServlet extends HttpServlet {
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) {
NodeUtils.setIpAndFqdnForEelf("doDelete");
NodeUtils.setRequestIdAndInvocationId(req);
- eelflogger.info(EelfMsgs.ENTRY);
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
+ eelfLogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
getIdFromPath(req) + "");
try {
common(req, resp, false);
} catch (IOException ioe) {
- logger.error("IOException " + ioe.getMessage());
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.error("IOException " + ioe.getMessage());
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -201,21 +199,21 @@ public class NodeServlet extends HttpServlet {
}
String credentials = req.getHeader("Authorization");
if (credentials == null) {
- logger.info("NODE0106 Rejecting unauthenticated PUT or DELETE of " + req.getPathInfo() + " from " + req
+ eelfLogger.error("NODE0106 Rejecting unauthenticated PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Authorization header required");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
if (fileid.startsWith("/publish/")) {
fileid = fileid.substring(9);
int i = fileid.indexOf('/');
if (i == -1 || i == fileid.length() - 1) {
- logger.info("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
+ eelfLogger.error("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_NOT_FOUND,
"Invalid request URI. Expecting <feed-publishing-url>/<fileid>. Possible missing fileid.");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
feedid = fileid.substring(0, i);
@@ -227,13 +225,13 @@ public class NodeServlet extends HttpServlet {
if (!(aafInstance.equalsIgnoreCase("legacy"))) {
isAAFFeed = true;
String permission = config.getPermission(aafInstance);
- logger.info("NodeServlet.common() permission string - " + permission);
+ eelfLogger.info("NodeServlet.common() permission string - " + permission);
//Check in CADI Framework API if user has AAF permission or not
if (!req.isUserInRole(permission)) {
String message = "AAF disallows access to permission string - " + permission;
- logger.info("NODE0106 Rejecting unauthenticated PUT or DELETE of " + req.getPathInfo() + " from " + req.getRemoteAddr());
+ eelfLogger.error("NODE0106 Rejecting unauthenticated PUT or DELETE of " + req.getPathInfo() + " from " + req.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_FORBIDDEN, message);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
}
@@ -246,9 +244,9 @@ public class NodeServlet extends HttpServlet {
targets = config.getTargets(feedid);
} else if (fileid.startsWith("/internal/publish/")) {
if (!config.isAnotherNode(credentials, ip)) {
- logger.info("NODE0107 Rejecting unauthorized node-to-node transfer attempt from " + ip);
+ eelfLogger.error("NODE0107 Rejecting unauthorized node-to-node transfer attempt from " + ip);
resp.sendError(HttpServletResponse.SC_FORBIDDEN);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
fileid = fileid.substring(18);
@@ -256,19 +254,19 @@ public class NodeServlet extends HttpServlet {
user = "datartr"; // SP6 : Added usr as datartr to avoid null entries for internal routing
targets = config.parseRouting(req.getHeader("X-DMAAP-DR-ROUTING"));
} else {
- logger.info("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
+ eelfLogger.error("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_NOT_FOUND,
"Invalid request URI. Expecting <feed-publishing-url>/<fileid>.");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
if (fileid.indexOf('/') != -1) {
- logger.info("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
+ eelfLogger.error("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_NOT_FOUND,
"Invalid request URI. Expecting <feed-publishing-url>/<fileid>.");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
String qs = req.getQueryString();
@@ -287,18 +285,18 @@ public class NodeServlet extends HttpServlet {
if (!isAAFFeed) {
String reason = config.isPublishPermitted(feedid, credentials, ip);
if (reason != null) {
- logger.info("NODE0111 Rejecting unauthorized publish attempt to feed " + PathUtil.cleanString(feedid) + " fileid " + PathUtil.cleanString(fileid) + " from " + PathUtil.cleanString(ip) + " reason " + PathUtil.cleanString(reason));
+ eelfLogger.error("NODE0111 Rejecting unauthorized publish attempt to feed " + PathUtil.cleanString(feedid) + " fileid " + PathUtil.cleanString(fileid) + " from " + PathUtil.cleanString(ip) + " reason " + PathUtil.cleanString(reason));
resp.sendError(HttpServletResponse.SC_FORBIDDEN, reason);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
user = config.getAuthUser(feedid, credentials);
} else {
String reason = config.isPublishPermitted(feedid, ip);
if (reason != null) {
- logger.info("NODE0111 Rejecting unauthorized publish attempt to feed " + PathUtil.cleanString(feedid) + " fileid " + PathUtil.cleanString(fileid) + " from " + PathUtil.cleanString(ip) + " reason Invalid AAF user- " + PathUtil.cleanString(reason));
+ eelfLogger.error("NODE0111 Rejecting unauthorized publish attempt to feed " + PathUtil.cleanString(feedid) + " fileid " + PathUtil.cleanString(fileid) + " from " + PathUtil.cleanString(ip) + " reason Invalid AAF user- " + PathUtil.cleanString(reason));
String message = "Invalid AAF user- " + PathUtil.cleanString(reason);
- logger.info("NODE0106 Rejecting unauthenticated PUT or DELETE of " + PathUtil.cleanString(req.getPathInfo()) + " from " + PathUtil.cleanString(req.getRemoteAddr()));
+ eelfLogger.info("NODE0106 Rejecting unauthenticated PUT or DELETE of " + PathUtil.cleanString(req.getPathInfo()) + " from " + PathUtil.cleanString(req.getRemoteAddr()));
resp.sendError(HttpServletResponse.SC_FORBIDDEN, message);
return;
}
@@ -319,9 +317,9 @@ public class NodeServlet extends HttpServlet {
port = ":" + iport;
}
String redirto = "https://" + newnode + port + "/publish/" + feedid + "/" + fileid;
- logger.info("NODE0108 Redirecting publish attempt for feed " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip) + " to " + PathUtil.cleanString(redirto)); //Fortify scan fixes - log forging
+ eelfLogger.info("NODE0108 Redirecting publish attempt for feed " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip) + " to " + PathUtil.cleanString(redirto)); //Fortify scan fixes - log forging
resp.sendRedirect(PathUtil.cleanString(redirto)); //Fortify scan fixes-open redirect - 2 issues
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
resp.setHeader("X-DMAAP-DR-PUBLISH-ID", pubid);
@@ -366,15 +364,15 @@ public class NodeServlet extends HttpServlet {
}
if ("x-dmaap-dr-meta".equals(hnlc)) {
if (hv.length() > 4096) {
- logger.info("NODE0109 Rejecting publish attempt with metadata too long for feed " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip)); //Fortify scan fixes - log forging
+ eelfLogger.error("NODE0109 Rejecting publish attempt with metadata too long for feed " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip)); //Fortify scan fixes - log forging
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Metadata too long");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
if (!MetaDataPattern.matcher(hv.replaceAll("\\\\.", "X")).matches()) {
- logger.info("NODE0109 Rejecting publish attempt with malformed metadata for feed " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip)); //Fortify scan fixes - log forging
+ eelfLogger.error("NODE0109 Rejecting publish attempt with malformed metadata for feed " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip)); //Fortify scan fixes - log forging
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Malformed metadata");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
}
@@ -407,10 +405,10 @@ public class NodeServlet extends HttpServlet {
try {
exlen = Long.parseLong(req.getHeader("Content-Length"));
} catch (Exception e) {
- logger.error("NODE0529 Exception common: " + e);
+ eelfLogger.error("NODE0529 Exception common: " + e);
}
StatusLog.logPubFail(pubid, feedid, logurl, req.getMethod(), ctype, exlen, data.length(), ip, user, ioe.getMessage());
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
throw ioe;
}
Path dpath = Paths.get(fbase);
@@ -439,51 +437,51 @@ public class NodeServlet extends HttpServlet {
try {
exlen = Long.parseLong(req.getHeader("Content-Length"));
} catch (Exception e) {
- logger.debug("NODE00000 Exception common: " + e);
+ eelfLogger.error("NODE00000 Exception common: " + e.getMessage());
}
StatusLog.logPubFail(pubid, feedid, logurl, req.getMethod(), ctype, exlen, data.length(), ip, user, ioe.getMessage());
//Fortify scan fixes - log forging
- logger.info("NODE0110 IO Exception while closing IO stream " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip) + " " + ioe.toString(), ioe);
+ eelfLogger.error("NODE0110 IO Exception while closing IO stream " + PathUtil.cleanString(feedid) + " user " + PathUtil.cleanString(user) + " ip " + PathUtil.cleanString(ip) + " " + ioe.toString(), ioe);
throw ioe;
}
StatusLog.logPub(pubid, feedid, logurl, req.getMethod(), ctype, data.length(), ip, user, HttpServletResponse.SC_NO_CONTENT);
} catch (IOException ioe) {
- logger.info("NODE0110 IO Exception receiving publish attempt for feed " + feedid + " user " + user + " ip " + ip + " " + ioe.toString(), ioe);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.error("NODE0110 IO Exception receiving publish attempt for feed " + feedid + " user " + user + " ip " + ip + " " + ioe.toString(), ioe);
+ eelfLogger.info(EelfMsgs.EXIT);
throw ioe;
} finally {
if (is != null) {
try {
is.close();
} catch (Exception e) {
- logger.error("NODE0530 Exception common: " + e);
+ eelfLogger.error("NODE0530 Exception common: " + e);
}
}
if (dos != null) {
try {
dos.close();
} catch (Exception e) {
- logger.error("NODE0531 Exception common: " + e);
+ eelfLogger.error("NODE0531 Exception common: " + e);
}
}
if (mw != null) {
try {
mw.close();
} catch (Exception e) {
- logger.error("NODE0532 Exception common: " + e);
+ eelfLogger.error("NODE0532 Exception common: " + e);
}
}
try {
data.delete();
} catch (Exception e) {
- logger.error("NODE0533 Exception common: " + e);
+ eelfLogger.error("NODE0533 Exception common: " + e);
}
try {
meta.delete();
} catch (Exception e) {
- logger.error("NODE0534 Exception common: " + e);
+ eelfLogger.error("NODE0534 Exception common: " + e);
}
}
}
@@ -493,11 +491,11 @@ public class NodeServlet extends HttpServlet {
fileid = fileid.substring(8);
int i = fileid.indexOf('/');
if (i == -1 || i == fileid.length() - 1) {
- logger.info("NODE0112 Rejecting bad URI for DELETE of " + req.getPathInfo() + " from " + req
+ eelfLogger.error("NODE0112 Rejecting bad URI for DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_NOT_FOUND,
"Invalid request URI. Expecting <subId>/<pubId>.");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return;
}
String subscriptionId = fileid.substring(0, i);
@@ -511,43 +509,43 @@ public class NodeServlet extends HttpServlet {
}
boolean result = delivery.markTaskSuccess(config.getSpoolBase() + "/s/" + subIdDir + "/" + subId, pubid);
if (result) {
- logger.info("NODE0115 Successfully deleted files (" + pubid + ", " + pubid + ".M) from DR Node: "
+ eelfLogger.info("NODE0115 Successfully deleted files (" + pubid + ", " + pubid + ".M) from DR Node: "
+ config.getMyName());
resp.setStatus(HttpServletResponse.SC_OK);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
} else {
- logger.error("NODE0116 " + errorMessage);
+ eelfLogger.error("NODE0116 " + errorMessage);
resp.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found on server.");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
} catch (IOException ioe) {
- logger.error("NODE0117 Unable to delete files (" + pubid + ", " + pubid + ".M) from DR Node: "
+ eelfLogger.error("NODE0117 Unable to delete files (" + pubid + ", " + pubid + ".M) from DR Node: "
+ config.getMyName() + ". Error: " + ioe.getMessage());
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@Nullable
private String getFileId(HttpServletRequest req, HttpServletResponse resp) throws IOException {
if (down(resp)) {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return null;
}
if (!req.isSecure()) {
- logger.info(
+ eelfLogger.error(
"NODE0104 Rejecting insecure PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_FORBIDDEN, "https required on publish requests");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return null;
}
String fileid = req.getPathInfo();
if (fileid == null) {
- logger.info("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
+ eelfLogger.error("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
resp.sendError(HttpServletResponse.SC_NOT_FOUND,
"Invalid request URI. Expecting <feed-publishing-url>/<fileid>.");
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return null;
}
return fileid;
@@ -557,16 +555,16 @@ public class NodeServlet extends HttpServlet {
try {
boolean deletePermitted = config.isDeletePermitted(subscriptionId);
if (!deletePermitted) {
- logger.error("NODE0113 " + errorMessage + " Error: Subscription "
+ eelfLogger.error("NODE0113 " + errorMessage + " Error: Subscription "
+ subscriptionId + " is not a privileged subscription");
resp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return false;
}
} catch (NullPointerException npe) {
- logger.error("NODE0114 " + errorMessage + " Error: Subscription " + subscriptionId + " does not exist");
+ eelfLogger.error("NODE0114 " + errorMessage + " Error: Subscription " + subscriptionId + " does not exist");
resp.sendError(HttpServletResponse.SC_NOT_FOUND);
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
return false;
}
return true;
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java
index d2ab8034..4601f99c 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java
@@ -44,7 +44,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
import org.slf4j.MDC;
@@ -57,7 +56,6 @@ public class NodeUtils {
private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(NodeUtils.class);
- private static Logger nodeUtilsLogger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeUtils");
private NodeUtils() {
}
@@ -99,7 +97,7 @@ public class NodeUtils {
md.update(key.getBytes());
return (getAuthHdr(node, base64Encode(md.digest())));
} catch (Exception exception) {
- nodeUtilsLogger
+ eelfLogger
.error("Exception in generating Credentials for given node name:= " + exception.toString(),
exception);
return (null);
@@ -122,14 +120,13 @@ public class NodeUtils {
try (FileInputStream fileInputStream = new FileInputStream(ksfile)) {
ks.load(fileInputStream, kspass.toCharArray());
} catch (IOException ioException) {
- nodeUtilsLogger.error("IOException occurred while opening FileInputStream: " + ioException.getMessage(),
+ eelfLogger.error("IOException occurred while opening FileInputStream: " + ioException.getMessage(),
ioException);
return (null);
}
} catch (Exception e) {
setIpAndFqdnForEelf("getCanonicalName");
eelfLogger.error(EelfMsgs.MESSAGE_KEYSTORE_LOAD_ERROR, ksfile, e.toString());
- nodeUtilsLogger.error("NODE0401 Error loading my keystore file + " + ksfile + " " + e.toString(), e);
return (null);
}
return (getCanonicalName(ks));
@@ -164,7 +161,7 @@ public class NodeUtils {
}
}
} catch (Exception e) {
- nodeUtilsLogger.error("NODE0402 Error extracting my name from my keystore file " + e.toString(), e);
+ eelfLogger.error("NODE0402 Error extracting my name from my keystore file " + e.toString(), e.getMessage());
}
return (null);
}
@@ -179,7 +176,7 @@ public class NodeUtils {
try {
return (InetAddress.getByName(ip).getAddress());
} catch (Exception exception) {
- nodeUtilsLogger
+ eelfLogger
.error("Exception in generating byte array for given IP address := " + exception.toString(),
exception);
}
@@ -258,7 +255,7 @@ public class NodeUtils {
MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
} catch (Exception exception) {
- nodeUtilsLogger
+ eelfLogger
.error("Exception in generating byte array for given IP address := " + exception.toString(),
exception);
}
@@ -282,7 +279,7 @@ public class NodeUtils {
MDC.put("InvocationId", invId);
}
- public static void sendResponseError(HttpServletResponse response, int errorCode, Logger intlogger) {
+ public static void sendResponseError(HttpServletResponse response, int errorCode, EELFLogger intlogger) {
try {
response.sendError(errorCode);
} catch (IOException ioe) {
@@ -302,7 +299,7 @@ public class NodeUtils {
return true;
}catch (IOException e){
- nodeUtilsLogger.error("NODE0403 " + file.toString() + " Not in gzip(gz) format: " + e.toString() + e);
+ eelfLogger.error("NODE0403 " + file.toString() + " Not in gzip(gz) format: " + e.toString() + e);
return false;
}
}
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java
index a9c5c6fe..1af7dda4 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java
@@ -29,7 +29,6 @@ import java.util.*;
import org.json.*;
import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
-import org.apache.log4j.Logger;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
@@ -41,8 +40,7 @@ import com.att.eelf.configuration.EELFManager;
* provisioning server to construct arrays of raw configuration entries.
*/
public class ProvData {
- private static EELFLogger eelflogger = EELFManager.getInstance().getLogger(ProvData.class);
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.ProvData");
+ private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(ProvData.class);
private NodeConfig.ProvNode[] pn;
private NodeConfig.ProvParam[] pp;
private NodeConfig.ProvFeed[] pf;
@@ -253,8 +251,8 @@ public class ProvData {
}
} catch (JSONException jse) {
NodeUtils.setIpAndFqdnForEelf("ProvData");
- eelflogger.error(EelfMsgs.MESSAGE_PARSING_ERROR, jse.toString());
- logger.error("NODE0201 Error parsing configuration data from provisioning server " + jse.toString(), jse);
+ eelfLogger.error(EelfMsgs.MESSAGE_PARSING_ERROR, jse.toString());
+ eelfLogger.error("NODE0201 Error parsing configuration data from provisioning server " + jse.toString(), jse);
throw new IOException(jse.toString(), jse);
}
pn = pnv.toArray(new NodeConfig.ProvNode[pnv.size()]);
diff --git a/datarouter-node/src/main/resources/EelfMessages.properties b/datarouter-node/src/main/resources/EelfMessages.properties
index 27f83527..ed716f8a 100644
--- a/datarouter-node/src/main/resources/EelfMessages.properties
+++ b/datarouter-node/src/main/resources/EelfMessages.properties
@@ -74,5 +74,5 @@ MESSAGE_BAD_PROV_URL=EELF0005E| Bad provisioning server URL {0}
MESSAGE_KEYSTORE_FETCH_ERROR=EELF0006E| Unable to fetch canonical name from keystore file {0}
-MESSAGE_PROPERTIES_LOAD_ERROR=EELF0007E| Unable to load local configuration file - etc/node.properties
+MESSAGE_PROPERTIES_LOAD_ERROR=EELF0007E| Unable to load local configuration file - {0}
diff --git a/datarouter-node/src/main/resources/log4j.properties b/datarouter-node/src/main/resources/log4j.properties
deleted file mode 100644
index 5b2f019f..00000000
--- a/datarouter-node/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,32 +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.debug=FALSE
-log4j.rootLogger=INFO,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=/root/node.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 %m%n
-!
diff --git a/datarouter-node/src/main/resources/log4j.properties.tmpl b/datarouter-node/src/main/resources/log4j.properties.tmpl
deleted file mode 100644
index 299edbfe..00000000
--- a/datarouter-node/src/main/resources/log4j.properties.tmpl
+++ /dev/null
@@ -1,11 +0,0 @@
-cat <<!EOF
-log4j.debug=FALSE
-log4j.rootLogger=INFO,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=C:/Users/sg481n/node.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 %m%n
-!EOF
diff --git a/datarouter-node/src/main/resources/logback.xml b/datarouter-node/src/main/resources/logback.xml
index 9bb1b732..2ce2050c 100644
--- a/datarouter-node/src/main/resources/logback.xml
+++ b/datarouter-node/src/main/resources/logback.xml
@@ -42,14 +42,9 @@
<!-- name="policyLogName" value="policy"-->
<property name="errorLogName" value="errors" />
<!-- name="metricsLogName" value="metrics" -->
- <!-- name="auditLogName" value="audit" -->
- <!-- name="debugLogName" value="debug" -->
<property name="jettyAndNodeLogName" value="node"></property>
<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="jettyAndNodeLoggerPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%thread|%.-5level|%msg%n" />
-
- <property name="debugLoggerPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{InvocationId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|[%caller{3}]|%msg%n" />
-
<property name="logDirectory" value="${logDir}" />
<!-- property name="debugLogDirectory" value="${debugDir}/${componentName}" /-->
@@ -327,32 +322,6 @@
<!-- ============================================================================ -->
- <!--appender name="EELFDebug"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${debugLogDirectory}/${debugLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>${debugLogDirectory}/${debugLogName}.%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>${debugLoggerPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="EELFDebug" />
- <includeCallerData>true</includeCallerData>
- </appender-->
-
-
<!-- ============================================================================ -->
<!-- EELF loggers -->
<!-- ============================================================================ -->
@@ -396,10 +365,10 @@
- <root level="INFO">
+ <root level="TRACE">
<appender-ref ref="asyncEELF" />
<appender-ref ref="asyncEELFError" />
- <appender-ref ref="asyncEELFjettyAndNodelog" />
+ <appender-ref ref="asyncEELFjettyAndNodelog" />
</root>
</configuration>
diff --git a/datarouter-node/src/main/resources/misc/log4j.properties.tmpl b/datarouter-node/src/main/resources/misc/log4j.properties.tmpl
deleted file mode 100644
index 24bd3df0..00000000
--- a/datarouter-node/src/main/resources/misc/log4j.properties.tmpl
+++ /dev/null
@@ -1,11 +0,0 @@
-cat <<!EOF
-log4j.debug=FALSE
-log4j.rootLogger=INFO,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=${DRTR_NODE_LOGS:-logs}/node.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 %m%n
-!EOF
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
index 99e34c6f..db71ceae 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
@@ -294,8 +294,7 @@ public class NodeServletTest {
private void verifyEnteringExitCalled(ListAppender<ILoggingEvent> listAppender) {
assertEquals("EELF0004I Entering data router node component with RequestId and InvocationId", listAppender.list.get(0).getMessage());
- assertEquals("EELF0005I Exiting data router node component with RequestId and InvocationId", listAppender.list.get(2).getMessage());
- assertEquals(3, listAppender.list.size());
+ assertEquals("EELF0005I Exiting data router node component with RequestId and InvocationId", listAppender.list.get(listAppender.list.size() -1).getMessage());
}
private void setUpConfig() throws IllegalAccessException {
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java
index ecced952..662f2cc0 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java
@@ -20,7 +20,6 @@
package org.onap.dmaap.datarouter.node;
-import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;
diff --git a/datarouter-prov/pom.xml b/datarouter-prov/pom.xml
index 19bbf4fa..d0f757bd 100755
--- a/datarouter-prov/pom.xml
+++ b/datarouter-prov/pom.xml
@@ -238,12 +238,6 @@
<version>${jetty.version}</version>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.197</version>
@@ -376,20 +370,6 @@
<include>**/EelfMessages.properties</include>
</includes>
</resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/log4j.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/log4j.properties</include>
- </includes>
- </resource>
</resources>
<plugins>
<plugin>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/ProvAuthorizer.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/ProvAuthorizer.java
index 525c518e..745e339d 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/ProvAuthorizer.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/authz/impl/ProvAuthorizer.java
@@ -27,7 +27,8 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.dmaap.datarouter.authz.AuthorizationResponse;
import org.onap.dmaap.datarouter.authz.Authorizer;
import org.onap.dmaap.datarouter.authz.impl.AuthzResource.ResourceType;
@@ -39,7 +40,7 @@ import org.onap.dmaap.datarouter.authz.impl.AuthzResource.ResourceType;
*/
public class ProvAuthorizer implements Authorizer {
- private Logger log;
+ private EELFLogger log;
private ProvDataProvider provData;
private static final String SUBJECT_HEADER = "X-DMAAP-DR-ON-BEHALF-OF"; // HTTP header carrying requester identity
@@ -49,7 +50,7 @@ public class ProvAuthorizer implements Authorizer {
*/
public ProvAuthorizer(ProvDataProvider provData) {
this.provData = provData;
- this.log = Logger.getLogger(this.getClass());
+ this.log = EELFManager.getInstance().getLogger(this.getClass());
}
/**
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/BaseServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/BaseServlet.java
index 50ec1b45..deb78b16 100755
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/BaseServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/BaseServlet.java
@@ -24,8 +24,30 @@
package org.onap.dmaap.datarouter.provisioning;
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
+
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_IP_ADDRESS;
+import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME;
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.security.cert.X509Certificate;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -44,22 +66,10 @@ import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
import java.security.GeneralSecurityException;
-import java.security.cert.X509Certificate;
-import java.sql.Connection;
-import java.sql.SQLException;
import java.util.*;
import java.util.regex.Pattern;
-import static com.att.eelf.configuration.Configuration.*;
/**
* This is the base class for all Servlets in the provisioning code. It provides standard constants and some common
@@ -216,11 +226,11 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
/**
* This logger is used to log provisioning events
*/
- protected static Logger eventlogger;
+ protected static EELFLogger eventlogger;
/**
* This logger is used to log internal events (errors, etc.)
*/
- protected static Logger intlogger;
+ protected static EELFLogger intlogger;
/**
* Authorizer - interface to the Policy Engine
*/
@@ -249,11 +259,11 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
* Initialize data common to all the provisioning server servlets.
*/
protected BaseServlet() {
- if (eventlogger == null) {
- eventlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.events");
+ if(eventlogger == null) {
+ this.eventlogger = EELFManager.getInstance().getLogger("EventLog");
}
- if (intlogger == null) {
- intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ if(intlogger == null) {
+ this.intlogger = EELFManager.getInstance().getLogger("InternalLog");
}
if (authz == null) {
authz = new ProvAuthorizer(this);
@@ -370,7 +380,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
return "Unauthorized address: " + remote;
}
} catch (UnknownHostException e) {
- intlogger.error("PROV0051 BaseServlet.isAuthorizedForProvisioning: ", e);
+ intlogger.error("PROV0051 BaseServlet.isAuthorizedForProvisioning: ", e.getMessage());
return "Unauthorized address: " + remote;
}
// Does remote have a valid certificate?
@@ -419,7 +429,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
return true;
}
} catch (UnknownHostException e) {
- intlogger.error("PROV0052 BaseServlet.isAuthorizedForInternal: ", e);
+ intlogger.error("PROV0052 BaseServlet.isAuthorizedForInternal: ", e.getMessage());
}
return false;
}
@@ -463,7 +473,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
}
}
} catch (UnknownHostException e) {
- intlogger.error("PROV0053 BaseServlet.addressMatchesNetwork: ", e);
+ intlogger.error("PROV0053 BaseServlet.addressMatchesNetwork: ", e.getMessage());
return false;
}
return true;
@@ -520,7 +530,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
intlogger.debug("PROV0003 DNS lookup: " + nodes[i] + " => " + na[i].toString());
} catch (UnknownHostException e) {
na[i] = null;
- intlogger.warn("PROV0004 Cannot lookup " + nodes[i] + ": " + e);
+ intlogger.warn("PROV0004 Cannot lookup " + nodes[i] + ": " + e.getMessage());
}
}
@@ -548,7 +558,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
intlogger.debug("PROV0003 DNS lookup: " + pods[i] + " => " + na[i].toString());
} catch (UnknownHostException e) {
na[i] = null;
- intlogger.warn("PROV0004 Cannot lookup " + pods[i] + ": " + e);
+ intlogger.warn("PROV0004 Cannot lookup " + pods[i] + ": " + e.getMessage());
}
}
podAddresses = na;
@@ -574,7 +584,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
try (InputStream inStream = getClass().getClassLoader().getResourceAsStream(MAILCONFIG_FILE)) {
mailprops.load(inStream);
} catch (IOException e) {
- intlogger.fatal("PROV9003 Opening properties: " + e.getMessage());
+ intlogger.error("PROV9003 Opening properties: " + e.getMessage());
System.exit(1);
}
}
@@ -1081,7 +1091,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
}
return type + "|" + aafInstance + "|" + action;
} catch (Exception e) {
- intlogger.error("PROV7005 BaseServlet.getFeedPermission: ", e);
+ intlogger.error("PROV7005 BaseServlet.getFeedPermission: ", e.getMessage());
}
return null;
}
@@ -1129,7 +1139,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
}
return type + "|" + aafInstance + "|" + action;
} catch (Exception e) {
- intlogger.error("PROV7005 BaseServlet.getSubscriberPermission: ", e);
+ intlogger.error("PROV7005 BaseServlet.getSubscriberPermission: ", e.getMessage());
}
return null;
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServlet.java
index 9bc91620..86e0268d 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServlet.java
@@ -52,7 +52,7 @@ import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.send
public class DRFeedsServlet extends ProxyServlet {
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(DRFeedsServlet.class);
/**
@@ -61,17 +61,17 @@ public class DRFeedsServlet extends ProxyServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "DELETE not allowed for the drFeedsURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -82,15 +82,15 @@ public class DRFeedsServlet extends ProxyServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -103,7 +103,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -113,7 +113,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Bad URL.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -123,7 +123,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -139,12 +139,12 @@ public class DRFeedsServlet extends ProxyServlet {
message = "This feed does not exist in the database.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
} else {
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(FEEDFULL_CONTENT_TYPE);
try {
@@ -168,7 +168,7 @@ public class DRFeedsServlet extends ProxyServlet {
String t = JSONUtilities.createJSONArray(list);
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(FEEDLIST_CONTENT_TYPE);
try {
@@ -178,7 +178,7 @@ public class DRFeedsServlet extends ProxyServlet {
}
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -188,17 +188,17 @@ public class DRFeedsServlet extends ProxyServlet {
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "PUT not allowed for the drFeedsURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -209,15 +209,15 @@ public class DRFeedsServlet extends ProxyServlet {
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPost", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -230,7 +230,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -240,7 +240,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Bad URL.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -251,7 +251,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -260,7 +260,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -272,7 +272,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Cannot create feed; the maximum number of feeds has been configured.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_CONFLICT);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_CONFLICT, message, eventlogger);
return;
}
@@ -283,7 +283,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = e.getMessage();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -302,7 +302,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -311,7 +311,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "DRFeedsServlet.doPost() -Invalid request exclude_AAF should not be true if passing AAF_Instance value= " + aafInstance;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -321,7 +321,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "AAF disallows access to permission - " + permission;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -332,7 +332,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -349,7 +349,7 @@ public class DRFeedsServlet extends ProxyServlet {
message = "This feed already exists in the database.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -358,7 +358,7 @@ public class DRFeedsServlet extends ProxyServlet {
if (doInsert(feed)) {
// send response
elr.setResult(HttpServletResponse.SC_CREATED);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_CREATED);
resp.setContentType(FEEDFULL_CONTENT_TYPE);
resp.setHeader("Location", feed.getLinks().getSelf());
@@ -371,11 +371,11 @@ public class DRFeedsServlet extends ProxyServlet {
} else {
// Something went wrong with the INSERT
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/FeedServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/FeedServlet.java
index 4ab3ef4c..3cbaac3c 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/FeedServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/FeedServlet.java
@@ -54,7 +54,7 @@ import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.send
public class FeedServlet extends ProxyServlet {
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance().getLogger(FeedServlet.class);
+ private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(FeedServlet.class);
/**
* Delete the Feed at the address /feed/&lt;feednumber&gt;.
@@ -64,15 +64,15 @@ public class FeedServlet extends ProxyServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -85,7 +85,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing "+BEHALF_HEADER+" header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -94,7 +94,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -103,7 +103,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -119,7 +119,7 @@ public class FeedServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -130,7 +130,7 @@ public class FeedServlet extends ProxyServlet {
message = "AAF disallows access to permission - " + permission;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -144,17 +144,17 @@ public class FeedServlet extends ProxyServlet {
activeFeeds--;
// send response
elr.setResult(HttpServletResponse.SC_NO_CONTENT);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
provisioningDataChanged();
} else {
// Something went wrong with the UPDATE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
/**
@@ -165,15 +165,15 @@ public class FeedServlet extends ProxyServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -186,7 +186,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing "+BEHALF_HEADER+" header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -195,7 +195,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -204,7 +204,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -214,14 +214,14 @@ public class FeedServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(FEEDFULL_CONTENT_TYPE);
try {
@@ -230,7 +230,7 @@ public class FeedServlet extends ProxyServlet {
eventlogger.error("IOException" + ioe.getMessage());
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
/**
@@ -241,15 +241,15 @@ public class FeedServlet extends ProxyServlet {
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -262,7 +262,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing "+BEHALF_HEADER+" header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -271,7 +271,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -280,7 +280,7 @@ public class FeedServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -291,7 +291,7 @@ public class FeedServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -300,7 +300,7 @@ public class FeedServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -313,7 +313,7 @@ public class FeedServlet extends ProxyServlet {
message = e.getMessage();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -325,7 +325,7 @@ public class FeedServlet extends ProxyServlet {
message = "This feed must be modified by the same publisher that created it.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -333,7 +333,7 @@ public class FeedServlet extends ProxyServlet {
message = "The name of the feed may not be updated.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -343,7 +343,7 @@ public class FeedServlet extends ProxyServlet {
message = "The version of the feed may not be updated.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -362,7 +362,7 @@ public class FeedServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -373,7 +373,7 @@ public class FeedServlet extends ProxyServlet {
message = "AAF disallows access to permission - " + permission;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -386,7 +386,7 @@ public class FeedServlet extends ProxyServlet {
if (doUpdate(feed)) {
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(FEEDFULL_CONTENT_TYPE);
try {
@@ -414,11 +414,11 @@ public class FeedServlet extends ProxyServlet {
} else {
// Something went wrong with the UPDATE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
/**
@@ -427,17 +427,17 @@ public class FeedServlet extends ProxyServlet {
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPost", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
String message = "POST not allowed for the feedURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/GroupServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/GroupServlet.java
index 151c0b26..188dce61 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/GroupServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/GroupServlet.java
@@ -55,7 +55,7 @@ public class GroupServlet extends ProxyServlet {
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
}
/**
@@ -70,7 +70,7 @@ public class GroupServlet extends ProxyServlet {
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -83,7 +83,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing "+BEHALF_HEADER+" header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -94,7 +94,7 @@ public class GroupServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
resp.sendError(HttpServletResponse.SC_FORBIDDEN, message);
return;
}*/
@@ -107,7 +107,7 @@ public class GroupServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
resp.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message);
return;
}*/
@@ -118,7 +118,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing or bad group number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -126,7 +126,7 @@ public class GroupServlet extends ProxyServlet {
Group gup = Group.getGroupById(groupid);
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(GROUPFULL_CONTENT_TYPE);
try {
@@ -141,7 +141,7 @@ public class GroupServlet extends ProxyServlet {
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(GROUPLIST_CONTENT_TYPE);
resp.getOutputStream().print(t);*/
@@ -156,7 +156,7 @@ public class GroupServlet extends ProxyServlet {
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -169,7 +169,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing "+BEHALF_HEADER+" header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -178,7 +178,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing or bad groupid.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -187,7 +187,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing or bad group number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -197,7 +197,7 @@ public class GroupServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
resp.sendError(HttpServletResponse.SC_FORBIDDEN, message);
return;
}*/
@@ -208,7 +208,7 @@ public class GroupServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -217,7 +217,7 @@ public class GroupServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -230,7 +230,7 @@ public class GroupServlet extends ProxyServlet {
message = e.getMessage();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -247,7 +247,7 @@ public class GroupServlet extends ProxyServlet {
if (doUpdate(gup)) {
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(GROUPFULL_CONTENT_TYPE);
try {
@@ -259,7 +259,7 @@ public class GroupServlet extends ProxyServlet {
} else {
// Something went wrong with the UPDATE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
}
@@ -275,7 +275,7 @@ public class GroupServlet extends ProxyServlet {
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -288,7 +288,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing "+BEHALF_HEADER+" header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -297,7 +297,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
return;
}
@@ -306,7 +306,7 @@ public class GroupServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.sendError(HttpServletResponse.SC_NOT_FOUND, message);
return;
}*/
@@ -316,7 +316,7 @@ public class GroupServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.sendError(HttpServletResponse.SC_FORBIDDEN, message);
return;
}*/
@@ -329,7 +329,7 @@ public class GroupServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -338,7 +338,7 @@ public class GroupServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -352,7 +352,7 @@ public class GroupServlet extends ProxyServlet {
message = e.getMessage();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -373,7 +373,7 @@ public class GroupServlet extends ProxyServlet {
if (doInsert(gup)) {
// send response
elr.setResult(HttpServletResponse.SC_CREATED);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_CREATED);
resp.setContentType(GROUPFULL_CONTENT_TYPE);
try {
@@ -385,7 +385,7 @@ public class GroupServlet extends ProxyServlet {
} else {
// Something went wrong with the INSERT
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/InternalServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/InternalServlet.java
index 4e727f1d..56b40e04 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/InternalServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/InternalServlet.java
@@ -159,7 +159,7 @@ public class InternalServlet extends ProxyServlet {
private static final Object lock = new Object();
private static Integer logseq = 0; // another piece of info to make log spool file names unique
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(InternalServlet.class);
/**
@@ -169,14 +169,14 @@ public class InternalServlet extends ProxyServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -193,14 +193,14 @@ public class InternalServlet extends ProxyServlet {
if (param != null) {
if (doDelete(param)) {
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
provisioningDataChanged();
provisioningParametersChanged();
} else {
// Something went wrong with the DELETE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
return;
@@ -209,7 +209,7 @@ public class InternalServlet extends ProxyServlet {
}
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, "Bad URL.", eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -220,9 +220,9 @@ public class InternalServlet extends ProxyServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doGet",req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String path = req.getPathInfo();
Properties props = (new DB()).getProperties();
if (path.equals("/halt") && !req.isSecure()) {
@@ -243,7 +243,7 @@ public class InternalServlet extends ProxyServlet {
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -336,7 +336,7 @@ public class InternalServlet extends ProxyServlet {
}
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, "Bad URL.", eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -347,14 +347,14 @@ public class InternalServlet extends ProxyServlet {
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -372,14 +372,14 @@ public class InternalServlet extends ProxyServlet {
param.setValue(t);
if (doUpdate(param)) {
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
provisioningDataChanged();
provisioningParametersChanged();
} else {
// Something went wrong with the UPDATE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
return;
@@ -388,7 +388,7 @@ public class InternalServlet extends ProxyServlet {
}
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, "Bad URL.", eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -400,14 +400,14 @@ public class InternalServlet extends ProxyServlet {
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPost", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
EventLogRecord elr = new EventLogRecord(req);
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -426,14 +426,14 @@ public class InternalServlet extends ProxyServlet {
param = new Parameters(key, t);
if (doInsert(param)) {
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
provisioningDataChanged();
provisioningParametersChanged();
} else {
// Something went wrong with the INSERT
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
return;
@@ -447,7 +447,7 @@ public class InternalServlet extends ProxyServlet {
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
elr.setMessage("Bad media type: " + ctype);
resp.setStatus(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
return;
}
String spooldir = (new DB()).getProperties().getProperty("org.onap.dmaap.datarouter.provserver.spooldir");
@@ -464,7 +464,7 @@ public class InternalServlet extends ProxyServlet {
} else {
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
resp.setStatus(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
return;
}
}
@@ -487,7 +487,7 @@ public class InternalServlet extends ProxyServlet {
if (((avail * 100) / total) < 5) {
elr.setResult(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
resp.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
return;
}
Path tmppath = Paths.get(spooldir, spoolname);
@@ -497,7 +497,7 @@ public class InternalServlet extends ProxyServlet {
Files.move(tmppath, donepath, StandardCopyOption.REPLACE_EXISTING);
elr.setResult(HttpServletResponse.SC_CREATED);
resp.setStatus(HttpServletResponse.SC_CREATED);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
LogfileLoader.getLoader(); // This starts the logfile loader "task"
} catch (IOException ioe) {
intlogger.error("IOException" + ioe.getMessage());
@@ -512,7 +512,7 @@ public class InternalServlet extends ProxyServlet {
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
elr.setMessage("Bad media type: " + ctype);
resp.setStatus(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
return;
}
try {
@@ -527,7 +527,7 @@ public class InternalServlet extends ProxyServlet {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType("text/plain");
LogRecord.printLogRecords(resp.getOutputStream(), bs);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
} catch (IOException ioe) {
intlogger.error("IOException" + ioe.getMessage());
}
@@ -536,9 +536,9 @@ public class InternalServlet extends ProxyServlet {
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, "Bad URL.", eventlogger);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
index c58bda8e..77bcbddc 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
@@ -64,7 +64,7 @@ import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.send
@SuppressWarnings("serial")
public class LogServlet extends BaseServlet {
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance().getLogger(LogServlet.class);
+ private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(LogServlet.class);
private static final long TWENTYFOUR_HOURS = (24 * 60 * 60 * 1000L);
private static final String FMT_1 = "yyyy-MM-dd'T'HH:mm:ss'Z'";
private static final String FMT_2 = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
@@ -148,17 +148,17 @@ public class LogServlet extends BaseServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "DELETE not allowed for the logURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
/**
@@ -168,9 +168,9 @@ public class LogServlet extends BaseServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
int id = getIdFromPath(req);
if (id < 0) {
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Missing or bad feed/subscription number.", eventlogger);
@@ -229,7 +229,7 @@ public class LogServlet extends BaseServlet {
eventlogger.error("IOException: " + ioe.getMessage());
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
/**
@@ -238,17 +238,17 @@ public class LogServlet extends BaseServlet {
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER),getIdFromPath(req)+"");
String message = "PUT not allowed for the logURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
/**
@@ -257,17 +257,17 @@ public class LogServlet extends BaseServlet {
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPost", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
String message = "POST not allowed for the logURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
index 1bd3cbfa..a0d8664f 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
@@ -24,7 +24,9 @@
package org.onap.dmaap.datarouter.provisioning;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
@@ -87,7 +89,7 @@ public class Main {
static final String KEYSTORE_PASS_PROPERTY = "org.onap.dmaap.datarouter.provserver.keystore.password";
static final String TRUSTSTORE_PATH_PROPERTY = "org.onap.dmaap.datarouter.provserver.truststore.path";
static final String TRUSTSTORE_PASS_PROPERTY = "org.onap.dmaap.datarouter.provserver.truststore.password";
- public static final Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ public static final EELFLogger intlogger = EELFManager.getInstance().getLogger("org.onap.dmaap.datarouter.provisioning.internal");
/**
* The one and only {@link Server} instance in this JVM
@@ -100,7 +102,7 @@ public class Main {
try {
in = getClass().getClassLoader().getResourceAsStream("drProvCadi.properties");
} catch (Exception e) {
- intlogger.error("Exception in Main.getCadiProps() method ", e);
+ intlogger.error("Exception in Main.getCadiProps() method ", e.getMessage());
}
return in;
}
@@ -113,9 +115,8 @@ public class Main {
* @throws Exception if Jetty has a problem starting
*/
public static void main(String[] args) throws Exception {
- // Get prov properties
+ Security.setProperty("networkaddress.cache.ttl", "4");
Properties provProperties = (new DB()).getProperties();
-
// Check DB is accessible and contains the expected tables
if (!checkDatabase()) {
System.exit(1);
@@ -247,7 +248,7 @@ public class Main {
InputStream in = obj.getCadiProps();
cadiProperties.load(in);
} catch (IOException e1) {
- intlogger.error("PROV0001 Exception loading CADI properties", e1);
+ intlogger.error("PROV0001 Exception loading CADI properties", e1.getMessage());
}
cadiProperties.setProperty("aaf_locate_url", provProperties.getProperty("org.onap.dmaap.datarouter.provserver.cadi.aaf.url", "https://aaf-onap-test.osaaf.org:8095"));
intlogger.info("PROV0001 aaf_url set to - " + cadiProperties.getProperty("aaf_url"));
@@ -280,7 +281,7 @@ public class Main {
server.start();
intlogger.info("Prov Server started-" + server.getState());
} catch (Exception e) {
- intlogger.info("Jetty failed to start. Reporting will we unavailable", e);
+ intlogger.info("Jetty failed to start. Reporting will we unavailable", e.getMessage());
}
server.join();
intlogger.info("PROV0001 **** AT&T Data Router Provisioning Server halted.");
@@ -301,7 +302,7 @@ public class Main {
Thread.sleep(5000L);
System.exit(0);
} catch (Exception e) {
- intlogger.error("Exception in Main.shutdown() method " + e);
+ intlogger.error("Exception in Main.shutdown() method " + e.getMessage());
}
});
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java
index 193485e6..b9d5e7a6 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java
@@ -36,7 +36,9 @@ import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
@@ -72,13 +74,13 @@ public class Poker extends TimerTask {
private long timer1;
private long timer2;
private String thisPod; // DNS name of this machine
- private Logger logger;
+ private EELFLogger logger;
private String provString;
private Poker() {
timer1 = timer2 = 0;
Timer rolex = new Timer();
- logger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ logger = EELFManager.getInstance().getLogger("InternalLog");;
try {
thisPod = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/ProxyServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/ProxyServlet.java
index ca63f466..67a74de3 100755
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/ProxyServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/ProxyServlet.java
@@ -250,7 +250,7 @@ public class ProxyServlet extends BaseServlet {
copyResponseHeaders(pxyResponse, resp);
copyEntityContent(pxyResponse, resp);
} catch (IOException e) {
- intlogger.warn("ProxyServlet: " + e);
+ intlogger.warn("ProxyServlet: " + e.getMessage());
sendResponseError(resp, HttpServletResponse.SC_SERVICE_UNAVAILABLE, "", intlogger);
} finally {
proxy.releaseConnection();
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/PublishServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/PublishServlet.java
index 42d2b113..af2085bc 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/PublishServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/PublishServlet.java
@@ -59,7 +59,7 @@ public class PublishServlet extends BaseServlet {
private String provstring;
private List<IngressRoute> irt;
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(PublishServlet.class);
private static final Object lock = new Object();
@@ -76,48 +76,48 @@ public class PublishServlet extends BaseServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setUpEelfForPublishServlet(req, "doDelete");
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
redirect(req, resp);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setUpEelfForPublishServlet(req, "doGet");
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
redirect(req, resp);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setUpEelfForPublishServlet(req, "doPut");
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
redirect(req, resp);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setUpEelfForPublishServlet(req, "doPost");
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
redirect(req, resp);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -145,7 +145,7 @@ public class PublishServlet extends BaseServlet {
: "Invalid request - Missing file ID.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
resp.sendError(HttpServletResponse.SC_NOT_FOUND, message);
} else {
@@ -162,7 +162,7 @@ public class PublishServlet extends BaseServlet {
String message = "Redirected to: " + newurl;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_MOVED_PERMANENTLY);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
resp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
resp.setHeader("Location", newurl);
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/RouteServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/RouteServlet.java
index 12699a49..4dd422a0 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/RouteServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/RouteServlet.java
@@ -138,7 +138,7 @@ public class RouteServlet extends ProxyServlet {
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -226,14 +226,14 @@ public class RouteServlet extends ProxyServlet {
}
if (rv) {
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
provisioningDataChanged();
provisioningParametersChanged();
} else {
// Something went wrong with the DELETE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
}
@@ -246,7 +246,7 @@ public class RouteServlet extends ProxyServlet {
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -327,7 +327,7 @@ public class RouteServlet extends ProxyServlet {
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -342,7 +342,7 @@ public class RouteServlet extends ProxyServlet {
if (!isAuthorizedForInternal(req)) {
elr.setMessage("Unauthorized.");
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, "Unauthorized.", eventlogger);
return;
}
@@ -368,7 +368,7 @@ public class RouteServlet extends ProxyServlet {
int seq = (t != null) ? Integer.parseInt(t) : (IngressRoute.getMaxSequence() + 100);
ins = new Insertable[] { new IngressRoute(seq, feedid, user, subnet, NodeClass.lookupNodeNames(nodepatt)) };
} catch (Exception e) {
- intlogger.info(e);
+ intlogger.info(e.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add ingress' command.", intlogger);
return;
}
@@ -384,7 +384,7 @@ public class RouteServlet extends ProxyServlet {
String node = NodeClass.normalizeNodename(req.getParameter("node"));
ins = new Insertable[] { new EgressRoute(subid, node) };
} catch (Exception e) {
- intlogger.info(e);
+ intlogger.info(e.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add egress' command.", intlogger);
return;
}
@@ -410,7 +410,7 @@ public class RouteServlet extends ProxyServlet {
}
ins = new Insertable[] { nr };
} catch (IllegalArgumentException e) {
- intlogger.info(e);
+ intlogger.info(e.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add network' command.", intlogger);
return;
}
@@ -425,14 +425,14 @@ public class RouteServlet extends ProxyServlet {
}
if (rv) {
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
provisioningDataChanged();
provisioningParametersChanged();
} else {
// Something went wrong with the INSERT
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, intlogger);
}
}
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 b77062fa..34ba5d34 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
@@ -70,7 +70,7 @@ public class StatisticsServlet extends BaseServlet {
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
}
@@ -407,7 +407,7 @@ public class StatisticsServlet extends BaseServlet {
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
}
@@ -420,7 +420,7 @@ public class StatisticsServlet extends BaseServlet {
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
index 35ce062d..69451a3b 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
@@ -55,7 +55,7 @@ import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.send
public class SubscribeServlet extends ProxyServlet {
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(SubscribeServlet.class);
/**
@@ -64,17 +64,17 @@ public class SubscribeServlet extends ProxyServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "DELETE not allowed for the subscribeURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -85,15 +85,15 @@ public class SubscribeServlet extends ProxyServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -106,7 +106,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -115,7 +115,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -124,7 +124,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -134,7 +134,7 @@ public class SubscribeServlet extends ProxyServlet {
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(SUBLIST_CONTENT_TYPE);
try {
@@ -143,7 +143,7 @@ public class SubscribeServlet extends ProxyServlet {
eventlogger.error("IOException: " + ioe.getMessage());
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -153,17 +153,17 @@ public class SubscribeServlet extends ProxyServlet {
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "PUT not allowed for the subscribeURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_METHOD_NOT_ALLOWED, message, eventlogger);
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -174,15 +174,15 @@ public class SubscribeServlet extends ProxyServlet {
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPost", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -195,7 +195,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -204,7 +204,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -213,7 +213,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Missing or bad feed number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -225,7 +225,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -234,7 +234,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -246,7 +246,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Cannot create subscription; the maximum number of subscriptions has been configured.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_CONFLICT);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_CONFLICT, message, eventlogger);
return;
}
@@ -258,7 +258,7 @@ public class SubscribeServlet extends ProxyServlet {
message = e.getMessage();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -281,7 +281,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Policy Engine disallows access";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -290,7 +290,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "AAF Subscriber can not be added to legacy Feed- " + feedid;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -302,7 +302,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -314,7 +314,7 @@ public class SubscribeServlet extends ProxyServlet {
message = "AAF disallows access to permission - " + permission;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -334,7 +334,7 @@ public class SubscribeServlet extends ProxyServlet {
if (doInsert(sub)) {
// send response
elr.setResult(HttpServletResponse.SC_CREATED);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_CREATED);
resp.setContentType(SUBFULL_CONTENT_TYPE);
resp.setHeader("Location", sub.getLinks().getSelf());
@@ -349,11 +349,11 @@ public class SubscribeServlet extends ProxyServlet {
// Something went wrong with the INSERT
activeSubs--;
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, eventlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServlet.java
index d7c46570..63ff84de 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServlet.java
@@ -60,7 +60,7 @@ public class SubscriptionServlet extends ProxyServlet {
private static final String SUBCNTRL_CONTENT_TYPE = "application/vnd.dmaap-dr.subscription-control";
//Adding EELF Logger Rally:US664892
- private static EELFLogger eelflogger = EELFManager.getInstance()
+ private static EELFLogger eelfLogger = EELFManager.getInstance()
.getLogger(SubscriptionServlet.class);
/**
@@ -70,15 +70,15 @@ public class SubscriptionServlet extends ProxyServlet {
@Override
public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -91,7 +91,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -100,7 +100,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -109,7 +109,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -125,7 +125,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -136,7 +136,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "AAF disallows access to permission - " + permission;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -149,17 +149,17 @@ public class SubscriptionServlet extends ProxyServlet {
activeSubs--;
// send response
elr.setResult(HttpServletResponse.SC_NO_CONTENT);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
provisioningDataChanged();
} else {
// Something went wrong with the DELETE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, intlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -171,15 +171,15 @@ public class SubscriptionServlet extends ProxyServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -192,7 +192,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -201,7 +201,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -210,7 +210,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -220,14 +220,14 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(SUBFULL_CONTENT_TYPE);
try {
@@ -236,7 +236,7 @@ public class SubscriptionServlet extends ProxyServlet {
eventlogger.error("IOException: " + ioe.getMessage());
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -247,15 +247,15 @@ public class SubscriptionServlet extends ProxyServlet {
@Override
public void doPut(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -268,7 +268,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -277,7 +277,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -286,7 +286,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);
return;
}
@@ -297,7 +297,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -306,7 +306,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -320,7 +320,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = e.getMessage();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -337,7 +337,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -348,7 +348,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "AAF disallows access to permission - " + permission;
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -365,7 +365,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "This subscriber must be modified by the same subscriber that created it.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -374,7 +374,7 @@ public class SubscriptionServlet extends ProxyServlet {
if (doUpdate(sub)) {
// send response
elr.setResult(HttpServletResponse.SC_OK);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(SUBFULL_CONTENT_TYPE);
try {
@@ -401,11 +401,11 @@ public class SubscriptionServlet extends ProxyServlet {
} else {
// Something went wrong with the UPDATE
elr.setResult(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, DB_PROBLEM_MSG, intlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -417,15 +417,15 @@ public class SubscriptionServlet extends ProxyServlet {
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
setIpFqdnRequestIDandInvocationIDForEelf("doPost", req);
- eelflogger.info(EelfMsgs.ENTRY);
+ eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF, req.getHeader(BEHALF_HEADER));
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -438,7 +438,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing " + BEHALF_HEADER + " header.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -447,7 +447,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Missing or bad subscription number.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -458,7 +458,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Incorrect content-type";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, message, eventlogger);
return;
}
@@ -468,7 +468,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Policy Engine disallows access.";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_FORBIDDEN);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_FORBIDDEN, message, eventlogger);
return;
}
@@ -477,7 +477,7 @@ public class SubscriptionServlet extends ProxyServlet {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
@@ -493,17 +493,17 @@ public class SubscriptionServlet extends ProxyServlet {
}
// send response
elr.setResult(HttpServletResponse.SC_ACCEPTED);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
} catch (JSONException e) {
message = "Badly formed JSON";
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
}
} finally {
- eelflogger.info(EelfMsgs.EXIT);
+ eelfLogger.info(EelfMsgs.EXIT);
}
}
@@ -542,7 +542,7 @@ public class SubscriptionServlet extends ProxyServlet {
}
}
} catch (Exception e) {
- intlogger.warn("Caught exception in SubscriberNotifyThread: " + e);
+ intlogger.warn("Caught exception in SubscriberNotifyThread: " + e.getMessage());
}
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SynchronizerTask.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SynchronizerTask.java
index 9eece14f..3097a9db 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SynchronizerTask.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SynchronizerTask.java
@@ -50,6 +50,8 @@ import java.util.TreeSet;
import javax.servlet.http.HttpServletResponse;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -60,7 +62,6 @@ import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.AbstractHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -117,7 +118,7 @@ public class SynchronizerTask extends TimerTask {
private static final String[] stnames = {"UNKNOWN", "ACTIVE", "STANDBY"};
private static final long ONE_HOUR = 60 * 60 * 1000L;
- private final Logger logger;
+ private final EELFLogger logger;
private final Timer rolex;
private final String spooldir;
private int state;
@@ -139,7 +140,7 @@ public class SynchronizerTask extends TimerTask {
@SuppressWarnings("deprecation")
private SynchronizerTask() {
- logger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ logger = EELFManager.getInstance().getLogger("InternalLog");
rolex = new Timer();
spooldir = (new DB()).getProperties().getProperty("org.onap.dmaap.datarouter.provserver.spooldir");
state = UNKNOWN;
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRoute.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRoute.java
index 832b8edc..12135969 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRoute.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRoute.java
@@ -33,7 +33,8 @@ import java.util.Objects;
import java.util.SortedSet;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
@@ -45,7 +46,7 @@ import org.onap.dmaap.datarouter.provisioning.utils.DB;
*/
public class EgressRoute extends NodeClass implements Comparable<EgressRoute> {
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private final int subid;
private final int nodeid;
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EventLogRecord.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EventLogRecord.java
index 4d0b6acc..ce03f59a 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EventLogRecord.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/EventLogRecord.java
@@ -35,7 +35,7 @@ import org.onap.dmaap.datarouter.provisioning.BaseServlet;
* (who made the provisioning request including the IP address, the X-DMAAP-DR-ON-BEHALF-OF
* header value, and the client certificate), a what (what request was made; the method
* and servlet involved), and a how (how the request was handled; the result code and
- * message returned to the client). EventLogRecords are logged using log4j at the INFO level.
+ * message returned to the client).
*
* @author Robert Eby
* @version $Id: EventLogRecord.java,v 1.1 2013/04/26 21:00:25 eby Exp $
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Feed.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Feed.java
index 502dbbd1..506821e2 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Feed.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Feed.java
@@ -24,18 +24,16 @@
package org.onap.dmaap.datarouter.provisioning.beans;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
import org.onap.dmaap.datarouter.provisioning.utils.JSONUtilities;
-import org.onap.dmaap.datarouter.provisioning.utils.PasswordProcessor;
import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities;
import java.io.InvalidObjectException;
-import java.security.GeneralSecurityException;
import java.sql.*;
import java.util.Date;
import java.util.*;
@@ -47,7 +45,7 @@ import java.util.*;
* @version $Id: Feed.java,v 1.13 2013/10/28 18:06:52 eby Exp $
*/
public class Feed extends Syncable {
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private static int next_feedid = getMaxFeedID() + 1;
private int feedid;
@@ -87,7 +85,7 @@ public class Feed extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.log(Level.WARN, "PROV0024 Feed.isFeedValid: ", e);
+ intlogger.warn("PROV0024 Feed.isFeedValid: ", e.getMessage());
}
return count != 0;
}
@@ -137,8 +135,7 @@ public class Feed extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.info("PROV0025 Feed.countActiveFeeds: " + e.getMessage());
- intlogger.log(Level.WARN, "PROV0025 Feed.countActiveFeeds: ", e);
+ intlogger.warn("PROV0025 Feed.countActiveFeeds: ", e.getMessage());
}
return count;
}
@@ -158,8 +155,7 @@ public class Feed extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.info("PROV0026 Feed.getMaxFeedID: "+e.getMessage());
- intlogger.log(Level.WARN, "PROV0026 Feed.getMaxFeedID: ", e);
+ intlogger.warn("PROV0026 Feed.getMaxFeedID: ", e.getMessage());
}
return max;
}
@@ -205,7 +201,7 @@ public class Feed extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.log(Level.WARN, "PROV0027 Feed.getAllFeeds: ", e);
+ intlogger.warn("PROV0027 Feed.getAllFeeds: ", e.getMessage());
}
return map.values();
}
@@ -239,7 +235,7 @@ public class Feed extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.log(Level.WARN, "PROV0028 Feed.getFilteredFeedUrlList: ", e);
+ intlogger.warn("PROV0028 Feed.getFilteredFeedUrlList: ", e.getMessage());
}
return list;
}
@@ -276,7 +272,7 @@ public class Feed extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.log(Level.WARN, "PROV0029 Feed.getFeedBySQL: ", e);
+ intlogger.warn("PROV0029 Feed.getFeedBySQL: ", e.getMessage());
}
return feed;
}
@@ -383,7 +379,7 @@ public class Feed extends Syncable {
JSONObject jol = jo.optJSONObject("links");
this.links = (jol == null) ? (new FeedLinks()) : (new FeedLinks(jol));
} catch (InvalidObjectException e) {
- intlogger.log(Level.WARN, "PROV0030 Feed.Feed: ", e);
+ intlogger.warn("PROV0030 Feed.Feed: ", e.getMessage());
throw e;
} catch (Exception e) {
intlogger.error("PROV0031 Feed.Feed: invalid JSON: "+e);
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java
index 30fc87c4..8904765a 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java
@@ -31,10 +31,10 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
-import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities;
/**
* The representation of a Subscription. Subscriptions can be retrieved from the DB, or stored/updated in the DB.
@@ -44,7 +44,7 @@ import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities;
*/
public class Group extends Syncable {
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private static int next_groupid = getMaxGroupID() + 1;
private int groupid;
@@ -237,7 +237,7 @@ public class Group extends Syncable {
return groupid;
}
- public static Logger getIntlogger() {
+ public static EELFLogger getIntlogger() {
return intlogger;
}
@@ -245,7 +245,7 @@ public class Group extends Syncable {
this.groupid = groupid;
}
- public static void setIntlogger(Logger intlogger) {
+ public static void setIntlogger(EELFLogger intlogger) {
Group.intlogger = intlogger;
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/IngressRoute.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/IngressRoute.java
index 033b3900..bbed37a3 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/IngressRoute.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/IngressRoute.java
@@ -39,8 +39,9 @@ import java.util.TreeSet;
import javax.servlet.http.HttpServletRequest;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
@@ -53,7 +54,7 @@ import org.onap.dmaap.datarouter.provisioning.utils.DB;
*/
public class IngressRoute extends NodeClass implements Comparable<IngressRoute> {
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private final int seq;
private final int feedid;
private final String userid;
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/LogRecord.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/LogRecord.java
index b7b82729..86d1faea 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/LogRecord.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/LogRecord.java
@@ -33,7 +33,9 @@ import java.sql.SQLException;
import java.sql.Types;
import java.text.ParseException;
import java.util.Iterator;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
import org.onap.dmaap.datarouter.provisioning.utils.RLEBitSet;
@@ -53,7 +55,7 @@ public class LogRecord extends BaseLogRecord {
* @param bs the {@link RLEBitSet} listing the record IDs to print
* @throws IOException
*/
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.beans");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
public static void printLogRecords(OutputStream os, RLEBitSet bs) throws IOException {
final String sql = "select * from LOG_RECORDS where RECORD_ID >= ? AND RECORD_ID <= ?";
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRoute.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRoute.java
index 8264de28..94eeec4a 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRoute.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRoute.java
@@ -33,7 +33,8 @@ import java.util.Objects;
import java.util.SortedSet;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
@@ -45,7 +46,7 @@ import org.onap.dmaap.datarouter.provisioning.utils.DB;
*/
public class NetworkRoute extends NodeClass implements Comparable<NetworkRoute> {
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private final int fromnode;
private final int tonode;
private final int vianode;
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
index 9d43bd0a..f3ef5d6a 100755
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
@@ -32,7 +32,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
/**
@@ -44,7 +46,7 @@ import org.onap.dmaap.datarouter.provisioning.utils.DB;
public abstract class NodeClass extends Syncable {
private static Map<String, Integer> map;
- private static Logger intLogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intLogger = EELFManager.getInstance().getLogger("InternalLog");
public NodeClass() {
// init on first use
if (map == null) {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Parameters.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Parameters.java
index 4d2c9d1f..08914868 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Parameters.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Parameters.java
@@ -30,7 +30,8 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
@@ -67,7 +68,7 @@ public class Parameters extends Syncable {
public static final String THROTTLE_FILTER = "THROTTLE_FILTER";
public static final String STATIC_ROUTING_NODES = "STATIC_ROUTING_NODES"; //Adding new param for static Routing - Rally:US664862-1610
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private String keyname;
private String value;
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Subscription.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Subscription.java
index bdc062f9..442a7642 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Subscription.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Subscription.java
@@ -23,18 +23,24 @@
package org.onap.dmaap.datarouter.provisioning.beans;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import java.io.InvalidObjectException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
-import org.onap.dmaap.datarouter.provisioning.utils.PasswordProcessor;
import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities;
-import java.io.InvalidObjectException;
-import java.security.GeneralSecurityException;
-import java.sql.*;
-import java.util.Date;
-import java.util.*;
/**
* The representation of a Subscription. Subscriptions can be retrieved from the DB, or stored/updated in the DB.
@@ -51,7 +57,7 @@ public class Subscription extends Syncable {
private static final String GROUPID_KEY = "groupid";
private static final String LAST_MOD_KEY = "last_mod";
private static final String CREATED_DATE = "created_date";
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private static int nextSubid = getMaxSubID() + 1;
private int subid;
@@ -111,7 +117,7 @@ public class Subscription extends Syncable {
}
db.release(conn);
} catch (SQLException e) {
- intlogger.error(e);
+ intlogger.error(e.toString());
}
return list;
}
@@ -469,7 +475,6 @@ public class Subscription extends Syncable {
} catch (SQLException e) {
rv = false;
intlogger.warn("PROV0005 doInsert: " + e.getMessage());
- intlogger.log(Level.WARN, "PROV0005 Subscription.doInsert(1): ", e);
} finally {
try {
if (ps != null) {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/eelf/DebugTraceFilter.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/eelf/DebugTraceFilter.java
new file mode 100644
index 00000000..6bc555e8
--- /dev/null
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/eelf/DebugTraceFilter.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dmaap.datarouter.provisioning.eelf;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.filter.Filter;
+import ch.qos.logback.core.spi.FilterReply;
+
+public class DebugTraceFilter extends Filter<ILoggingEvent> {
+ @Override
+ public FilterReply decide(ILoggingEvent event) {
+ if (event.getLoggerName().contains("InternalLog") && (event.getLevel() == Level.DEBUG || event.getLevel() == Level.TRACE) ) {
+ return FilterReply.ACCEPT;
+ } else {
+ return FilterReply.DENY;
+ }
+ }
+}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java
index 8ca71187..d29876fb 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java
@@ -41,7 +41,9 @@ import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.Queue;
import java.util.Set;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
/**
* Load the DB JDBC driver, and manage a simple pool of connections to the DB.
@@ -51,8 +53,7 @@ import org.apache.log4j.Logger;
*/
public class DB {
- private static Logger intlogger = Logger
- .getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private static String DB_URL;
private static String DB_LOGIN;
@@ -83,10 +84,10 @@ public class DB {
HTTP_PORT = (String) props.get("org.onap.dmaap.datarouter.provserver.http.port");
Class.forName(DB_DRIVER);
} catch (IOException e) {
- intlogger.fatal("PROV9003 Opening properties: " + e.getMessage());
+ intlogger.error("PROV9003 Opening properties: " + e.getMessage());
System.exit(1);
} catch (ClassNotFoundException e) {
- intlogger.fatal("PROV9004 cannot find the DB driver: " + e);
+ intlogger.error("PROV9004 cannot find the DB driver: " + e);
System.exit(1);
}
}
@@ -194,7 +195,7 @@ public class DB {
}
} catch (SQLException e) {
intlogger
- .fatal("PROV9000: The database credentials are not working: " + e.getMessage());
+ .error("PROV9000: The database credentials are not working: " + e.getMessage());
return false;
} finally {
if (connection != null) {
@@ -222,7 +223,7 @@ public class DB {
rs.close();
}
} catch (SQLException e) {
- intlogger.fatal("PROV9010: Failed to get TABLE data from DB: " + e.getMessage());
+ intlogger.error("PROV9010: Failed to get TABLE data from DB: " + e.getMessage());
}
return tables;
}
@@ -241,7 +242,7 @@ public class DB {
try {
String scriptFile = String.format("%s/sql_init_%02d.sql", scriptDir, scriptId);
if (!(new File(scriptFile)).exists()) {
- intlogger.fatal("PROV9005 Failed to load sql script from : " + scriptFile);
+ intlogger.error("PROV9005 Failed to load sql script from : " + scriptFile);
System.exit(1);
}
LineNumberReader lineReader = new LineNumberReader(new FileReader(scriptFile));
@@ -263,7 +264,7 @@ public class DB {
lineReader.close();
strBuilder.setLength(0);
} catch (Exception e) {
- intlogger.fatal("PROV9002 Error when initializing table: " + e.getMessage());
+ intlogger.error("PROV9002 Error when initializing table: " + e.getMessage());
System.exit(1);
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java
index 688a32f6..46cfabec 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java
@@ -20,7 +20,8 @@
*/
package org.onap.dmaap.datarouter.provisioning.utils;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.filter.CadiFilter;
import org.onap.dmaap.datarouter.provisioning.BaseServlet;
@@ -38,8 +39,8 @@ import java.io.IOException;
public class DRProvCadiFilter extends CadiFilter {
- private static Logger eventlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.events");
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ protected static EELFLogger eventlogger = EELFManager.getInstance().getLogger("EventLog");
+ protected static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");
private String aafInstance = "";
public DRProvCadiFilter(boolean init, PropAccess access) throws ServletException {
@@ -71,21 +72,21 @@ public class DRProvCadiFilter extends CadiFilter {
String message = String.format("Invalid request URI - %s", httpRequest.getPathInfo());
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND, message);
return;
}
if (isAAFSubscriber(subId)) {//edit AAF Subscriber
String message = String.format("DRProvCadiFilter - Edit AAF Subscriber : %d : AAF Instance - %s", subId, aafInstance);
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
//request.setAttribute("aafInstance", aafInstance);// no need to set it in request since it is taken care in respective servlets
super.doFilter(request, response, chain);
} else {//Edit or publish legacy Subscriber
String message = "DRProvCadiFilter - Edit/Publish Legacy Subscriber :" + subId;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
chain.doFilter(request, response);
}
@@ -95,7 +96,7 @@ public class DRProvCadiFilter extends CadiFilter {
String message = "Invalid request URI - " + httpRequest.getPathInfo();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND, message);
return;
}
@@ -103,20 +104,20 @@ public class DRProvCadiFilter extends CadiFilter {
if (isAAFFeed(feedId)) {//edit AAF Feed
String message = "DRProvCadiFilter - Edit AAF Feed:" + feedId + ":" + "AAF Instance -" + aafInstance;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
super.doFilter(request, response, chain);
} else {//Edit or publish legacy Feed
String message = "DRProvCadiFilter - Edit/Publish Legacy Feed:" + feedId;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
chain.doFilter(request, response);
}
}
} else {// in all other cases defaults to legacy behavior
String message = "DRProvCadiFilter - Default Legacy Feed/Subscriber URI -:" + httpRequest.getPathInfo();
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
chain.doFilter(request, response);
}
} else {
@@ -127,7 +128,7 @@ public class DRProvCadiFilter extends CadiFilter {
String message = "Invalid request URI - " + httpRequest.getPathInfo();
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_NOT_FOUND);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND, message);
return;
}
@@ -136,25 +137,25 @@ public class DRProvCadiFilter extends CadiFilter {
String message = "DRProvCadiFilter -Invalid request Header Parmeter " + BaseServlet.EXCLUDE_AAF_HEADER + " = " + httpRequest.getHeader(BaseServlet.EXCLUDE_AAF_HEADER);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
return;
}
if (excludeAAF.equalsIgnoreCase("true")) {//Check to add legacy subscriber to AAF Feed
String message = "DRProvCadiFilter - add legacy subscriber to AAF Feed, FeedID:" + feedId;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
chain.doFilter(request, response);
} else {
String message = "DRProvCadiFilter - Add AAF subscriber to AAF Feed, FeedID:" + feedId + ":" + "AAF Instance -" + aafInstance;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
super.doFilter(request, response, chain);
}
} else {//Add legacy susbcriber to legacy Feed
String message = "DRProvCadiFilter - add legacy subscriber to legacy Feed:" + feedId;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
chain.doFilter(request, response);
}
} else {//add AAF feed
@@ -162,19 +163,19 @@ public class DRProvCadiFilter extends CadiFilter {
String message = "DRProvCadiFilter -Invalid request Header Parmeter " + BaseServlet.EXCLUDE_AAF_HEADER + " = " + httpRequest.getHeader(BaseServlet.EXCLUDE_AAF_HEADER);
elr.setMessage(message);
elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
- eventlogger.info(elr);
+ eventlogger.error(elr.toString());
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
return;
}
if (excludeAAF.equalsIgnoreCase("true")) {//add legacy feed
String message = "DRProvCadiFilter - Create new legacy Feed : EXCLUDE_AAF = " + excludeAAF;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
chain.doFilter(request, response);
} else {//add AAF Feed
String message = "DRProvCadiFilter - Create new AAF Feed : EXCLUDE_AAF = " + excludeAAF;
elr.setMessage(message);
- eventlogger.info(elr);
+ eventlogger.info(elr.toString());
super.doFilter(request, response, chain);
}
}
@@ -210,7 +211,7 @@ public class DRProvCadiFilter extends CadiFilter {
}
} catch (Exception e) {
- intlogger.error("PROV0073 DRProvCadiFilter.isAAFFeed: ", e);
+ intlogger.error("PROV0073 DRProvCadiFilter.isAAFFeed: ", e.getMessage());
return false;
}
return false;
@@ -240,7 +241,7 @@ public class DRProvCadiFilter extends CadiFilter {
intlogger.debug(message);
}
} catch (Exception e) {
- intlogger.error("PROV0073 DRProvCadiFilter.isAAFSubscriber: ", e);
+ intlogger.error("PROV0073 DRProvCadiFilter.isAAFSubscriber: ", e.getMessage());
return false;
}
return false;
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/HttpServletUtils.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/HttpServletUtils.java
index ce287f4d..3aa3bd28 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/HttpServletUtils.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/HttpServletUtils.java
@@ -25,10 +25,10 @@ package org.onap.dmaap.datarouter.provisioning.utils;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
public class HttpServletUtils {
- public static void sendResponseError(HttpServletResponse response, int errorCode, String message, Logger intlogger) {
+ public static void sendResponseError(HttpServletResponse response, int errorCode, String message, EELFLogger intlogger) {
try {
response.sendError(errorCode, message);
} catch (IOException ioe) {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java
index 6c5a13fd..82231884 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java
@@ -46,7 +46,8 @@ import java.util.Map;
import java.util.TreeSet;
import java.util.zip.GZIPInputStream;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.dmaap.datarouter.provisioning.BaseServlet;
import org.onap.dmaap.datarouter.provisioning.beans.DeliveryExtraRecord;
import org.onap.dmaap.datarouter.provisioning.beans.DeliveryRecord;
@@ -106,7 +107,7 @@ public class LogfileLoader extends Thread {
*/
private static final long SET_SIZE = (1L << 56);
- private final Logger logger;
+ private final EELFLogger logger;
private final DB db;
private final String spooldir;
private final long set_start;
@@ -116,7 +117,7 @@ public class LogfileLoader extends Thread {
private boolean idle;
private LogfileLoader() {
- this.logger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ this.logger = EELFManager.getInstance().getLogger("InternalLog");
this.db = new DB();
this.spooldir = db.getProperties().getProperty("org.onap.dmaap.datarouter.provserver.spooldir");
this.set_start = getIdRange();
@@ -274,7 +275,7 @@ public class LogfileLoader extends Thread {
}
} catch (SQLException e) {
System.err.println(e);
- logger.error(e);
+ logger.error(e.toString());
} finally {
db.release(conn);
}
@@ -296,7 +297,7 @@ public class LogfileLoader extends Thread {
}
} catch (SQLException e) {
System.err.println(e);
- logger.error(e);
+ logger.error(e.toString());
} finally {
db.release(conn);
}
@@ -321,7 +322,7 @@ public class LogfileLoader extends Thread {
}
} catch (SQLException e) {
System.err.println(e);
- logger.error(e);
+ logger.error(e.toString());
} finally {
db.release(conn);
}
@@ -375,7 +376,7 @@ public class LogfileLoader extends Thread {
logger.debug(String.format("initializeNextid, next ID is %d (%x)", nextid, nextid));
} catch (SQLException e) {
System.err.println(e);
- logger.error(e);
+ logger.error(e.toString());
} finally {
db.release(conn);
}
@@ -415,16 +416,16 @@ public class LogfileLoader extends Thread {
}
} catch (SQLException e) {
logger.warn("PROV8003 Invalid value in record: " + line);
- logger.debug(e);
+ logger.debug(e.toString());
} catch (NumberFormatException e) {
logger.warn("PROV8004 Invalid number in record: " + line);
- logger.debug(e);
+ logger.debug(e.toString());
} catch (ParseException e) {
logger.warn("PROV8005 Invalid date in record: " + line);
- logger.debug(e);
+ logger.debug(e.toString());
} catch (Exception e) {
logger.warn("PROV8006 Invalid pattern in record: " + line);
- logger.debug(e);
+ logger.debug(e.toString());
}
total++;
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/PurgeLogDirTask.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/PurgeLogDirTask.java
index 14d15197..f3e84b4a 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/PurgeLogDirTask.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/PurgeLogDirTask.java
@@ -27,7 +27,9 @@ package org.onap.dmaap.datarouter.provisioning.utils;
import java.io.File;
import java.util.Properties;
import java.util.TimerTask;
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
/**
* This class provides a {@link TimerTask} that purges old logfiles (older than the number of days specified by the
@@ -42,14 +44,14 @@ public class PurgeLogDirTask extends TimerTask {
private final String logdir;
private final long interval;
- private Logger utilsLogger;
+ private EELFLogger utilsLogger;
public PurgeLogDirTask() {
Properties p = (new DB()).getProperties();
logdir = p.getProperty("org.onap.dmaap.datarouter.provserver.accesslog.dir");
String s = p.getProperty("org.onap.dmaap.datarouter.provserver.logretention", "30");
- this.utilsLogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.utils");
+ this.utilsLogger = EELFManager.getInstance().getLogger("UtilsLog");;
long n = 30;
try {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilter.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilter.java
index 897c1ea2..c9fb5a16 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilter.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilter.java
@@ -43,7 +43,8 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationSupport;
import org.eclipse.jetty.server.*;
@@ -101,7 +102,7 @@ public class ThrottleFilter extends TimerTask implements Filter {
private static int m_minutes = 0; // sampling period
private static int action = ACTION_DROP; // action to take (throttle or drop)
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger("InternalLog");
private static Map<String, Counter> map = new HashMap<String, Counter>();
private static final Timer rolex = new Timer();
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java
index 3f67efec..65297886 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java
@@ -83,7 +83,7 @@ public class FeedReport extends ReportBase {
}
db.release(conn);
} catch (SQLException e) {
- logger.error(e);
+ logger.error(e.toString());
}
logger.debug("Query time: " + (System.currentTimeMillis() - start) + " ms");
try (PrintWriter os = new PrintWriter(outfile)) {
@@ -91,7 +91,7 @@ public class FeedReport extends ReportBase {
os.print(sb.toString());
} catch (FileNotFoundException e) {
System.err.println("File cannot be written: " + outfile);
- logger.error(e);
+ logger.error(e.toString());
}
}
@@ -130,7 +130,7 @@ public class FeedReport extends ReportBase {
feedmap.put("pubcount", n + 1);
} catch (JSONException e) {
feedmap.put("pubcount", 1);
- logger.error(e);
+ logger.error(e.toString());
}
} else if (type.equals("del")) {
String subid = "" + rs.getInt("DELIVERY_SUBID");
@@ -139,7 +139,7 @@ public class FeedReport extends ReportBase {
feedmap.put(subid, n + 1);
} catch (JSONException e) {
feedmap.put(subid, 1);
- logger.error(e);
+ logger.error(e.toString());
}
}
}
@@ -147,7 +147,7 @@ public class FeedReport extends ReportBase {
}
db.release(conn);
} catch (SQLException e) {
- logger.error(e);
+ logger.error(e.toString());
}
logger.debug("Query time: " + (System.currentTimeMillis() - start) + " ms");
try {
@@ -156,7 +156,7 @@ public class FeedReport extends ReportBase {
os.close();
} catch (FileNotFoundException e) {
System.err.println("File cannot be written: " + outfile);
- logger.error(e);
+ logger.error(e.toString());
}
}
@@ -354,7 +354,7 @@ public class FeedReport extends ReportBase {
feedmap.put("pubcount", n + count);
} catch (JSONException e) {
feedmap.put("pubcount", count);
- logger.error(e);
+ logger.error(e.toString());
}
} else if (type.equals("del")) {
String subid = tt[3];
@@ -363,7 +363,7 @@ public class FeedReport extends ReportBase {
feedmap.put(subid, n + count);
} catch (JSONException e) {
feedmap.put(subid, count);
- logger.error(e);
+ logger.error(e.toString());
}
}
}
@@ -385,7 +385,7 @@ public class FeedReport extends ReportBase {
System.out.println(t);
} catch (Exception e) {
System.err.println(e);
- logger.error(e);
+ logger.error(e.toString());
}
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/ReportBase.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/ReportBase.java
index d24866c3..e5c86c8e 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/ReportBase.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/ReportBase.java
@@ -23,7 +23,8 @@
package org.onap.dmaap.datarouter.reports;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
/**
* Base class for all the report generating classes.
@@ -34,12 +35,12 @@ import org.apache.log4j.Logger;
abstract public class ReportBase implements Runnable {
protected long from, to;
protected String outfile;
- protected Logger logger;
+ protected EELFLogger logger;
public ReportBase() {
this.from = 0;
this.to = System.currentTimeMillis();
- this.logger = Logger.getLogger("org.onap.dmaap.datarouter.reports");
+ this.logger = EELFManager.getInstance().getLogger("ReportLog");;
}
public void setFrom(long from) {
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/VolumeReport.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/VolumeReport.java
index 8d5731f8..7d5268b1 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/VolumeReport.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/VolumeReport.java
@@ -36,7 +36,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
/**
@@ -58,7 +59,7 @@ import org.onap.dmaap.datarouter.provisioning.utils.DB;
public class VolumeReport extends ReportBase {
private static final String SELECT_SQL = "select EVENT_TIME, TYPE, FEEDID, CONTENT_LENGTH, RESULT" +
" from LOG_RECORDS where EVENT_TIME >= ? and EVENT_TIME <= ? LIMIT ?, ?";
- private Logger loggerVolumeReport=Logger.getLogger("org.onap.dmaap.datarouter.reports");
+ private EELFLogger loggerVolumeReport= EELFManager.getInstance().getLogger("ReportLog");;
private class Counters {
int filespublished, filesdelivered, filesexpired;
long bytespublished, bytesdelivered, bytesexpired;
diff --git a/datarouter-prov/src/main/resources/log4j.properties b/datarouter-prov/src/main/resources/log4j.properties
deleted file mode 100644
index 15ba888b..00000000
--- a/datarouter-prov/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,68 +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
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %5p [%t] - %m%n
-
-#
-# Logger used for provisioning events
-#
-log4j.logger.org.onap.dmaap.datarouter.provisioning.events=info, eventlog
-log4j.additivity.org.onap.dmaap.datarouter.provisioning.events=false
-
-log4j.appender.eventlog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.eventlog.file=/root/dr2/logs/provevent.log
-log4j.appender.eventlog.datePattern='.'yyyyMMdd
-log4j.appender.eventlog.append=true
-log4j.appender.eventlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.eventlog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for internal provisioning server events
-#
-log4j.logger.org.onap.dmaap.datarouter.provisioning.internal=debug, intlog
-log4j.additivity.org.onap.dmaap.datarouter.provisioning.internal=false
-
-log4j.appender.intlog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.intlog.file=/root/dr2/logs/provint.log
-log4j.appender.intlog.datePattern='.'yyyyMMdd
-log4j.appender.intlog.append=true
-log4j.appender.intlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.intlog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for policy engine
-#
-log4j.logger.org.onap.dmaap.datarouter.authz.impl.ProvAuthorizer=debug, pelog
-log4j.additivity.org.onap.dmaap.datarouter.authz.impl.ProvAuthorizer=false
-
-log4j.appender.pelog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.pelog.file=/root/dr2/logs/policyengine.log
-log4j.appender.pelog.datePattern='.'yyyyMMdd
-log4j.appender.pelog.append=true
-log4j.appender.pelog.layout=org.apache.log4j.PatternLayout
-log4j.appender.pelog.layout.ConversionPattern=%d %-5p [%t] - %m%n
diff --git a/datarouter-prov/src/main/resources/logback.xml b/datarouter-prov/src/main/resources/logback.xml
index 2a3cd821..afa4df74 100644
--- a/datarouter-prov/src/main/resources/logback.xml
+++ b/datarouter-prov/src/main/resources/logback.xml
@@ -42,13 +42,12 @@
<!-- name="policyLogName" value="policy"-->
<property name="errorLogName" value="errors" />
<!-- name="metricsLogName" value="metrics" -->
- <!-- name="auditLogName" value="audit" -->
- <!-- name="debugLogName" value="debug" -->
- <property name="jettyLogName" value="jetty"></property>
- <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="debugLogName" value="debug"/>
+ <property name="jettyLogName" value="jetty"/>
+ <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="jettyLoggerPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%thread|%.-5level|%msg%n" />
- <property name="debugLoggerPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{InvocationId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|[%caller{3}]|%msg%n" />
+ <property name="debugLoggerPattern" 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}|[%caller{3}]|%msg%n" />
<property name="logDirectory" value="${logDir}" />
<!-- property name="debugLogDirectory" value="${debugDir}/${componentName}" /-->
@@ -327,12 +326,13 @@
<!-- ============================================================================ -->
- <!--appender name="EELFDebug"
+ <appender name="EELFDebug"
class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${debugLogDirectory}/${debugLogName}.log</file>
+ <file>${logDirectory}/${debugLogName}.log</file>
+ <filter class="org.onap.dmaap.datarouter.provisioning.eelf.DebugTraceFilter" />
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>${debugLogDirectory}/${debugLogName}.%i.log.zip
+ <fileNamePattern>${logDirectory}/${debugLogName}.%i.log.zip
</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>9</maxIndex>
@@ -342,7 +342,7 @@
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
<encoder>
- <pattern>${debugLoggerPattern}</pattern>
+ <pattern>${defaultPattern}</pattern>
</encoder>
</appender>
@@ -350,7 +350,7 @@
<queueSize>256</queueSize>
<appender-ref ref="EELFDebug" />
<includeCallerData>true</includeCallerData>
- </appender-->
+ </appender>
<!-- ============================================================================ -->
@@ -368,6 +368,10 @@
<appender-ref ref="asyncEELFjettylog"/>
</logger>
+ <logger name="com.att.eelf.debug" level="debug" additivity="false">
+ <appender-ref ref="asyncEELFDebug" />
+ </logger>
+
<!-- logger name="com.att.eelf.security" level="info" additivity="false">
<appender-ref ref="asyncEELFSecurity" />
</logger>
@@ -396,10 +400,10 @@
- <root level="INFO">
+ <root level="TRACE">
<appender-ref ref="asyncEELF" />
<appender-ref ref="asyncEELFError" />
- <appender-ref ref="asyncEELFjettylog" />
- </root>
+ <appender-ref ref="asyncEELFjettylog" />
+ <appender-ref ref="asyncEELFDebug" /> </root>
</configuration>
diff --git a/datarouter-prov/src/main/resources/misc/log4j.properties.tmpl b/datarouter-prov/src/main/resources/misc/log4j.properties.tmpl
deleted file mode 100644
index 304ee17c..00000000
--- a/datarouter-prov/src/main/resources/misc/log4j.properties.tmpl
+++ /dev/null
@@ -1,76 +0,0 @@
-cat <<!EOF
-# ============LICENSE_START=======================================================
-# org.onap.dmaap
-# ================================================================================
-# Copyright © 2018 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
-
-#
-# Logger used for provisioning events
-#
-log4j.logger.org.onap.dmaap.datarouter.provisioning.events=info, eventlog
-log4j.additivity.org.onap.dmaap.datarouter.provisioning.events=false
-
-log4j.appender.eventlog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.eventlog.file=${DRTR_PROV_LOGS:-/opt/app/datartr/logs}/provevent.log
-log4j.appender.eventlog.datePattern='.'yyyyMMdd
-log4j.appender.eventlog.append=true
-log4j.appender.eventlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.eventlog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for internal provisioning server events
-#
-log4j.logger.org.onap.dmaap.datarouter.provisioning.internal=debug, intlog
-log4j.additivity.org.onap.dmaap.datarouter.provisioning.internal=false
-
-log4j.appender.intlog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.intlog.file=${DRTR_PROV_LOGS:-/opt/app/datartr/logs}/provint.log
-log4j.appender.intlog.datePattern='.'yyyyMMdd
-log4j.appender.intlog.append=true
-log4j.appender.intlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.intlog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for policy engine
-#
-log4j.logger.org.onap.dmaap.datarouter.authz.impl.ProvAuthorizer=debug, pelog
-log4j.additivity.org.onap.dmaap.datarouter.authz.impl.ProvAuthorizer=false
-
-log4j.appender.pelog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.pelog.file=${DRTR_PROV_LOGS:-/opt/app/datartr/logs}/policyengine.log
-log4j.appender.pelog.datePattern='.'yyyyMMdd
-log4j.appender.pelog.append=true
-log4j.appender.pelog.layout=org.apache.log4j.PatternLayout
-log4j.appender.pelog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for Jetty server
-#
-log4j.logger.org.eclipse.jetty=info, jetty
-log4j.additivity.org.eclipse.jetty.server.Server=false
-
-log4j.appender.jetty=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.jetty.file=${DRTR_PROV_LOGS:-/opt/app/datartr/logs}/jetty.log
-log4j.appender.jetty.datePattern='.'yyyyMMdd
-log4j.appender.jetty.append=true
-log4j.appender.jetty.layout=org.apache.log4j.PatternLayout
-log4j.appender.jetty.layout.ConversionPattern=%d %-5p [%t] - %m%n
-!EOF
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServletTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServletTest.java
index e2a2bc21..d014629d 100755
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServletTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServletTest.java
@@ -46,7 +46,6 @@ import javax.persistence.Persistence;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/InternalServletTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/InternalServletTest.java
index b421e99e..edf9ef52 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/InternalServletTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/InternalServletTest.java
@@ -169,7 +169,9 @@ public class InternalServletTest extends DrServletTestBase {
public void Given_Request_Is_HTTP_GET_Starts_With_Logs_In_Endpoint_And_File_Exists_Then_Request_Returns_Ok()
throws Exception {
when(request.getPathInfo()).thenReturn("/logs/testFile.txt");
+ File testDir = new File("unit-test-logs");
File testFile = new File("unit-test-logs/testFile.txt");
+ testDir.mkdirs();
testFile.createNewFile();
testFile.deleteOnExit();
ServletOutputStream outStream = mock(ServletOutputStream.class);
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/PublishServletTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/PublishServletTest.java
index b99e63c0..2202550b 100755
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/PublishServletTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/PublishServletTest.java
@@ -23,7 +23,6 @@
package org.onap.dmaap.datarouter.provisioning;
-import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.read.ListAppender;
import org.apache.commons.lang3.reflect.FieldUtils;
@@ -33,7 +32,6 @@ import org.mockito.Mock;
import org.onap.dmaap.datarouter.provisioning.utils.DB;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
-import org.slf4j.LoggerFactory;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@@ -42,9 +40,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.File;
import java.io.FileNotFoundException;
-import java.io.PrintWriter;
import java.net.InetAddress;
import static org.hamcrest.Matchers.notNullValue;
diff --git a/datarouter-prov/src/test/resources/log4j.properties b/datarouter-prov/src/test/resources/log4j.properties
deleted file mode 100644
index b3be5b02..00000000
--- a/datarouter-prov/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,68 +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=debug, eventlog, intlog, pelog
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %5p [%t] - %m%n
-
-#
-# Logger used for provisioning events
-#
-log4j.logger.org.onap.dmaap.datarouter.provisioning.events=debug, eventlog
-log4j.additivity.org.onap.dmaap.datarouter.provisioning.events=false
-
-log4j.appender.eventlog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.eventlog.file=./unit-test-logs/provevent.log
-log4j.appender.eventlog.datePattern='.'yyyyMMdd
-log4j.appender.eventlog.append=true
-log4j.appender.eventlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.eventlog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for internal provisioning server events
-#
-log4j.logger.org.onap.dmaap.datarouter.provisioning.internal=debug, intlog
-log4j.additivity.org.onap.dmaap.datarouter.provisioning.internal=false
-
-log4j.appender.intlog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.intlog.file=./unit-test-logs/provint.log
-log4j.appender.intlog.datePattern='.'yyyyMMdd
-log4j.appender.intlog.append=true
-log4j.appender.intlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.intlog.layout.ConversionPattern=%d %-5p [%t] - %m%n
-
-#
-# Logger used for policy engine
-#
-log4j.logger.org.onap.dmaap.datarouter.authz.impl.ProvAuthorizer=debug, pelog
-log4j.additivity.org.onap.dmaap.datarouter.authz.impl.ProvAuthorizer=false
-
-log4j.appender.pelog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.pelog.file=./unit-test-logs/policyengine.log
-log4j.appender.pelog.datePattern='.'yyyyMMdd
-log4j.appender.pelog.append=true
-log4j.appender.pelog.layout=org.apache.log4j.PatternLayout
-log4j.appender.pelog.layout.ConversionPattern=%d %-5p [%t] - %m%n