Fix audit log to contain ending timestamp
[policy/engine.git] / ONAP-PDP-REST / src / main / java / org / onap / policy / pdp / rest / XACMLPdpServlet.java
index 18c2017..04572cc 100644 (file)
@@ -180,6 +180,14 @@ public class XACMLPdpServlet extends HttpServlet implements Runnable {
        private static volatile boolean configThreadTerminate = false;
        private transient ONAPLoggingContext baseLoggingContext = null;
        private transient IntegrityMonitor im;
+       public IntegrityMonitor getIm() {
+               return im;
+       }
+
+       public void setIm(IntegrityMonitor im) {
+               this.im = im;
+       }
+
        /**
         * Default constructor. 
         */
@@ -221,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);
                }