伪造日志记录不起作用
我正在尝试为来自Feing rest客户端的每个请求进行日志记录。但是,我无法使日志记录正常工作,而“标准”Slf4j日志记录确实有效。
我有以下几点:
public MyClient() {
initConnectionProperties();
this.service = Feign.builder()
.contract(new JAXRSContract())
.decoder(getJacksonDecoder())
.encoder(getJacksonEncoder())
.requestInterceptor(new BasicAuthRequestInterceptor(user, password))
//.client(new OkHttpClient())
.logger(new Slf4jLogger(MyClient.class)) //not working
.logLevel(feign.Logger.Level.BASIC)
.target(MyClient.class, this.url);
logger.info("Connection parameters: url = " + url + ", user = " + user); //Is working
}