diff options
author | Smokowski, Steve (ss835w) <ss835w@us.att.com> | 2018-09-01 06:58:20 -0400 |
---|---|---|
committer | Smokowski, Steve (ss835w) <ss835w@us.att.com> | 2018-09-01 06:58:20 -0400 |
commit | b1c2cbe73420cbb62f643488422f174fe3311b1c (patch) | |
tree | a373b61c81b6550f44a0580df7d0471479224e0c /adapters/mso-catalog-db-adapter/src/main | |
parent | 00da3f4b4087e78d56f09dfe8ab01616d6ad68b0 (diff) |
Logging Improvement
Add Spring interceptor to log all the SpringDataRest calls
Issue-ID: SO-947
Change-Id: Ia1a574cedd90e79bb2fd30a094831dc5cd269ff0
Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/main')
2 files changed, 23 insertions, 1 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java index 9709c4af45..93e396bb94 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java @@ -25,7 +25,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -@SpringBootApplication(scanBasePackages = {"org.onap.so.adapters.catalogdb", "org.onap.so.db.catalog.client","org.onap.so.logging.jaxrs.filter"}) +@SpringBootApplication(scanBasePackages = {"org.onap.so.adapters.catalogdb", "org.onap.so.db.catalog.client","org.onap.so.logging.jaxrs.filter","org.onap.so.logging.spring.interceptor"}) @EnableJpaRepositories("org.onap.so.db.catalog.data.repository") @EntityScan("org.onap.so.db.catalog.beans") public class CatalogDBApplication { diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java new file mode 100644 index 0000000000..823c807c8a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java @@ -0,0 +1,22 @@ +package org.onap.so.adapters.catalogdb; + + +import org.onap.so.logging.spring.interceptor.LoggingInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.handler.MappedInterceptor; + +@Configuration +public class WebMvcConfig extends WebMvcConfigurerAdapter { + + @Autowired + LoggingInterceptor loggingInterceptor; + + @Bean + public MappedInterceptor mappedLoggingInterceptor() { + return new MappedInterceptor(new String[]{"/**"}, loggingInterceptor); + } + +}
\ No newline at end of file |