diff --git a/onboarding/pom.xml b/onboarding/pom.xml
index 794f28a..bbc6396 100644
--- a/onboarding/pom.xml
+++ b/onboarding/pom.xml
@@ -51,16 +51,14 @@
         <aspectj.version>1.8.9</aspectj.version>
         <aspectjrt.version>${aspectj.version}</aspectjrt.version>
         <bsh.version>2.0b5</bsh.version>
-        <cglib.nodep.version>3.2.4</cglib.nodep.version> <!--old : 2.1_3. new 3.2.4 -->
+        <cglib.nodep.version>3.2.4</cglib.nodep.version>
         <classmate.version>1.3.3</classmate.version>
         <commons.beanutils.version>1.9.3</commons.beanutils.version>
-        <commons.codec.version>1.10
-        </commons.codec.version> <!-- orignal 1.6 updated to resolve blackduck violation -->
+        <commons.codec.version>1.10</commons.codec.version>
         <commons.collections.version>4.1</commons.collections.version>
         <commons.digester.version>2.1</commons.digester.version>
         <commons.io.version>2.5</commons.io.version>
-        <commons.lang.version>2.6
-        </commons.lang.version> <!-- orignal 2.5. updated to resolve blackduck violation -->
+        <commons.lang.version>2.6</commons.lang.version>
         <commons.lang3.version>3.4</commons.lang3.version>
         <cxf.version>3.1.8</cxf.version>
         <datastax.cassandra.version>3.4.0</datastax.cassandra.version>
@@ -69,7 +67,6 @@
         <gson.version>2.3.1</gson.version>
         <fop.version>2.2</fop.version>
         <freemarker.version>2.3.26-incubating</freemarker.version>
-        <!--5.3.1.Final changed to 5.3.3.Final to include jboss-logging 3.3.0.Final for 1702 -->
         <hibernate.validator.version>5.3.3.Final</hibernate.validator.version>
         <http.client.version>4.5.3</http.client.version>
         <http.core.version>4.4.1</http.core.version>
@@ -79,8 +76,7 @@
         <java.source>1.8</java.source>
         <java.target>1.8</java.target>
         <javax.el.version>2.2.4</javax.el.version>
-        <javax.el-api.version>3.0.1-b04
-        </javax.el-api.version> <!-- orignal 2.2.4 updated to resolve blackduck violation -->
+        <javax.el-api.version>3.0.1-b04</javax.el-api.version>
         <javax.inject.version>1</javax.inject.version>
         <javax.servlet.version>2.5</javax.servlet.version>
         <jackson.version>2.8.1</jackson.version>
@@ -94,22 +90,19 @@
         <junit.version>4.12</junit.version>
         <logback.version>1.2.3</logback.version>
         <mockito.all.version>1.10.19</mockito.all.version>
-        <org.codehaus.jackson.version>1.9.13</org.codehaus.jackson.version> <!-- orignal 1.9.2 -->
-        <org.everit.json.schema.version>1.5.1
-        </org.everit.json.schema.version> <!--new 1.4.1 orignal 1.3.0 updated to resolve blackduck violation -->
-        <org.reflections.version>0.9.10
-        </org.reflections.version> <!-- orignal 0.9.9 updated to resolve blackduck violation -->
-        <powermock.version>1.6.5</powermock.version>
+        <org.codehaus.jackson.version>1.9.13</org.codehaus.jackson.version>
+        <org.everit.json.schema.version>1.5.1</org.everit.json.schema.version>
+        <org.reflections.version>0.9.10</org.reflections.version>
+        <powermock.version>2.0.0-beta.5</powermock.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <servlet.version>2.5</servlet.version>
         <slf4j.version>1.7.21</slf4j.version>
         <snakeyaml.version>1.17</snakeyaml.version>
-        <spring.framework.version>4.3.15.RELEASE</spring.framework.version> <!-- orignal 4.0.7.RELEASE 4.1.3.RELEASE-->
+        <spring.framework.version>4.3.15.RELEASE</spring.framework.version>
         <swagger.version>1.5.3</swagger.version>
-        <testng.version>6.9.10</testng.version> <!--new 6.9.13.6 still shows blackduck risk -->
+        <testng.version>6.9.10</testng.version>
         <woodstox.version>4.4.1</woodstox.version>
-        <ws.rs.version>2.0.1
-        </ws.rs.version>  <!--  New version 2.0.1 to fix blackduck violation Failing with comiplation issues-->
+        <ws.rs.version>2.0.1</ws.rs.version>
         <zusammen.version>1.0.1</zusammen.version>
         <zusammen-state-store.version>1.0.1</zusammen-state-store.version>
         <zusammen-collaboration-store.version>1.0.1</zusammen-collaboration-store.version>
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
index 29efa61..2bd26ed 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
@@ -34,29 +34,17 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.easymock</groupId>
-            <artifactId>easymock</artifactId>
-            <version>${easymock.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-api-easymock</artifactId>
-            <version>${powermock.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-core</artifactId>
-            <version>${powermock.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-module-junit4</artifactId>
             <version>${powermock.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-api-mockito2</artifactId>
+            <version>${powermock.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java
index 30517cd..96debb5 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java
@@ -16,9 +16,8 @@
 
 package org.openecomp.sdc.logging.api;
 
-import org.openecomp.sdc.logging.spi.LoggerCreationService;
-
 import java.util.Objects;
+import org.openecomp.sdc.logging.spi.LoggerCreationService;
 
 /**
  * <a>Factory to hide a concrete, framework-specific implementation of logger creation.</a>
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggingContext.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggingContext.java
index 9526713..894dd2c 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggingContext.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggingContext.java
@@ -16,10 +16,9 @@
 
 package org.openecomp.sdc.logging.api;
 
-import org.openecomp.sdc.logging.spi.LoggingContextService;
-
 import java.util.Objects;
 import java.util.concurrent.Callable;
+import org.openecomp.sdc.logging.spi.LoggingContextService;
 
 /**
  * <p>Factory to hide a concrete, framework-specific implementation of diagnostic context.</p>
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/ServiceBinder.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/ServiceBinder.java
index 5aaa301..6e5b3e3 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/ServiceBinder.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/ServiceBinder.java
@@ -16,13 +16,12 @@
 
 package org.openecomp.sdc.logging.api;
 
-import org.openecomp.sdc.logging.spi.LoggerCreationService;
-import org.openecomp.sdc.logging.spi.LoggingContextService;
-import org.openecomp.sdc.logging.spi.LoggingServiceProvider;
-
 import java.util.Iterator;
 import java.util.Optional;
 import java.util.ServiceLoader;
+import org.openecomp.sdc.logging.spi.LoggerCreationService;
+import org.openecomp.sdc.logging.spi.LoggingContextService;
+import org.openecomp.sdc.logging.spi.LoggingServiceProvider;
 
 /**
  * <p>Binds to a concrete implementation of logging services.</p>
@@ -37,7 +36,7 @@
 
 // No advanced logging can be used here because we don't know
 // which underlying implementation will be used
-@SuppressWarnings({"UseOfSystemOutOrSystemErr", "squid:S106"})
+@SuppressWarnings({"UseOfSystemOutOrSystemErr", "squid:S106", "squid:S1166"})
 class ServiceBinder {
 
     private static final LoggingServiceProvider PROVIDER = lookupProvider();
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/AuditTracker.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/AuditTracker.java
new file mode 100644
index 0000000..af9b506
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/AuditTracker.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import java.util.Objects;
+import javax.servlet.http.HttpServletRequest;
+import org.openecomp.sdc.logging.api.AuditData;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+/**
+ * Tracks and logs audit information when a request is being processed. An instance of this class cannot be reused, and
+ * the pre- and post-request methods must be called only once.
+ *
+ * @author evitaliy
+ * @since 31 Jul 2018
+ */
+public class AuditTracker implements Tracker {
+
+    private final Logger logger;
+    private volatile long started;
+    private volatile String clientIpAddress;
+
+    /**
+     * Allows passing a class that will be used to log audit.
+     *
+     * @param resourceType audit will be logged through the logger of this class
+     */
+    public AuditTracker(Class<?> resourceType) {
+        this.logger = LoggerFactory.getLogger(resourceType);
+    }
+
+    /**
+     * Allows passing a logger that will be used to log audit.
+     *
+     * @param logger audit will be logged through this logger, cannot be null
+     */
+    public AuditTracker(Logger logger) {
+        this.logger = Objects.requireNonNull(logger);
+    }
+
+    @Override
+    public synchronized void preRequest(HttpServletRequest request) {
+
+        if (this.started > 0) {
+            throw new IllegalStateException("Pre-request has been already called");
+        }
+
+        this.started = System.currentTimeMillis();
+        this.clientIpAddress = request.getRemoteAddr();
+    }
+
+    @Override
+    public synchronized void postRequest(RequestProcessingResult result) {
+
+        if (this.started == 0) {
+            throw new IllegalStateException("Pre-request must be called first");
+        }
+
+        if (!logger.isAuditEnabled()) {
+            return;
+        }
+
+        long end = System.currentTimeMillis();
+        AuditData auditData = AuditData.builder().startTime(started).endTime(end).statusCode(result.getStatusCode())
+                                      .responseCode(Integer.toString(result.getStatus()))
+                                      .responseDescription(result.getStatusPhrase()).clientIpAddress(clientIpAddress)
+                                      .build();
+        logger.audit(auditData);
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/CombinedTracker.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/CombinedTracker.java
new file mode 100644
index 0000000..2dd2c12
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/CombinedTracker.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import javax.servlet.http.HttpServletRequest;
+import org.openecomp.sdc.logging.api.Logger;
+
+/**
+ * Tracker for all the elements of ONAP logging and tracing at an entry point to an application - context and audit.
+ * The order of invocations is important, assuming the context must be kept as long as audit hasn't been finished.
+ *
+ * @author evitaliy
+ * @since 01 Aug 2018
+ */
+public class CombinedTracker implements Tracker {
+
+    private final ContextTracker context;
+    private final AuditTracker audit;
+
+    public CombinedTracker(Logger logger, HttpHeader partnerNameHeader, HttpHeader requestIdHeader) {
+        this.context = new ContextTracker(partnerNameHeader, requestIdHeader);
+        this.audit = new AuditTracker(logger);
+    }
+
+    public CombinedTracker(Class<?> resourceType, HttpHeader partnerNameHeader, HttpHeader requestIdHeader) {
+        this.context = new ContextTracker(partnerNameHeader, requestIdHeader);
+        this.audit = new AuditTracker(resourceType);
+    }
+
+    @Override
+    public void preRequest(HttpServletRequest request) {
+        this.context.preRequest(request);
+        this.audit.preRequest(request);
+    }
+
+    @Override
+    public void postRequest(RequestProcessingResult result) {
+        this.audit.postRequest(result);
+        this.context.postRequest(result);
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/ContextTracker.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/ContextTracker.java
new file mode 100644
index 0000000..2334f37
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/ContextTracker.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import java.util.Objects;
+import java.util.UUID;
+import javax.servlet.http.HttpServletRequest;
+import org.openecomp.sdc.logging.api.ContextData;
+import org.openecomp.sdc.logging.api.LoggingContext;
+
+/**
+ * Populates the context before a request is processed, and cleans it after the request has been processed.
+ *
+ * @author evitaliy
+ * @since 31 Jul 2018
+ */
+public class ContextTracker implements Tracker {
+
+    private final HttpHeader partnerNameHeaders;
+    private final HttpHeader requestIdHeaders;
+
+    /**
+     * Constructs tracker to handle required logging context in Servlet-based applications. Refer to ONAP logging
+     * guidelines for fields required to be put on logging context.
+     *
+     * @param partnerNameHeaders HTTP headers to check for a partner name, cannot be null
+     * @param requestIdHeaders   HTTP headers to check for a request ID, cannot be null
+     */
+    public ContextTracker(HttpHeader partnerNameHeaders, HttpHeader requestIdHeaders) {
+        this.partnerNameHeaders = Objects.requireNonNull(partnerNameHeaders);
+        this.requestIdHeaders = Objects.requireNonNull(requestIdHeaders);
+    }
+
+    @Override
+    public void preRequest(HttpServletRequest request) {
+
+        LoggingContext.clear();
+
+        String serviceName = ServiceNameFormatter.format(request);
+        String requestId = requestIdHeaders.getAny(request::getHeader).orElse(UUID.randomUUID().toString());
+        ContextData.ContextDataBuilder contextBuilder =
+                ContextData.builder().serviceName(serviceName).requestId(requestId);
+
+        partnerNameHeaders.getAny(request::getHeader).ifPresent(contextBuilder::partnerName);
+        LoggingContext.put(contextBuilder.build());
+    }
+
+    @Override
+    public void postRequest(RequestProcessingResult result) {
+        LoggingContext.clear();
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/HttpHeader.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/HttpHeader.java
index 4dcc197..db10c2e 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/HttpHeader.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/HttpHeader.java
@@ -16,6 +16,11 @@
 
 package org.openecomp.sdc.logging.servlet;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.function.Function;
 
 /**
@@ -28,28 +33,80 @@
  */
 public class HttpHeader {
 
-    private final String[] keys;
+    private static final String NAMES_CANNOT_BE_NULL = "Names cannot be null";
+    private static final String AT_LEAST_ONE_NAME_REQUIRED = "At least one name required";
 
-    public HttpHeader(String... keys) {
-        this.keys = keys;
+    private final List<String> headerNames;
+
+    /**
+     * Receives a list of accepted header names as a String array.
+     *
+     * @param headerNames cannot be null or empty
+     */
+    public HttpHeader(String[] headerNames) {
+
+        if (Objects.requireNonNull(headerNames, NAMES_CANNOT_BE_NULL).length < 1) {
+            throw new IllegalArgumentException(AT_LEAST_ONE_NAME_REQUIRED);
+        }
+
+        this.headerNames = Arrays.asList(headerNames);
+    }
+
+    /**
+     * Receives a list of accepted header names as a list of String.
+     *
+     * @param headerNames cannot be null or empty
+     */
+    public HttpHeader(List<String> headerNames) {
+
+        if (Objects.requireNonNull(headerNames, NAMES_CANNOT_BE_NULL).isEmpty()) {
+            throw new IllegalArgumentException(AT_LEAST_ONE_NAME_REQUIRED);
+        }
+
+        this.headerNames = new ArrayList<>(headerNames);
     }
 
     /**
      * Returns the value of any of the possible headers.
      *
      * @param reader function for reading an HTTP header.
-     * @return value or null if not found
+     * @return value or empty if not found
      */
-    public String getAny(Function<String, String> reader) {
+    public Optional<String> getAny(Function<String, String> reader) {
 
-        for (String k : keys) {
+        for (String k : headerNames) {
 
             String value = reader.apply(k);
             if (value != null) {
-                return value;
+                return Optional.of(value);
             }
         }
 
-        return null;
+        return Optional.empty();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        HttpHeader that = (HttpHeader) o;
+        return Objects.equals(headerNames, that.headerNames);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(headerNames);
+    }
+
+    @Override
+    public String toString() {
+        return "HttpHeader{headerNames=" + headerNames + '}';
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java
deleted file mode 100644
index e53f281..0000000
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * 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.
- */
-
-package org.openecomp.sdc.logging.servlet;
-
-import static org.openecomp.sdc.logging.LoggingConstants.DEFAULT_PARTNER_NAME_HEADER;
-import static org.openecomp.sdc.logging.LoggingConstants.DEFAULT_REQUEST_ID_HEADER;
-
-import java.io.IOException;
-import java.util.UUID;
-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 org.openecomp.sdc.logging.api.ContextData;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.api.LoggingContext;
-import org.openecomp.sdc.logging.servlet.jaxrs.LoggingRequestFilter;
-import org.openecomp.sdc.logging.servlet.jaxrs.LoggingResponseFilter;
-
-/**
- * <p>Places logging context information. Must be configured as a servlet filter in <i>web.xml</i>. The behavior can be
- * customized via init-params.</p>
- * <p>Example:</p>
- * <pre>
- *
- *  &lt;filter&gt;
- *      &lt;filter-name&gt;LoggingServletFilter&lt;/filter-name&gt;
- *      &lt;filter-class&gt;org.openecomp.sdc.logging.servlet.LoggingFilter&lt;/filter-class&gt;
- *      &lt;init-param&gt;
- *          &lt;param-name&gt;requestIdHeaders&lt;/param-name&gt;
- *          &lt;param-value&gt;X-ONAP-RequestID&lt;/param-value&gt;
- *      &lt;/init-param&gt;
- *      &lt;init-param&gt;
- *          &lt;param-name&gt;partnerNameHeaders&lt;/param-name&gt;
- *          &lt;param-value&gt;USER_ID&lt;/param-value&gt;
- *      &lt;/init-param&gt;
- *  &lt;/filter&gt;
- *
- *  &lt;filter-mapping&gt;
- *      &lt;filter-name&gt;LoggingServletFilter&lt;/filter-name&gt;
- *      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
- *  &lt;/filter-mapping&gt;
- *
- * </pre>
- *
- * @author evitaliy
- * @since 25 Jul 2016
- * @deprecated Kept for backward compatibility. For JAX-RS application, use
- * {@link LoggingRequestFilter} and
- * {@link LoggingResponseFilter} instead.
- */
-@Deprecated
-public class LoggingFilter implements Filter {
-
-    static final String MULTI_VALUE_SEPARATOR = ",";
-
-    static final String REQUEST_ID_HEADERS_PARAM = "requestIdHeaders";
-    static final String PARTNER_NAME_HEADERS_PARAM = "partnerNameHeaders";
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(LoggingFilter.class);
-
-    private HttpHeader requestIdHeaders;
-    private HttpHeader partnerNameHeaders;
-
-    @Override
-    public void init(FilterConfig config) {
-        requestIdHeaders = getInitParam(config, REQUEST_ID_HEADERS_PARAM, DEFAULT_REQUEST_ID_HEADER);
-        partnerNameHeaders = getInitParam(config, PARTNER_NAME_HEADERS_PARAM, DEFAULT_PARTNER_NAME_HEADER);
-    }
-
-    @Override
-    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
-            throws IOException, ServletException {
-
-        HttpServletRequest httpRequest = HttpServletRequest.class.cast(request);
-
-        try {
-
-            LoggingContext.clear();
-
-            ContextData.ContextDataBuilder contextData = ContextData.builder();
-
-            contextData.serviceName(httpRequest.getRequestURI());
-
-            String requestId = requestIdHeaders.getAny(httpRequest::getHeader);
-            contextData.requestId(requestId == null ? UUID.randomUUID().toString() : requestId);
-
-            String partner = partnerNameHeaders.getAny(httpRequest::getHeader);
-            if (partner != null) {
-                contextData.partnerName(partner);
-            }
-
-            LoggingContext.put(contextData.build());
-
-            chain.doFilter(request, response);
-
-        } finally {
-            LoggingContext.clear();
-        }
-    }
-
-    @Override
-    public void destroy() {
-        // forced by the interface - not implemented
-    }
-
-    private HttpHeader getInitParam(FilterConfig config, String paramName, String defaultValue) {
-
-        String value = config.getInitParameter(paramName);
-        LOGGER.debug("Logging filter configuration param '{}' value '{}'", paramName, value);
-
-        if (value == null) {
-            return new HttpHeader(defaultValue);
-        } else {
-            return new HttpHeader(value.split(MULTI_VALUE_SEPARATOR));
-        }
-    }
-}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/RequestProcessingResult.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/RequestProcessingResult.java
new file mode 100644
index 0000000..d3625ed
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/RequestProcessingResult.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import org.openecomp.sdc.logging.api.StatusCode;
+
+/**
+ * Interpretation of request processing results.
+ *
+ * @author evitaliy
+ * @since 02 Aug 2018
+ */
+public interface RequestProcessingResult {
+
+    /**
+     * Numeric status code.
+     *
+     * @return usually HTTP response status.
+     */
+    int getStatus();
+
+    /**
+     * Whether the response is considered success or failure.
+     *
+     * @return on of pre-defined status codes
+     */
+    StatusCode getStatusCode();
+
+    /**
+     * Human-friendly description of the numeric status.
+     *
+     * @return usually HTTP reason phrase
+     */
+    String getStatusPhrase();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/ServiceNameFormatter.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/ServiceNameFormatter.java
new file mode 100644
index 0000000..f65490b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/ServiceNameFormatter.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Formats a service name based on HTTP method and request URI.
+ *
+ * @author evitaliy
+ * @since 01 Aug 2018
+ */
+class ServiceNameFormatter {
+
+    private ServiceNameFormatter() {
+        // utility class, prevent instantiation
+    }
+
+    public static String format(HttpServletRequest request) {
+        return request.getMethod() + ": " + request.getRequestURI();
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/Tracker.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/Tracker.java
new file mode 100644
index 0000000..c0337cf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/Tracker.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Tracks logging and tracing information through the processing of an HTTP request.
+ *
+ * @author evitaliy
+ * @since 31 Jul 2018
+ */
+public interface Tracker {
+
+    /**
+     * Will be executed before request processing has started.
+     *
+     * @param request provided by every Servlet container
+     */
+    void preRequest(HttpServletRequest request);
+
+    /**
+     * Will be executed after a request has been processed.  Results may be treated differently depending on a container
+     * and application. For instance, JAX-RS applications may take into account exception mappers before generating a
+     * response; some applications may Swagger annotations to map a response status to a human-friendly message, etc.
+     *
+     * @param result application- and container-specific request results
+     */
+    void postRequest(RequestProcessingResult result);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilter.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilter.java
index 0e1b7d7..f846359 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilter.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilter.java
@@ -19,25 +19,24 @@
 import static org.openecomp.sdc.logging.LoggingConstants.DEFAULT_PARTNER_NAME_HEADER;
 import static org.openecomp.sdc.logging.LoggingConstants.DEFAULT_REQUEST_ID_HEADER;
 
-import java.util.UUID;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.container.ResourceInfo;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.ext.Provider;
-import org.openecomp.sdc.logging.api.ContextData;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.api.LoggingContext;
+import org.openecomp.sdc.logging.servlet.CombinedTracker;
 import org.openecomp.sdc.logging.servlet.HttpHeader;
+import org.openecomp.sdc.logging.servlet.Tracker;
 
 /**
  * <p>Takes care of logging initialization an HTTP request hits the application. This includes populating logging
- * context and storing the request processing start time, so that it can be used for audit. The filter was built
- * <b>works in tandem</b> with {@link LoggingResponseFilter} or a similar implementation.</p>
+ * context and tracking the request for audit. The filter <b>works in tandem</b> with {@link LoggingResponseFilter} or
+ * a similar implementation.</p>
  * <p>The filter requires a few HTTP header names to be configured. These HTTP headers are used for propagating logging
- * and tracing information between ONAP components.</p>
- * <p>Sample configuration for a Spring environment:</p>
+ * and tracing information between ONAP components. Sample configuration for a Spring environment:</p>
  * <pre>
  *     &lt;jaxrs:providers&gt;
  *         &lt;bean class="org.openecomp.sdc.logging.ws.rs.LoggingRequestFilter"&gt;
@@ -51,24 +50,33 @@
  * </p>
  *
  * @author evitaliy, katyr
- * @since 29 Oct 17
- *
  * @see ContainerRequestFilter
+ * @since 29 Oct 17
  */
 @Provider
 public class LoggingRequestFilter implements ContainerRequestFilter {
 
-    static final String MULTI_VALUE_SEPARATOR = ",";
+    static final String LOGGING_TRACKER_KEY = "onap.logging.tracker";
 
-    static final String START_TIME_KEY = "audit.start.time";
-
+    private static final String MULTI_VALUE_SEPARATOR = ",";
     private static final Logger LOGGER = LoggerFactory.getLogger(LoggingRequestFilter.class);
 
     private HttpServletRequest httpRequest;
 
-    private HttpHeader requestIdHeader = new HttpHeader(DEFAULT_REQUEST_ID_HEADER);
-    private HttpHeader partnerNameHeader = new HttpHeader(DEFAULT_PARTNER_NAME_HEADER);
-    private boolean includeHttpMethod = true;
+    private HttpHeader requestIdHeader = new HttpHeader(new String[] {DEFAULT_REQUEST_ID_HEADER});
+    private HttpHeader partnerNameHeader = new HttpHeader(new String[] {DEFAULT_PARTNER_NAME_HEADER});
+
+    private ResourceInfo resource;
+
+    /**
+     * Injection of a resource that matches the request from JAX-RS context.
+     *
+     * @param resource automatically injected by JAX-RS container
+     */
+    @Context
+    public void setResource(ResourceInfo resource) {
+        this.resource = resource;
+    }
 
     /**
      * Injection of HTTP request object from JAX-RS context.
@@ -81,13 +89,6 @@
     }
 
     /**
-     * Configuration parameter to include the HTTP method of a request in service name.
-     */
-    public void setHttpMethodInServiceName(boolean includeHttpMethod) {
-        this.includeHttpMethod = includeHttpMethod;
-    }
-
-    /**
      * Configuration parameter for request ID HTTP header.
      */
     public void setRequestIdHeaders(String requestIdHeaders) {
@@ -104,33 +105,10 @@
     }
 
     @Override
-    public void filter(ContainerRequestContext containerRequestContext) {
-
-        LoggingContext.clear();
-
-        containerRequestContext.setProperty(START_TIME_KEY, System.currentTimeMillis());
-
-        ContextData.ContextDataBuilder contextData = ContextData.builder();
-        contextData.serviceName(getServiceName());
-
-        String partnerName = partnerNameHeader.getAny(containerRequestContext::getHeaderString);
-        if (partnerName != null) {
-            contextData.partnerName(partnerName);
-        }
-
-        String requestId = requestIdHeader.getAny(containerRequestContext::getHeaderString);
-        contextData.requestId(requestId == null ? UUID.randomUUID().toString() : requestId);
-
-        LoggingContext.put(contextData.build());
-    }
-
-    private String getServiceName() {
-        return includeHttpMethod
-                       ? formatServiceName(this.httpRequest.getMethod(), this.httpRequest.getRequestURI())
-                       : this.httpRequest.getRequestURI();
-    }
-
-    static String formatServiceName(String httpMethod, String requestUri) {
-        return httpMethod + " " + requestUri;
+    public void filter(ContainerRequestContext requestContext) {
+        Class<?> resourceClass = resource.getResourceMethod().getDeclaringClass();
+        Tracker tracker = new CombinedTracker(resourceClass, partnerNameHeader, requestIdHeader);
+        requestContext.setProperty(LOGGING_TRACKER_KEY, tracker);
+        tracker.preRequest(httpRequest);
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilter.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilter.java
index 4609620..fa9e815 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilter.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilter.java
@@ -16,19 +16,22 @@
 
 package org.openecomp.sdc.logging.servlet.jaxrs;
 
-import org.openecomp.sdc.logging.api.*;
+import static javax.ws.rs.core.Response.Status.Family.REDIRECTION;
+import static javax.ws.rs.core.Response.Status.Family.SUCCESSFUL;
+import static org.openecomp.sdc.logging.api.StatusCode.COMPLETE;
+import static org.openecomp.sdc.logging.api.StatusCode.ERROR;
+import static org.openecomp.sdc.logging.servlet.jaxrs.LoggingRequestFilter.LOGGING_TRACKER_KEY;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerResponseContext;
 import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.container.ResourceInfo;
-import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.ext.Provider;
-
-import static org.openecomp.sdc.logging.api.StatusCode.COMPLETE;
-import static org.openecomp.sdc.logging.api.StatusCode.ERROR;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.StatusCode;
+import org.openecomp.sdc.logging.servlet.RequestProcessingResult;
+import org.openecomp.sdc.logging.servlet.Tracker;
 
 /**
  * <p>Takes care of logging when an HTTP request leaves the application. This includes writing to audit and clearing
@@ -44,123 +47,49 @@
  * due to unhandled application or container exceptions.</i></p>
  *
  * @author evitaliy
- * @since 29 Oct 17
- *
  * @see ContainerResponseFilter
+ * @since 29 Oct 17
  */
 @Provider
 public class LoggingResponseFilter implements ContainerResponseFilter {
 
-    private static final int UNKNOWN_START_TIME = 0;
-
     private static final Logger LOGGER = LoggerFactory.getLogger(LoggingResponseFilter.class);
 
-    /**
-     * Tracks reporting configuration problems to the log. We want to report them only once, and not to write to log
-     * upon every request, as the configuration will not change in runtime.
-     */
-    private boolean reportBadConfiguration = true;
-
-    private HttpServletRequest httpRequest;
-
-    private ResourceInfo resource;
-
-    /**
-     * Injection of HTTP request object from JAX-RS context.
-     *
-     * @param httpRequest automatically injected by JAX-RS container
-     */
-    @Context
-    public void setHttpRequest(HttpServletRequest httpRequest) {
-        this.httpRequest = httpRequest;
-    }
-
-    /**
-     * Injection of a resource that matches the request from JAX-RS context.
-     *
-     * @param resource automatically injected by JAX-RS container
-     */
-    @Context
-    public void setResource(ResourceInfo resource) {
-        this.resource = resource;
-    }
-
     @Override
-    public void filter(ContainerRequestContext containerRequestContext,
-            ContainerResponseContext containerResponseContext) {
+    public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {
 
-        try {
+        Tracker tracker = (Tracker) requestContext.getProperty(LOGGING_TRACKER_KEY);
 
-            if ((resource == null) || (resource.getResourceClass() == null)) {
-                LOGGER.debug("No matching resource, skipping audit.");
-                return;
-            }
-
-            writeAudit(containerRequestContext, containerResponseContext);
-
-        } finally {
-            LoggingContext.clear();
-        }
-    }
-
-    private void writeAudit(ContainerRequestContext containerRequestContext,
-            ContainerResponseContext containerResponseContext) {
-
-        Logger resourceLogger = LoggerFactory.getLogger(resource.getResourceMethod().getDeclaringClass());
-        if (!resourceLogger.isAuditEnabled()) {
+        if (tracker == null) {
+            LOGGER.debug("No logging tracker received");
             return;
         }
 
-        long start = readStartTime(containerRequestContext);
-        long end = System.currentTimeMillis();
-
-        Response.StatusType statusInfo = containerResponseContext.getStatusInfo();
-        int responseCode = statusInfo.getStatusCode();
-        StatusCode statusCode = isSuccess(responseCode) ? COMPLETE : ERROR;
-
-        AuditData auditData = AuditData.builder().startTime(start).endTime(end).statusCode(statusCode)
-                                       .responseCode(Integer.toString(responseCode))
-                                       .responseDescription(statusInfo.getReasonPhrase())
-                                       .clientIpAddress(httpRequest.getRemoteAddr()).build();
-        resourceLogger.audit(auditData);
+        tracker.postRequest(new ContainerResponseResult(responseContext.getStatusInfo()));
     }
 
-    private boolean isSuccess(int responseCode) {
-        return responseCode > 199 && responseCode < 400;
-    }
+    private static class ContainerResponseResult implements RequestProcessingResult {
 
-    private long readStartTime(ContainerRequestContext containerRequestContext) {
+        private final Response.StatusType statusInfo;
 
-        Object startTime = containerRequestContext.getProperty(LoggingRequestFilter.START_TIME_KEY);
-        if (startTime == null) {
-            return handleMissingStartTime();
+        private ContainerResponseResult(Response.StatusType statusInfo) {
+            this.statusInfo = statusInfo;
         }
 
-        return parseStartTime(startTime);
-    }
-
-    private long handleMissingStartTime() {
-        reportConfigProblem("{} key was not found in JAX-RS request context. "
-                + "Make sure you configured a request filter", LoggingRequestFilter.START_TIME_KEY);
-        return UNKNOWN_START_TIME;
-    }
-
-    private long parseStartTime(Object startTime) {
-
-        try {
-            return Long.class.cast(startTime);
-        } catch (ClassCastException e) {
-            reportConfigProblem("{} key in JAX-RS request context contains an object of type '{}', but 'java.lang.Long'"
-                    + " is expected", LoggingRequestFilter.START_TIME_KEY, startTime.getClass().getName(), e);
-            return 0;
+        @Override
+        public int getStatus() {
+            return statusInfo.getStatusCode();
         }
-    }
 
-    private void reportConfigProblem(String message, Object... arguments) {
+        @Override
+        public StatusCode getStatusCode() {
+            Response.Status.Family family = statusInfo.getFamily();
+            return family.equals(SUCCESSFUL) || family.equals(REDIRECTION) ? COMPLETE : ERROR;
+        }
 
-        if (reportBadConfiguration) {
-            reportBadConfiguration = false;
-            LOGGER.error(message, arguments);
+        @Override
+        public String getStatusPhrase() {
+            return statusInfo.getReasonPhrase();
         }
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggerCreationService.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggerCreationService.java
index 90aebfa..54b5be3 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggerCreationService.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggerCreationService.java
@@ -20,7 +20,6 @@
 import org.openecomp.sdc.logging.api.LoggerFactory;
 
 /**
- *
  * Implements a framework-specific logging, to be used by {@link LoggerFactory}.
  *
  * @author evitaliy
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggingContextService.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggingContextService.java
index 7c71465..37e212a 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggingContextService.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/spi/LoggingContextService.java
@@ -16,9 +16,8 @@
 
 package org.openecomp.sdc.logging.spi;
 
-import org.openecomp.sdc.logging.api.ContextData;
-
 import java.util.concurrent.Callable;
+import org.openecomp.sdc.logging.api.ContextData;
 
 /**
  * Should be used to implement a framework-specific mechanism of managing a per-thread diagnostic context (for instance
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/AuditTrackerTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/AuditTrackerTest.java
new file mode 100644
index 0000000..1bd13a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/AuditTrackerTest.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import javax.servlet.http.HttpServletRequest;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.openecomp.sdc.logging.api.AuditData;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.StatusCode;
+
+/**
+ * Test initialization and of audit tracker and log invocation.
+ *
+ * @author evitaliy
+ * @since 01 Aug 2018
+ */
+public class AuditTrackerTest {
+
+    @Test(expected = NullPointerException.class)
+    public void throwExceptionWhenLoggerNull() {
+        new AuditTracker((Logger) null);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void throwExceptionWhenResourceTypeNull() {
+        new AuditTracker((Class<?>) null);
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void throwExceptionWhenPreRequestCalledMoreThanOnce() {
+        AuditTracker tracker = new AuditTracker(mock(Logger.class));
+        HttpServletRequest request = mock(HttpServletRequest.class);
+        tracker.preRequest(request);
+        tracker.preRequest(request);
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void throwExceptionWhenRreRequestNeverCalled() {
+        AuditTracker tracker = new AuditTracker(mock(Logger.class));
+        tracker.postRequest(mock(RequestProcessingResult.class));
+    }
+
+    @Test
+    public void nothingHappensWhenAuditDisabled() {
+
+        Logger logger = mock(Logger.class);
+        when(logger.isAuditEnabled()).thenReturn(false);
+
+        AuditTracker tracker = new AuditTracker(logger);
+        tracker.preRequest(mock(HttpServletRequest.class));
+        tracker.postRequest(mock(RequestProcessingResult.class));
+
+        verify(logger, never()).audit(any(AuditData.class));
+    }
+
+    @Test
+    public void reportedTimePositive() {
+
+        Logger logger = mock(Logger.class);
+        when(logger.isAuditEnabled()).thenReturn(true);
+
+        AuditTracker tracker = new AuditTracker(logger);
+        tracker.preRequest(mock(HttpServletRequest.class));
+        tracker.postRequest(mock(RequestProcessingResult.class));
+
+        ArgumentCaptor<AuditData> auditDataCaptor = ArgumentCaptor.forClass(AuditData.class);
+        verify(logger).audit(auditDataCaptor.capture());
+        assertTrue(auditDataCaptor.getValue().getEndTime() > 0);
+    }
+
+    @Test
+    public void interpretedRequestResultsPassedDownToAudit() {
+
+        Logger logger = mock(Logger.class);
+        when(logger.isAuditEnabled()).thenReturn(true);
+
+        AuditTracker tracker = new AuditTracker(logger);
+        tracker.preRequest(mock(HttpServletRequest.class));
+
+        final StubRequestProcessingResult result = new StubRequestProcessingResult();
+        tracker.postRequest(result);
+
+        ArgumentCaptor<AuditData> auditDataCaptor = ArgumentCaptor.forClass(AuditData.class);
+        verify(logger).audit(auditDataCaptor.capture());
+
+        AuditData capturedAuditData = auditDataCaptor.getValue();
+        assertEquals(Integer.toString(result.getStatus()), capturedAuditData.getResponseCode());
+        assertEquals(result.getStatusCode(), capturedAuditData.getStatusCode());
+        assertEquals(result.getStatusPhrase(), capturedAuditData.getResponseDescription());
+    }
+
+    @Test
+    public void clientIpAddressPassedDownToAudit() {
+
+        Logger logger = mock(Logger.class);
+        when(logger.isAuditEnabled()).thenReturn(true);
+
+        final String address = "196.50.30.122";
+        HttpServletRequest request = mock(HttpServletRequest.class);
+        when(request.getRemoteAddr()).thenReturn(address);
+
+        AuditTracker tracker = new AuditTracker(logger);
+        tracker.preRequest(request);
+        tracker.postRequest(mock(RequestProcessingResult.class));
+
+        ArgumentCaptor<AuditData> auditDataCaptor = ArgumentCaptor.forClass(AuditData.class);
+        verify(logger).audit(auditDataCaptor.capture());
+
+        AuditData capturedAuditData = auditDataCaptor.getValue();
+        assertEquals(address, capturedAuditData.getClientIpAddress());
+    }
+
+    private static class StubRequestProcessingResult implements RequestProcessingResult {
+
+        @Override
+        public int getStatus() {
+            return 505;
+        }
+
+        @Override
+        public StatusCode getStatusCode() {
+            return StatusCode.ERROR;
+        }
+
+        @Override
+        public String getStatusPhrase() {
+            return "Test request failed";
+        }
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/ContextTrackerTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/ContextTrackerTest.java
new file mode 100644
index 0000000..a247d11
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/ContextTrackerTest.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.mockStatic;
+import static org.powermock.api.mockito.PowerMockito.verifyStatic;
+import static org.powermock.api.mockito.PowerMockito.when;
+
+import javax.servlet.http.HttpServletRequest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.openecomp.sdc.logging.api.ContextData;
+import org.openecomp.sdc.logging.api.LoggingContext;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+/**
+ * Populating context from request data.
+ *
+ * @author evitaliy
+ * @since 01 Aug 2018
+ */
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(LoggingContext.class)
+public class ContextTrackerTest {
+
+    private static final String X_REQUEST_ID = "X-REQUEST-ID";
+    private static final HttpHeader REQUEST_ID_HEADER = new HttpHeader(new String[] {X_REQUEST_ID});
+
+    private static final String X_PARTNER_NAME = "X-PARTNER-NAME";
+    private static final HttpHeader PARTNER_NAME_HEADER = new HttpHeader(new String[] {X_PARTNER_NAME});
+
+    @Test(expected = NullPointerException.class)
+    public void throwExceptionWhenPartnerNamesNull() {
+        new ContextTracker(null, REQUEST_ID_HEADER);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void throwExceptionWhenRequestIdsNull() {
+        new ContextTracker(PARTNER_NAME_HEADER, null);
+    }
+
+    @Test
+    public void requestIdCopiedWhenGiven() {
+
+        mockStatic(LoggingContext.class);
+
+        final String requestId = "request-id-for-unit-testing";
+        HttpServletRequest request = mock(HttpServletRequest.class);
+        when(request.getHeader(X_REQUEST_ID)).thenReturn(requestId);
+
+        ContextTracker tracker = new ContextTracker(PARTNER_NAME_HEADER, REQUEST_ID_HEADER);
+        tracker.preRequest(request);
+
+        ArgumentCaptor<ContextData> contextDataCaptor = ArgumentCaptor.forClass(ContextData.class);
+        verifyStatic(LoggingContext.class);
+
+        LoggingContext.put(contextDataCaptor.capture());
+
+        assertEquals(requestId, contextDataCaptor.getValue().getRequestId());
+    }
+
+    @Test
+    public void requestIdGeneratedWhenNotGiven() {
+
+        mockStatic(LoggingContext.class);
+
+        ContextTracker tracker = new ContextTracker(PARTNER_NAME_HEADER, REQUEST_ID_HEADER);
+        tracker.preRequest(mock(HttpServletRequest.class));
+
+        ArgumentCaptor<ContextData> contextDataCaptor = ArgumentCaptor.forClass(ContextData.class);
+        verifyStatic(LoggingContext.class);
+
+        LoggingContext.put(contextDataCaptor.capture());
+
+        String requestId = contextDataCaptor.getValue().getRequestId();
+        assertNotNull(requestId);
+        assertFalse(requestId.isEmpty());
+    }
+
+    @Test
+    public void partnerNameCopiedWhenGiven() {
+
+        mockStatic(LoggingContext.class);
+
+        final String partner = "partner-name-for-unit-testing";
+        HttpServletRequest request = mock(HttpServletRequest.class);
+        when(request.getHeader(X_PARTNER_NAME)).thenReturn(partner);
+
+        ContextTracker tracker = new ContextTracker(PARTNER_NAME_HEADER, REQUEST_ID_HEADER);
+        tracker.preRequest(request);
+
+        ArgumentCaptor<ContextData> contextDataCaptor = ArgumentCaptor.forClass(ContextData.class);
+        verifyStatic(LoggingContext.class);
+
+        LoggingContext.put(contextDataCaptor.capture());
+
+        assertEquals(partner, contextDataCaptor.getValue().getPartnerName());
+    }
+
+    @Test
+    public void partnerNameAbsentWhenNotGiven() {
+
+        mockStatic(LoggingContext.class);
+
+        ContextTracker tracker = new ContextTracker(PARTNER_NAME_HEADER, REQUEST_ID_HEADER);
+        tracker.preRequest(mock(HttpServletRequest.class));
+
+        ArgumentCaptor<ContextData> contextDataCaptor = ArgumentCaptor.forClass(ContextData.class);
+        verifyStatic(LoggingContext.class);
+
+        LoggingContext.put(contextDataCaptor.capture());
+
+        assertNull(contextDataCaptor.getValue().getPartnerName());
+    }
+
+    @Test
+    public void serviceNameGenerated() {
+
+        mockStatic(LoggingContext.class);
+
+        ContextTracker tracker = new ContextTracker(PARTNER_NAME_HEADER, REQUEST_ID_HEADER);
+        tracker.preRequest(mock(HttpServletRequest.class));
+
+        ArgumentCaptor<ContextData> contextDataCaptor = ArgumentCaptor.forClass(ContextData.class);
+        verifyStatic(LoggingContext.class);
+
+        LoggingContext.put(contextDataCaptor.capture());
+
+        assertNotNull(contextDataCaptor.getValue().getServiceName());
+    }
+
+    @Test
+    public void contextClearedWhenRequestFinished() {
+
+        mockStatic(LoggingContext.class);
+
+        ContextTracker tracker = new ContextTracker(PARTNER_NAME_HEADER, REQUEST_ID_HEADER);
+        tracker.postRequest(mock(RequestProcessingResult.class));
+
+        verifyStatic(LoggingContext.class);
+        LoggingContext.clear();
+    }
+}
+
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/HttpHeaderTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/HttpHeaderTest.java
new file mode 100644
index 0000000..5cbd0c0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/HttpHeaderTest.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import org.junit.Test;
+
+/**
+ * Unit tests multiple-option headers.
+ *
+ * @author evitaliy
+ * @since 31 Jul 2018
+ */
+public class HttpHeaderTest {
+
+    private static final Supplier<? extends Throwable> VALUE_EXPECTED = () -> new AssertionError("Value expected");
+    private static final Function<String, String> NULL_WHEN_NAME_NOT_B = k -> "B".equals(k) ? "Value" : null;
+
+    @Test(expected = NullPointerException.class)
+    public void throwExceptionWhenInputArrayNull() {
+        new HttpHeader((String[]) null);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void throwExceptionWhenInputListNull() {
+        new HttpHeader((List<String>) null);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void throwExceptionWhenInputArrayEmpty() {
+        new HttpHeader(new String[0]);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void throwExceptionWhenInputListEmpty() {
+        new HttpHeader(Collections.emptyList());
+    }
+
+    @Test
+    public void valueNotReturnedWhenNameInArrayNotRequested() {
+        HttpHeader header = new HttpHeader(new String[] {"A"});
+        assertFalse(header.getAny(NULL_WHEN_NAME_NOT_B).isPresent());
+    }
+
+    @Test
+    public void valueNotReturnedWhenNameInListNotRequested() {
+        HttpHeader header = new HttpHeader(Collections.singletonList("A"));
+        assertFalse(header.getAny(NULL_WHEN_NAME_NOT_B).isPresent());
+    }
+
+    @Test
+    public void valueReturnedWhenSinglePossibleHeaderInArrayMatches() {
+        HttpHeader header = new HttpHeader(new String[] {"B"});
+        assertTrue(header.getAny(NULL_WHEN_NAME_NOT_B).isPresent());
+    }
+
+    @Test
+    public void valueReturnedWhenSinglePossibleHeaderInListMatches() {
+        HttpHeader header = new HttpHeader(Collections.singletonList("B"));
+        assertTrue(header.getAny(NULL_WHEN_NAME_NOT_B).isPresent());
+    }
+
+    @Test
+    public void valueReturnedWhenLastHeaderInArrayMatches() throws Throwable {
+        HttpHeader header = new HttpHeader(new String[] {"A", "B"});
+        header.getAny(NULL_WHEN_NAME_NOT_B).orElseThrow(VALUE_EXPECTED);
+    }
+
+    @Test
+    public void valueReturnedWhenLastHeaderInListMatches() throws Throwable {
+        HttpHeader header = new HttpHeader(Arrays.asList("A", "B"));
+        header.getAny(NULL_WHEN_NAME_NOT_B).orElseThrow(VALUE_EXPECTED);
+    }
+
+    @Test
+    public void valueReturnedWhenFirstHeaderInArrayMatches() throws Throwable {
+        HttpHeader header = new HttpHeader(new String[] {"B", "A"});
+        header.getAny(NULL_WHEN_NAME_NOT_B).orElseThrow(VALUE_EXPECTED);
+    }
+
+    @Test
+    public void valueReturnedWhenFirstHeaderInListMatches() throws Throwable {
+        HttpHeader header = new HttpHeader(Arrays.asList("B", "A"));
+        header.getAny(NULL_WHEN_NAME_NOT_B).orElseThrow(VALUE_EXPECTED);
+    }
+
+    @Test
+    public void valueReturnedWhenMiddleHeaderInArrayMatches() throws Throwable {
+        HttpHeader header = new HttpHeader(new String[] {"A", "B", "C"});
+        header.getAny(NULL_WHEN_NAME_NOT_B).orElseThrow(VALUE_EXPECTED);
+    }
+
+    @Test
+    public void valueReturnedWhenMiddleHeaderInListMatches() throws Throwable {
+        HttpHeader header = new HttpHeader(Arrays.asList("A", "B", "C"));
+        header.getAny(NULL_WHEN_NAME_NOT_B).orElseThrow(VALUE_EXPECTED);
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java
deleted file mode 100644
index 1ba418f..0000000
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * 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.
- */
-
-package org.openecomp.sdc.logging.servlet;
-
-import org.easymock.EasyMock;
-import org.junit.After;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-import org.openecomp.sdc.logging.api.ContextData;
-import org.openecomp.sdc.logging.api.LoggingContext;
-import org.powermock.api.easymock.PowerMock;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-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 javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.UUID;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.openecomp.sdc.logging.LoggingConstants.DEFAULT_PARTNER_NAME_HEADER;
-import static org.openecomp.sdc.logging.LoggingConstants.DEFAULT_REQUEST_ID_HEADER;
-import static org.openecomp.sdc.logging.servlet.LoggingFilter.PARTNER_NAME_HEADERS_PARAM;
-import static org.openecomp.sdc.logging.servlet.LoggingFilter.REQUEST_ID_HEADERS_PARAM;
-
-/**
- * Unit-tests logging filter for initialization and data retrieval.
- *
- * @author evitaliy
- * @since 17 Aug 2016
- */
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(LoggingContext.class)
-public class LoggingFilterTest {
-
-    private static final String RANDOM_REQUEST_URI = UUID.randomUUID().toString();
-    private static final String RANDOM_REQUEST_ID = UUID.randomUUID().toString();
-    private static final String RANDOM_PARTNER_NAME = UUID.randomUUID().toString();
-
-    @Rule
-    public TestName testName = new TestName();
-
-    /**
-     * Verify all mocks after each test.
-     */
-    @After
-    public void verifyMocks() {
-
-        try {
-            PowerMock.verifyAll();
-        } catch (AssertionError e) {
-            throw new AssertionError("Expectations failed in " + testName.getMethodName() + "()", e);
-        }
-    }
-
-
-    @Test
-    public void filterPopulatesValuesWhenNoInitParamsAndNoHeaders() throws IOException, ServletException {
-
-        mockLoggingContext();
-        LoggingFilter loggingFilter = new LoggingFilter();
-        loggingFilter.init(mockFilterConfig(null, null));
-        loggingFilter.doFilter(new MockRequestBuilder().build(), mockResponse(), mockChain());
-    }
-
-    @Test
-    public void filterPopulatesValuesWhenNoInitParamsAndExistingHeaders() throws IOException, ServletException {
-
-        mockLoggingContext();
-
-        LoggingFilter loggingFilter = new LoggingFilter();
-        loggingFilter.init(mockFilterConfig(null, null));
-
-        HttpServletRequest mockRequest = new MockRequestBuilder().partnerName(RANDOM_PARTNER_NAME)
-                                                                 .requestId(RANDOM_REQUEST_ID).build();
-        loggingFilter.doFilter(mockRequest, mockResponse(), mockChain());
-    }
-
-    @Test
-    public void filterPopulatesValuesWhenCustomInitParamsAndNoHeaders() throws IOException, ServletException {
-
-        mockLoggingContext();
-
-        final String requestIdHeader = "x-request";
-        final String partnerNameHeader = "x-partner";
-
-        LoggingFilter loggingFilter = new LoggingFilter();
-        FilterConfig mockConfig = mockFilterConfig(requestIdHeader, partnerNameHeader);
-        loggingFilter.init(mockConfig);
-
-        HttpServletRequest mockRequest = new MockRequestBuilder().requestIdHeader(requestIdHeader)
-                                                                 .partnerNameHeader(partnerNameHeader).build();
-        loggingFilter.doFilter(mockRequest, mockResponse(), mockChain());
-    }
-
-    @Test
-    public void filterPopulatesValuesWhenCustomInitParamsAndExistingHeaders() throws IOException, ServletException {
-
-        mockLoggingContext();
-
-        final String requestIdHeader = "x-request-id";
-        final String partnerNameHeader = "x-partner-name";
-
-        LoggingFilter loggingFilter = new LoggingFilter();
-        FilterConfig mockConfig = mockFilterConfig(requestIdHeader, partnerNameHeader);
-        loggingFilter.init(mockConfig);
-
-        HttpServletRequest mockRequest = new MockRequestBuilder()
-                .partnerNameHeader(partnerNameHeader).partnerName(RANDOM_PARTNER_NAME)
-                .requestIdHeader(requestIdHeader).requestId(RANDOM_REQUEST_ID).build();
-        loggingFilter.doFilter(mockRequest, mockResponse(), mockChain());
-    }
-
-    private FilterConfig mockFilterConfig(String requestIdHeader, String partnerNameHeader) {
-        FilterConfig config = EasyMock.mock(FilterConfig.class);
-        EasyMock.expect(config.getInitParameter(REQUEST_ID_HEADERS_PARAM)).andReturn(requestIdHeader);
-        EasyMock.expect(config.getInitParameter(PARTNER_NAME_HEADERS_PARAM)).andReturn(partnerNameHeader);
-        EasyMock.replay(config);
-        return config;
-    }
-
-    private FilterChain mockChain() throws IOException, ServletException {
-        FilterChain chain = EasyMock.mock(FilterChain.class);
-        chain.doFilter(anyObject(ServletRequest.class), anyObject(ServletResponse.class));
-        EasyMock.expectLastCall().once();
-        EasyMock.replay(chain);
-        return chain;
-    }
-
-    private ServletResponse mockResponse() {
-        HttpServletResponse servletResponse = EasyMock.mock(HttpServletResponse.class);
-        EasyMock.replay(servletResponse);
-        return servletResponse;
-    }
-
-    private void mockLoggingContext() {
-
-        PowerMock.mockStatic(LoggingContext.class);
-
-        LoggingContext.clear();
-        EasyMock.expectLastCall().times(2);
-
-        LoggingContext.put(anyObject(ContextData.class));
-        EasyMock.expectLastCall().once();
-
-        PowerMock.replay(LoggingContext.class);
-    }
-
-    private static class MockRequestBuilder {
-
-        private String requestIdHeader = DEFAULT_REQUEST_ID_HEADER;
-        private String partnerNameHeader = DEFAULT_PARTNER_NAME_HEADER;
-        private String requestId = null;
-        private String partnerName = null;
-
-        MockRequestBuilder requestIdHeader(String h) {
-            this.requestIdHeader = h;
-            return this;
-        }
-
-        MockRequestBuilder requestId(String id) {
-            this.requestId = id;
-            return this;
-        }
-
-        MockRequestBuilder partnerNameHeader(String h) {
-            this.partnerNameHeader = h;
-            return this;
-        }
-
-        MockRequestBuilder partnerName(String name) {
-            this.partnerName = name;
-            return this;
-        }
-
-        HttpServletRequest build() {
-            HttpServletRequest mockRequest = EasyMock.mock(HttpServletRequest.class);
-            EasyMock.expect(mockRequest.getRequestURI()).andReturn(RANDOM_REQUEST_URI);
-            EasyMock.expect(mockRequest.getHeader(requestIdHeader)).andReturn(requestId);
-            EasyMock.expect(mockRequest.getHeader(partnerNameHeader)).andReturn(partnerName);
-            EasyMock.replay(mockRequest);
-            return mockRequest;
-        }
-    }
-}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/ServiceNameFormatterTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/ServiceNameFormatterTest.java
new file mode 100644
index 0000000..87fb6f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/ServiceNameFormatterTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.sdc.logging.servlet;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import javax.servlet.http.HttpServletRequest;
+import org.junit.Test;
+
+/**
+ * Service name formatting.
+ *
+ * @author evitaliy
+ * @since 01 Aug 2018
+ */
+public class ServiceNameFormatterTest {
+
+    @Test
+    public void includesMethodAndUri() {
+        final String method = "ABC";
+        final String uri = "/a/b/c";
+        HttpServletRequest request = mock(HttpServletRequest.class);
+        when(request.getRequestURI()).thenReturn(uri);
+        when(request.getMethod()).thenReturn(method);
+        assertEquals(method + ": " + uri, ServiceNameFormatter.format(request));
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/HttpHeaderTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/HttpHeaderTest.java
deleted file mode 100644
index ad7be95..0000000
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/HttpHeaderTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * 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.
- */
-
-package org.openecomp.sdc.logging.servlet.jaxrs;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.util.function.Function;
-import org.junit.Test;
-import org.openecomp.sdc.logging.servlet.HttpHeader;
-
-/**
- * Unit tests multiple-option headers.
- *
- * @author evitaliy
- * @since 25 Mar 2018
- */
-public class HttpHeaderTest {
-
-    private static final String KEY_FIRST = "First";
-    private static final String KEY_SECOND = "Second";
-
-    @Test
-    public void valueReturnedWhenSinglePossibleHeader() {
-
-        final String key = "Head";
-        final String value = "1234";
-
-        Function<String, String> reader = createReader(key, value);
-        HttpHeader header = new HttpHeader(key);
-        assertEquals(value, header.getAny(reader));
-    }
-
-    @Test
-    public void nullReturnedWhenSingleNoMatchingHeader() {
-
-        final String key = "Head";
-
-        Function<String, String> reader = createReader(key, null);
-        HttpHeader header = new HttpHeader(key);
-        assertNull(header.getAny(reader));
-    }
-
-    @Test
-    public void nullReturnedWhenNoneHeaderMatches() {
-        Function<String, String> reader = createReader("None", "Value");
-        HttpHeader header = new HttpHeader("A", "B", "C");
-        assertNull(header.getAny(reader));
-    }
-
-    @Test
-    public void valueReturnedWhenLastHeaderMatches() {
-
-        final String lastKey = "Last";
-        final String value = "1234";
-
-        Function<String, String> reader = createReader(lastKey, value);
-        HttpHeader header = new HttpHeader(KEY_FIRST, KEY_SECOND, lastKey);
-        assertEquals(value, header.getAny(reader));
-    }
-
-    @Test
-    public void valueReturnedWhenFirstHeaderMatches() {
-
-        final String value = "1234";
-        Function<String, String> reader = createReader(KEY_FIRST, value);
-        HttpHeader header = new HttpHeader(KEY_FIRST, KEY_SECOND, "Third");
-        assertEquals(value, header.getAny(reader));
-    }
-
-    @Test
-    public void valueReturnedWhenMiddleHeaderMatches() {
-
-        final String value = "1234";
-        Function<String, String> reader = createReader(KEY_SECOND, value);
-        HttpHeader header = new HttpHeader(KEY_FIRST, KEY_SECOND, "Third");
-        assertEquals(value, header.getAny(reader));
-    }
-
-    private Function<String, String> createReader(String key, String value) {
-        return  h -> h.equals(key) ? value : null;
-    }
-}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilterTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilterTest.java
index 4098809..aa77dea 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilterTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingRequestFilterTest.java
@@ -16,25 +16,18 @@
 
 package org.openecomp.sdc.logging.servlet.jaxrs;
 
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.anyString;
-import static org.openecomp.sdc.logging.servlet.jaxrs.LoggingRequestFilter.START_TIME_KEY;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.logging.servlet.jaxrs.LoggingRequestFilter.LOGGING_TRACKER_KEY;
 
-import java.util.UUID;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.container.ContainerRequestContext;
-import org.easymock.EasyMock;
-import org.junit.After;
-import org.junit.Rule;
+import javax.ws.rs.container.ResourceInfo;
 import org.junit.Test;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-import org.openecomp.sdc.logging.LoggingConstants;
-import org.openecomp.sdc.logging.api.ContextData;
-import org.openecomp.sdc.logging.api.LoggingContext;
-import org.powermock.api.easymock.PowerMock;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.openecomp.sdc.logging.servlet.Tracker;
 
 
 /**
@@ -43,222 +36,25 @@
  * @author evitaliy
  * @since 19 Mar 2018
  */
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({LoggingContext.class, ContextData.class})
 public class LoggingRequestFilterTest {
 
-    private static final String REQUEST_URI = "/test";
-    private static final String REQUEST_METHOD = "GET";
-    private static final String RANDOM_REQUEST_ID = UUID.randomUUID().toString();
-    private static final String RANDOM_PARTNER_NAME = UUID.randomUUID().toString();
-
-    @Rule
-    public TestName testName = new TestName();
-
-    /**
-     * Verify all mocks after each test.
-     */
-    @After
-    public void verifyMocks() {
-
-        try {
-            PowerMock.verifyAll();
-        } catch (AssertionError e) {
-            throw new AssertionError("Expectations failed in " + testName.getMethodName() + "()", e);
-        }
-    }
-
     @Test
-    public void serviceNamePopulatedWhenThereIsMatchingResource() {
+    public void trackerPushedOntoRequestContext() {
 
-        mockContextDataBuilder(null, null, LoggingRequestFilter.formatServiceName(REQUEST_METHOD, REQUEST_URI));
-        mockLoggingContext();
+        LoggingRequestFilter requestFilter = new LoggingRequestFilter();
+        requestFilter.setHttpRequest(mock(HttpServletRequest.class));
 
-        LoggingRequestFilter filter = new LoggingRequestFilter();
-        filter.setHttpRequest(mockHttpRequest(true));
+        ResourceInfo resourceInfo = mock(ResourceInfo.class);
+        when(resourceInfo.getResourceMethod()).thenReturn(Resource.class.getDeclaredMethods()[0]);
+        requestFilter.setResource(resourceInfo);
 
-        filter.filter(mockContainerRequestContext(
-                new RequestIdHeader(null),
-                new PartnerHeader(null)));
+        ContainerRequestContext requestContext = mock(ContainerRequestContext.class);
+        requestFilter.filter(requestContext);
+        verify(requestContext).setProperty(eq(LOGGING_TRACKER_KEY), any(Tracker.class));
     }
 
-    @Test
-    public void serviceNameDoesNotIncludeHttpMethodWhenHttpMethodDisabled() {
-
-        mockContextDataBuilder(null, null, REQUEST_URI);
-        mockLoggingContext();
-
-        LoggingRequestFilter filter = new LoggingRequestFilter();
-        filter.setHttpMethodInServiceName(false);
-        filter.setHttpRequest(mockHttpRequest(false));
-
-        filter.filter(mockContainerRequestContext(
-                new RequestIdHeader(null),
-                new PartnerHeader(null)));
-    }
-
-    @Test
-    public void partnerNamePopulatedWhenPresentInDefaultHeader() {
-
-        mockContextDataBuilder(null, RANDOM_PARTNER_NAME,
-                LoggingRequestFilter.formatServiceName(REQUEST_METHOD, REQUEST_URI));
-        mockLoggingContext();
-
-        LoggingRequestFilter filter = new LoggingRequestFilter();
-        filter.setHttpRequest(mockHttpRequest(true));
-
-        filter.filter(mockContainerRequestContext(
-                new RequestIdHeader(null),
-                new PartnerHeader(RANDOM_PARTNER_NAME)));
-    }
-
-    @Test
-    public void partnerNamePopulatedWhenPresentInCustomHeader() {
-
-        final String partnerHeader = "x-partner-header";
-        mockContextDataBuilder(null, RANDOM_PARTNER_NAME,
-                LoggingRequestFilter.formatServiceName(REQUEST_METHOD, REQUEST_URI));
-        mockLoggingContext();
-
-        LoggingRequestFilter filter = new LoggingRequestFilter();
-        filter.setHttpRequest(mockHttpRequest(true));
-        filter.setPartnerNameHeaders(partnerHeader);
-
-        filter.filter(mockContainerRequestContext(
-                new RequestIdHeader(null),
-                new PartnerHeader(partnerHeader, RANDOM_PARTNER_NAME)));
-    }
-
-    @Test
-    public void requestIdPopulatedWhenPresentInDefaultHeader() {
-
-        mockContextDataBuilder(RANDOM_REQUEST_ID, null,
-                LoggingRequestFilter.formatServiceName(REQUEST_METHOD, REQUEST_URI));
-        mockLoggingContext();
-
-        LoggingRequestFilter filter = new LoggingRequestFilter();
-        filter.setHttpRequest(mockHttpRequest(true));
-
-        filter.filter(mockContainerRequestContext(
-                new RequestIdHeader(RANDOM_REQUEST_ID),
-                new PartnerHeader(null)));
-    }
-
-    @Test
-    public void requestIdPopulatedWhenPresentInCustomHeader() {
-
-        final String requestIdHeader = "x-request-id";
-        mockContextDataBuilder(RANDOM_REQUEST_ID, null,
-                LoggingRequestFilter.formatServiceName(REQUEST_METHOD, REQUEST_URI));
-        mockLoggingContext();
-
-        LoggingRequestFilter filter = new LoggingRequestFilter();
-        filter.setRequestIdHeaders(requestIdHeader);
-        filter.setHttpRequest(mockHttpRequest(true));
-
-        filter.filter(mockContainerRequestContext(
-                new RequestIdHeader(requestIdHeader, RANDOM_REQUEST_ID),
-                new PartnerHeader(null)));
-    }
-
-    private HttpServletRequest mockHttpRequest(boolean includeMethod) {
-
-        HttpServletRequest servletRequest = EasyMock.mock(HttpServletRequest.class);
-        EasyMock.expect(servletRequest.getRequestURI()).andReturn(REQUEST_URI);
-
-        if (includeMethod) {
-            EasyMock.expect(servletRequest.getMethod()).andReturn(REQUEST_METHOD);
-        }
-
-        EasyMock.replay(servletRequest);
-        return servletRequest;
-    }
-
-    private ContainerRequestContext mockContainerRequestContext(Header... headers) {
-
-        ContainerRequestContext requestContext = EasyMock.mock(ContainerRequestContext.class);
-
-        for (Header h : headers) {
-            EasyMock.expect(requestContext.getHeaderString(h.key)).andReturn(h.value);
-        }
-
-        requestContext.setProperty(EasyMock.eq(START_TIME_KEY), EasyMock.anyLong());
-        EasyMock.expectLastCall();
-
-        EasyMock.replay(requestContext);
-        return requestContext;
-    }
-
-    private void mockContextDataBuilder(String requestId, String partnerName, String serviceName) {
-
-        ContextData.ContextDataBuilder mockBuilder = EasyMock.mock(ContextData.ContextDataBuilder.class);
-
-        if (requestId != null) {
-            EasyMock.expect(mockBuilder.requestId(requestId)).andReturn(mockBuilder);
-        } else {
-            EasyMock.expect(mockBuilder.requestId(anyString())).andReturn(mockBuilder);
-        }
-
-        EasyMock.expect(mockBuilder.serviceName(serviceName)).andReturn(mockBuilder);
-
-        if (partnerName != null) {
-            EasyMock.expect(mockBuilder.partnerName(partnerName)).andReturn(mockBuilder);
-        }
-
-        EasyMock.expect(mockBuilder.build()).andReturn(EasyMock.mock(ContextData.class));
-        EasyMock.replay(mockBuilder);
-
-        PowerMock.mockStatic(ContextData.class);
-
-        ContextData.builder();
-        PowerMock.expectLastCall().andReturn(mockBuilder);
-
-        PowerMock.replay(ContextData.class);
-    }
-
-    private void mockLoggingContext() {
-
-        PowerMock.mockStatic(LoggingContext.class);
-
-        LoggingContext.clear();
-        EasyMock.expectLastCall();
-
-        LoggingContext.put(anyObject(ContextData.class));
-        EasyMock.expectLastCall();
-
-        PowerMock.replay(LoggingContext.class);
-    }
-
-    private abstract static class Header {
-
-        private final String key;
-        private final String value;
-
-        private Header(String key, String value) {
-            this.key = key;
-            this.value = value;
-        }
-    }
-
-    private static class PartnerHeader extends Header {
-
-        private PartnerHeader(String value) {
-            super(LoggingConstants.DEFAULT_PARTNER_NAME_HEADER, value);
-        }
-
-        private PartnerHeader(String key, String value) {
-            super(key, value);
-        }
-    }
-
-    private static class RequestIdHeader extends Header {
-
-        private RequestIdHeader(String value) {
-            super(LoggingConstants.DEFAULT_REQUEST_ID_HEADER, value);
-        }
-
-        private RequestIdHeader(String key, String value) {
-            super(key, value);
-        }
+    private interface Resource {
+        @SuppressWarnings("unused")
+        void method();
     }
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilterTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilterTest.java
index 710cf12..336840b 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilterTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/servlet/jaxrs/LoggingResponseFilterTest.java
@@ -16,35 +16,18 @@
 
 package org.openecomp.sdc.logging.servlet.jaxrs;
 
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.logging.servlet.jaxrs.LoggingRequestFilter.LOGGING_TRACKER_KEY;
 
-import java.lang.reflect.Method;
-import java.util.Comparator;
-import java.util.Objects;
-import java.util.function.Consumer;
-import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ResourceInfo;
-import javax.ws.rs.core.Response;
-import org.easymock.EasyMock;
-import org.easymock.LogicalOperator;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-import org.openecomp.sdc.logging.api.AuditData;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.api.LoggingContext;
-import org.openecomp.sdc.logging.api.StatusCode;
-import org.powermock.api.easymock.PowerMock;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
+import org.openecomp.sdc.logging.servlet.RequestProcessingResult;
+import org.openecomp.sdc.logging.servlet.Tracker;
 
 /**
  * Unit testing JAX-RS response filter.
@@ -52,277 +35,24 @@
  * @author evitaliy
  * @since 19 Mar 2018
  */
-@RunWith(PowerMockRunner.class)
 public class LoggingResponseFilterTest {
 
-    private static final Class RESOURCE_TYPE = Resource.class;
-    private static final Method RESOURCE_METHOD = Resource.class.getDeclaredMethods()[0];
-
-    @Rule
-    public TestName testName = new TestName();
-
-    @Before
-    public void prepareLoggingContext() {
-        mockLoggingContext();
-    }
-
-    /**
-     * Verify all mocks after each test.
-     */
-    @After
-    public void verifyMocks() {
-
-        try {
-            PowerMock.verifyAll();
-        } catch (AssertionError e) {
-            throw new AssertionError("Expectations failed in " + testName.getMethodName() + "()", e);
-        }
+    @Test
+    public void noExceptionsWhenTrackerNotPassed() {
+        new LoggingResponseFilter().filter(mock(ContainerRequestContext.class), mock(ContainerResponseContext.class));
     }
 
     @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void noAuditWhenNoMatchingResource() {
+    public void postRequestWhenTrackerPassed() {
 
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockFilterLogger(logger -> {
-            logger.debug(anyString());
-            EasyMock.expectLastCall();
-        });
-        PowerMock.replay(LoggerFactory.class);
+        Tracker tracker = mock(Tracker.class);
+
+        ContainerRequestContext requestContext = mock(ContainerRequestContext.class);
+        when(requestContext.getProperty(LOGGING_TRACKER_KEY)).thenReturn(tracker);
 
         LoggingResponseFilter responseFilter = new LoggingResponseFilter();
-        responseFilter.filter(mockDisabledRequestContext(), mockDisabledResponseContext());
-    }
+        responseFilter.filter(requestContext, mock(ContainerResponseContext.class));
 
-    @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void noAuditWhenNullResource() {
-
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockFilterLogger(logger -> {
-            logger.debug(anyString());
-            EasyMock.expectLastCall();
-        });
-        PowerMock.replay(LoggerFactory.class);
-
-        LoggingResponseFilter responseFilter = new LoggingResponseFilter();
-        responseFilter.setResource(null);
-        responseFilter.filter(mockDisabledRequestContext(), mockDisabledResponseContext());
-    }
-
-    @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void noAuditWhenAuditDisabled() {
-
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockFilterLogger();
-        mockResourceLogger(false, AuditData.builder().build());
-        PowerMock.replay(LoggerFactory.class);
-
-        LoggingResponseFilter responseFilter = new LoggingResponseFilter();
-        responseFilter.setResource(mockResource());
-        responseFilter.filter(mockDisabledRequestContext(), mockDisabledResponseContext());
-    }
-
-    @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void startTimeReadWhenPresentInRequestContext() {
-
-        final String clientIp = "IP1";
-        final long startTime = 12345L;
-        final Response.Status ok = Response.Status.OK;
-
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockResourceLogger(true, buildAuditData(startTime, clientIp, ok, StatusCode.COMPLETE));
-        mockFilterLogger();
-        PowerMock.replay(LoggerFactory.class);
-
-        LoggingResponseFilter filter = new LoggingResponseFilter();
-        filter.setResource(mockResource());
-        filter.setHttpRequest(mockHttpRequest(clientIp));
-
-        filter.filter(mockRequestContext(startTime), mockResponseContext(ok));
-    }
-
-    @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void startTimeZeroWhenNotPresentInRequestContext() {
-
-        final String clientIp = "IP2";
-        final Response.Status ok = Response.Status.OK;
-
-        AuditData expectedAuditData = buildAuditData(0, clientIp, ok, StatusCode.COMPLETE);
-
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockResourceLogger(true, expectedAuditData);
-        mockFilterLogger(logger -> {
-            logger.error(anyString(), anyObject(Object[].class));
-            EasyMock.expectLastCall();
-        });
-        PowerMock.replay(LoggerFactory.class);
-
-        LoggingResponseFilter filter = new LoggingResponseFilter();
-        filter.setResource(mockResource());
-        filter.setHttpRequest(mockHttpRequest(clientIp));
-
-        filter.filter(mockRequestContext(null), mockResponseContext(ok));
-    }
-
-    @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void startTimeZeroWhenIncorrectObjectType() {
-
-        final String clientIp = "IP3";
-        final Response.Status accepted = Response.Status.ACCEPTED;
-
-        AuditData expectedAuditData = buildAuditData(0, clientIp, accepted, StatusCode.COMPLETE);
-
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockFilterLogger(logger -> {
-            logger.error(anyString(), anyString(), anyString(), anyObject());
-            EasyMock.expectLastCall();
-        });
-        mockResourceLogger(true, expectedAuditData);
-        PowerMock.replay(LoggerFactory.class);
-
-        LoggingResponseFilter filter = new LoggingResponseFilter();
-        filter.setResource(mockResource());
-        filter.setHttpRequest(mockHttpRequest(clientIp));
-
-        filter.filter(mockRequestContext("string object"), mockResponseContext(accepted));
-    }
-
-    @Test
-    @PrepareForTest({LoggingContext.class, LoggerFactory.class})
-    public void statusErrorWhenHttpResponseGreaterThan399() {
-
-        final Response.Status error = Response.Status.BAD_REQUEST;
-        final String clientIp = "IP13";
-        final long startTime = 88668603L;
-
-        AuditData expectedAuditData = buildAuditData(startTime, clientIp, error, StatusCode.ERROR);
-
-        PowerMock.mockStatic(LoggerFactory.class);
-        mockResourceLogger(true, expectedAuditData);
-        mockFilterLogger();
-        PowerMock.replay(LoggerFactory.class);
-
-        LoggingResponseFilter filter = new LoggingResponseFilter();
-        filter.setResource(mockResource());
-        filter.setHttpRequest(mockHttpRequest(clientIp));
-
-        filter.filter(mockRequestContext(startTime), mockResponseContext(error));
-    }
-
-    private AuditData buildAuditData(long startTime, String clientIp, Response.Status responseStatus,
-            StatusCode status) {
-        return AuditData.builder().startTime(startTime).responseCode(Integer.toString(responseStatus.getStatusCode()))
-                        .responseDescription(responseStatus.getReasonPhrase()).clientIpAddress(clientIp)
-                        .statusCode(status).build();
-    }
-
-    private void mockResourceLogger(boolean enabled, AuditData auditData) {
-
-        Logger resourceLogger = EasyMock.mock(Logger.class);
-
-        EasyMock.expect(resourceLogger.isAuditEnabled()).andReturn(enabled).atLeastOnce();
-
-        if (enabled) {
-            resourceLogger.audit(EasyMock.cmp(auditData, new AuditDataComparator(), LogicalOperator.EQUAL));
-            EasyMock.expectLastCall();
-        }
-
-        EasyMock.replay(resourceLogger);
-
-        LoggerFactory.getLogger(RESOURCE_TYPE);
-        PowerMock.expectLastCall().andReturn(resourceLogger);
-    }
-
-    @SafeVarargs
-    private final void mockFilterLogger(Consumer<Logger>... expectations) {
-
-        Logger filterLogger = EasyMock.mock(Logger.class);
-
-        for (Consumer<Logger> expect : expectations) {
-            expect.accept(filterLogger);
-        }
-
-        EasyMock.replay(filterLogger);
-
-        LoggerFactory.getLogger(LoggingResponseFilter.class);
-        PowerMock.expectLastCall().andReturn(filterLogger);
-    }
-
-    private void mockLoggingContext() {
-        PowerMock.mockStatic(LoggingContext.class);
-        LoggingContext.clear();
-        EasyMock.expectLastCall();
-        PowerMock.replay(LoggingContext.class);
-    }
-
-    private ContainerRequestContext mockDisabledRequestContext() {
-        ContainerRequestContext requestContext = EasyMock.mock(ContainerRequestContext.class);
-        EasyMock.replay(requestContext);
-        return requestContext;
-    }
-
-    private ContainerResponseContext mockDisabledResponseContext() {
-        ContainerResponseContext responseContext = EasyMock.mock(ContainerResponseContext.class);
-        EasyMock.replay(responseContext);
-        return responseContext;
-    }
-
-    private HttpServletRequest mockHttpRequest(String clientIp) {
-        HttpServletRequest servletRequest = EasyMock.mock(HttpServletRequest.class);
-        EasyMock.expect(servletRequest.getRemoteAddr()).andReturn(clientIp);
-        EasyMock.replay(servletRequest);
-        return servletRequest;
-    }
-
-    private ContainerRequestContext mockRequestContext(Object startTime) {
-        ContainerRequestContext requestContext = EasyMock.mock(ContainerRequestContext.class);
-        EasyMock.expect(requestContext.getProperty(LoggingRequestFilter.START_TIME_KEY)).andReturn(startTime);
-        EasyMock.replay(requestContext);
-        return requestContext;
-    }
-
-    private ContainerResponseContext mockResponseContext(Response.StatusType statusInfo) {
-        ContainerResponseContext responseContext = EasyMock.mock(ContainerResponseContext.class);
-        EasyMock.expect(responseContext.getStatusInfo()).andReturn(statusInfo);
-        EasyMock.replay(responseContext);
-        return responseContext;
-    }
-
-    private ResourceInfo mockResource() {
-        ResourceInfo resource = EasyMock.mock(ResourceInfo.class);
-        //noinspection unchecked
-        EasyMock.expect(resource.getResourceClass()).andReturn(RESOURCE_TYPE).anyTimes();
-        EasyMock.expect(resource.getResourceMethod()).andReturn(RESOURCE_METHOD).anyTimes();
-        EasyMock.replay(resource);
-        return resource;
-    }
-
-    private static class AuditDataComparator implements Comparator<AuditData> {
-
-        @Override
-        public int compare(AuditData one, AuditData two) {
-
-            // don't compare end time as it changes
-            if (Objects.equals(one.getClientIpAddress(), two.getClientIpAddress())
-                        && Objects.equals(one.getResponseCode(), two.getResponseCode())
-                        && Objects.equals(one.getResponseDescription(), two.getResponseDescription())
-                        && one.getStartTime() == two.getStartTime()
-                        && Objects.equals(one.getStatusCode(), two.getStatusCode())) {
-
-                return 0;
-            }
-
-            return -1;
-        }
-    }
-
-    interface Resource {
-        @SuppressWarnings("unused")
-        void method();
+        verify(tracker, times(1)).postRequest(any(RequestProcessingResult.class));
     }
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/pom.xml
new file mode 100644
index 0000000..b556a2a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright © 2016-2018 European Support Limited
+  ~
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <artifactId>openecomp-sdc-logging-lib</artifactId>
+        <groupId>org.openecomp.sdc</groupId>
+        <version>1.3.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>openecomp-sdc-logging-spring</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/pom.xml
index 42da150..16fb853 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/pom.xml
@@ -17,6 +17,7 @@
     <modules>
         <module>openecomp-sdc-logging-api</module>
         <module>openecomp-sdc-logging-core</module>
+        <module>openecomp-sdc-logging-spring</module>
     </modules>
 
 </project>
