Package com.google.cloud.spring.logging
Class LoggingWebMvcConfigurer
java.lang.Object
com.google.cloud.spring.logging.LoggingWebMvcConfigurer
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration(proxyBeanMethods=false)
public class LoggingWebMvcConfigurer
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
MVC Adapter that adds the
TraceIdLoggingWebMvcInterceptor
.-
Constructor Summary
ConstructorDescriptionLoggingWebMvcConfigurer
(TraceIdLoggingWebMvcInterceptor interceptor, GcpProjectIdProvider projectIdProvider) Constructor that accepts anTraceIdLoggingWebMvcInterceptor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInterceptors
(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addCorsMappings, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
-
Constructor Details
-
LoggingWebMvcConfigurer
public LoggingWebMvcConfigurer(@Autowired(required=false) TraceIdLoggingWebMvcInterceptor interceptor, GcpProjectIdProvider projectIdProvider) Constructor that accepts anTraceIdLoggingWebMvcInterceptor
. If the given interceptor is null, then a defaultCloudTraceIdExtractor
is used.- Parameters:
interceptor
- the interceptor to use with this configurer. If not provided aTraceIdLoggingWebMvcInterceptor
is used with the trace ID extractor described above.projectIdProvider
- the project ID provider to use
-
-
Method Details
-
addInterceptors
public void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry) - Specified by:
addInterceptors
in interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
-