日志正在填充httpclient.wire.content转储。如何关闭它?

问题描述 投票:7回答:2

我的卡塔琳娜原木上满是这样的语句:

/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

org.apache.commons.httpclient.wire.content=SEVERE

httpclient.wire.content=SEVERE

在我的tomcat / conf / logging.properties文件中,并没有阻止它

我正在使用S3库获取grails,这可能是这些源。但是,当我在开发计算机上运行此应用程序时(在开发和部署配置中),都看不到它。

以及一个相关的问题:我什么时候要使用这些“记录日志?”

java tomcat log4j apache-commons-httpclient
2个回答
1
投票

您在Tomcat common / lib中是否还有其他日志记录库? (即SLF4J,Logback,Log4J等)

如果是,您可能还希望配置相应的日志记录配置文件。


8
投票

对于Slf4J:

<dependencies>
    <!-- LOGGING -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.5.9-RC0</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>0.9.17</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.9-RC0</version>
    </dependency>
</dependencies>

并将logback.xml放在下面的内容中的类路径中:

<configuration>
    <!-- LOGBACK logging config file, see http://logback.qos.ch/manual/joran.html -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <!-- http://logback.qos.ch/manual/layouts.html#ClassicPatternLayout -->
            <Pattern>%-5level %msg [%logger{16} %d{HH:mm:ss}]%n</Pattern>
        </layout>
    </appender>

    <root level="debug">
        <appender-ref ref="STDOUT" />
    </root>
    <logger name="org.apache" level="WARN" />
    <logger name="org.apache.axis2" level="WARN" />
    <logger name="org.apache.axiom" level="WARN" />
    <logger name="httpclient.wire" level="WARN" />
</configuration>
© www.soinside.com 2019 - 2024. All rights reserved.