All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.healthy.common.log.TraceIdAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 2.0.0-M1
Show newest version
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