日志被 httpclient.wire.content 转储填满。我怎样才能将其关闭?
我的卡塔琳娜日志充满了诸如“
/logs/catalina.out:2010-05-05 02:57:19,611 [Thread-19] DEBUG httpclient.wire.content - >> "[0x4]
[0xc][0xd9][0xf4][0xa2]MA[0xed][0xc2][0x93][0x1b][0x15][0xfe],[0xe]h[0xb0][0x1f][0xff][0xd6][0xfb]
[0x8f]O[0xd4][0xc4]0[0xab][0x80][0xe8][0xe4][0xf2][\r]I&[0xaa][0xd2]BQ[0xdb](zq[0xcd]ac[0xa8]
永远持续下去”之类的语句。
我搜索了 tomcat 和 apache 中的每个配置文件,以查找据称打开此功能的语句,如下所述:
http://hc.apache.org/httpclient-3.x/logging.html
我没有看到在哪里启用了此日志记录。我部署的其他 .war 没有执行此操作。应用程序中的 log4j 配置块没有执行此操作。
我还尝试用这样的语句将其关闭:
org.apache.commons.httpclient.wire=SEVERE
or
org.apache.commons.httpclient.wire.content=SEVERE
or
httpclient.wire.content=SEVERE
在我的 tomcat/conf/logging.properties 文件中,但这并没有阻止它,
我正在使用 grails 的 S3 库,它可能是这些库的来源。但是,当我在开发计算机上运行此应用程序(在开发和部署配置中)时,我没有看到它。
还有一个相关的问题:我什么时候想使用这些“线路日志”?
My catalina logs are filling up with gobs of statements like:
/logs/catalina.out:2010-05-05 02:57:19,611 [Thread-19] DEBUG httpclient.wire.content - >> "[0x4]
[0xc][0xd9][0xf4][0xa2]MA[0xed][0xc2][0x93][0x1b][0x15][0xfe],[0xe]h[0xb0][0x1f][0xff][0xd6][0xfb]
[0x8f]O[0xd4][0xc4]0[0xab][0x80][0xe8][0xe4][0xf2][\r]I&[0xaa][0xd2]BQ[0xdb](zq[0xcd]ac[0xa8]
on and on forever.
I searched every config file in both tomcat and apache for the statements that purportedly turn this on as described here:
http://hc.apache.org/httpclient-3.x/logging.html
And I don't see where this logging has been enabled. No other .war I deployed does this. The log4j configuration block in the app isn't doing it.
I also tried to turn it off with statements like this:
org.apache.commons.httpclient.wire=SEVERE
or
org.apache.commons.httpclient.wire.content=SEVERE
or
httpclient.wire.content=SEVERE
in my tomcat/conf/logging.properties file, and that didn't stop it
I'm using an S3 library for grails that may be the source for these. However when I run this application on my development machine (in both develop and deploy configs), I'm not seeing it.
And a related question: When would I want to use these "wire logs?"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 Slf4J:
并将 logback.xml 放入类路径中,内容如下:
For Slf4J:
And put logback.xml in your classpath with the content below:
您的 Tomcat common/lib 中是否有任何其他日志记录库? (即 SLF4J、Logback、Log4J 等)
如果是,您可能还需要配置相应的日志记录配置文件。
Do you have any additional logging library in your Tomcat common/lib? (i.e SLF4J, Logback, Log4J, etc)
If yes, you may want to configure the respective logging configuration file as well.
这是 Tomcat 8.5.1 的简单答案 - 目前已解决 Centos 上的问题。和许多人一样,我在这上面浪费了很多时间。 httpclient 内置了日志记录,因此您无法使用 log4j 或 slf4j 修复它,这里提供了答案。
如果不包括其他日志记录系统,则这适用。
[http://tomcat.apache.org/tomcat-8.5 -doc/logging.html][1]
创建一个logging.properties文件并将其放置在/src/main/resources中 - 以便将其部署到WEB-INF/classes(该示例将默认的FINE更改为WARN
servlet-examples Web 应用程序的示例logging.properties 放置在Web 应用程序内的WEB-INF/classes 中:
Here is a simple answer for Tomcat 8.5.1 - currently solved the issue on Centos. Like many, I wasted quite a bit of time on this. the httpclient has built in logging so you can't fix it with log4j or slf4j- and the answer is provided here.
This applies if no other logging systems are included.
[http://tomcat.apache.org/tomcat-8.5-doc/logging.html][1]
Create a logging.properties file and place in /src/main/resources - so that it is deployed to WEB-INF/classes (the example changes the default FINE to WARN
Example logging.properties for the servlet-examples web application to be placed in WEB-INF/classes inside the web application: