0
点赞
收藏
分享

微信扫一扫

SpringCloud:Feign日志配置


1.在application.properties开启日志记录:

logging.level.cn.edu.tju.service.TestClient=DEBUG

其中loggijng.level是固定的,=DEBUG也是固定的,其余部分是Feign client的全限定类名
2.创建日志bean:

package cn.edu.tju.config;

import feign.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LogConfig {
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
}

这个bean是记录所有日志。也可以用Logger.Level枚举里的其他值(NONE或BASIC或HEADERS)


举报

相关推荐

0 条评论