use onap logging 1.6.1 with needed workarounds
[vid.git] / vid-app-common / src / main / java / org / onap / vid / controller / WebConfig.java
index 9faa7ad..91fb942 100644 (file)
@@ -52,6 +52,7 @@ import org.onap.vid.asdc.parser.ToscaParserImpl2;
 import org.onap.vid.asdc.parser.VidNotionsBuilder;
 import org.onap.vid.asdc.rest.SdcRestClient;
 import org.onap.vid.client.SyncRestClient;
+import org.onap.vid.logging.VidLoggingInterceptor;
 import org.onap.vid.properties.AsdcClientConfiguration;
 import org.onap.vid.properties.VidProperties;
 import org.onap.vid.scheduler.SchedulerService;
@@ -68,6 +69,8 @@ import org.onap.vid.utils.Logging;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 import org.togglz.core.manager.FeatureManager;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
@@ -77,7 +80,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
 @EnableSwagger2
 @Configuration
-public class WebConfig {
+public class WebConfig implements WebMvcConfigurer {
 
     /**
      * Gets the object mapper.
@@ -160,7 +163,9 @@ public class WebConfig {
         String protocol = asdcClientConfiguration.getAsdcClientProtocol();
         int port = asdcClientConfiguration.getAsdcClientPort();
 
-        return new SdcRestClient(protocol + "://" + host + ":" + port + "/", auth, new SyncRestClient(loggingService), loggingService);
+        return new SdcRestClient(protocol + "://" + host + ":" + port + "/", auth,
+            new SyncRestClient( loggingService, true),
+            loggingService);
     }
 
     @Bean
@@ -214,4 +219,9 @@ public class WebConfig {
         int threadsCount = defaultIfNull(Integer.parseInt(SystemProperties.getProperty(VidProperties.VID_THREAD_COUNT)), 1);
         return Executors.newFixedThreadPool(threadsCount);
     }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(new VidLoggingInterceptor());
+    }
 }