summaryrefslogtreecommitdiffstats
path: root/ONAP-PDP-REST/src
diff options
context:
space:
mode:
authorMike Babinski <mb1915@att.com>2017-12-08 00:02:50 +0000
committerMike Babinski <mb1915@att.com>2017-12-12 16:44:02 +0000
commitf799af84c1777d1b56641c758bdf6064b494d71d (patch)
tree24bc488408fae831271e08fb220b1a3b40e78327 /ONAP-PDP-REST/src
parent775f45908025e46a40c9c147fca2066af5c8c5b8 (diff)
Fix audit log to contain ending timestamp
Add transaction end method Change-Id: Ie818bb1650b0847800ce5481a85c5d2c8d7f4b9c Issue-ID: POLICY-494 Signed-off-by: Mike Babinski <mb1915@att.com>
Diffstat (limited to 'ONAP-PDP-REST/src')
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpRegisterThread.java2
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpRegisterThread.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpRegisterThread.java
index 14b312f6d..49400d615 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpRegisterThread.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpRegisterThread.java
@@ -248,8 +248,8 @@ public class XACMLPdpRegisterThread implements Runnable {
}
} catch (Exception e) {
LOGGER.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e);
+ loggingContext.transactionEnded();
PolicyLogger.audit("Transaction Failed - See Error.log");
- loggingContext.transactionEnded();
papUrls.failed();
} finally {
// cleanup the connection
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java
index b824312dc..04572ccbc 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java
@@ -229,8 +229,8 @@ public class XACMLPdpServlet extends HttpServlet implements Runnable {
baseLoggingContext = new ONAPLoggingContext();
// fixed data that will be the same in all logging output goes here
try {
- String ipaddress = InetAddress.getLocalHost().getHostAddress();
- baseLoggingContext.setServer(ipaddress);
+ String hostname = InetAddress.getLocalHost().getCanonicalHostName();
+ baseLoggingContext.setServer(hostname);
} catch (UnknownHostException e) {
logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Unable to get hostname for logging"+e);
}