How to dynamically enable wire logging for Apache Http Client in Java

时间:2018-03-25 19:56:13

标签: apache http httpclient

The usual way to enable wire logging is to put http.wire entry in logback xml . Is there a dynamic way to toggle this feature ? Dynamic , meaning -like a hot swap, without a server re-start .

1 个答案:

答案 0 :(得分:1)

经过充分研究后,似乎只能通过logback xml控制它,并且肯定会通过服务器重启来控制。

logback.xml中需要输入(如下所示):

<logger name="org.apache.http.wire" level="DEBUG">

P.S:

请注意,我在这里提到的库/依赖项是apache http one,如下所示。

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>SomeVersion</version>
</dependency>