com.healthy.common.log.TraceIdAutoConfiguration Maven / Gradle / Ivy
package com.healthy.common.log;
import com.healthy.common.log.mdc.TraceIdFilter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
/**
* 日志TraceId自动配置
*
* @author xm.z
*/
@AutoConfiguration
@ConditionalOnWebApplication
public class TraceIdAutoConfiguration {
@Bean
public FilterRegistrationBean traceIdFilterRegistrationBean() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean<>(new TraceIdFilter());
registrationBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
return registrationBean;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy