@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(value={org.springframework.web.servlet.handler.HandlerInterceptorAdapter.class,com.google.cloud.logging.logback.LoggingAppender.class,TraceIdExtractor.class})
@ConditionalOnMissingBean(type="org.springframework.cloud.sleuth.autoconfig.SleuthProperties")
@AutoConfigureAfter(value=StackdriverTraceAutoConfiguration.class)
@ConditionalOnWebApplication(type=SERVLET)
@ConditionalOnProperty(value="spring.cloud.gcp.logging.enabled",
matchIfMissing=true)
@Import(value=LoggingWebMvcConfigurer.class)
public class StackdriverLoggingAutoConfiguration
extends Object
This class configures a Web MVC interceptor to capture trace IDs for log correlation.
This configuration is turned on only if Trace support is not used and Web MVC is used.
Otherwise, the MDC context will be used by the Logback appenders.
- Author:
- Mike Eltsufin, Chengyuan Zhao