diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core')
3 files changed, 19 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java index f34d09e882..0ca550a20a 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java @@ -20,7 +20,12 @@ import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; import org.slf4j.MDC; -import javax.servlet.*; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.net.InetAddress; @@ -58,7 +63,7 @@ public class LoggingFilter implements Filter { private static final HostAddressCache HOST_ADDRESS = new HostAddressCache(); private static final String UNKNOWN = "UNKNOWN"; - private final static Logger LOGGER = LoggerFactory.getLogger(LoggingFilter.class); + private static final Logger LOGGER = LoggerFactory.getLogger(LoggingFilter.class); public void destroy() { } @@ -80,7 +85,8 @@ public class LoggingFilter implements Filter { InetAddress host = HOST_ADDRESS.get(); - String ipAddress, hostName; + String ipAddress; + String hostName; if (host == null) { ipAddress = UNKNOWN; hostName = UNKNOWN; diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java index 8502d95023..1fda9e85b3 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java @@ -22,7 +22,9 @@ import org.testng.annotations.Test; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -import static org.testng.Assert.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; /** * @author evitaliy diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java index 57911a368f..95a5421be0 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java @@ -20,7 +20,13 @@ import org.slf4j.MDC; import org.testng.Assert; import org.testng.annotations.Test; -import javax.servlet.*; +import javax.servlet.FilterChain; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletInputStream; +import javax.servlet.ServletOutputStream; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; |