【发布时间】:2021-06-23 03:51:36
【问题描述】:
我正在使用 jersey apache 连接器,因此我的 jersey 客户端使用 apache http 客户端:
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
</dependency>
我这样初始化客户端:
ClientConfig conf = new ClientConfig().connectorProvider(new ApacheConnectorProvider());
Client client = ClientBuilder.newClient(conf);
现在我希望能够通过在我的 logback-test.xml 中添加它来记录 http 流量:
<logger name="org.apache.http.wire" level="DEBUG" />
但是它没有记录任何东西,我错过了什么吗?
更新:好吧,当我的应用程序使用 slf4j + logback 时,我可能错过了 Jersey 使用 java.util.logging。所以我添加了一个带有相应conf的jul-to-slf4j桥,但仍然没有日志。
【问题讨论】:
标签: java xml jersey jersey-client