2

I need to shut up the org.apache.http.wire logging level because its logging every single HTTP request and it produces Gigabytes of logging, I'm using the default logging of tomcat6 which I think it is java.logging.util (JULI). Could you please tell me how to edit logging.properties in order to shut up this module? I found a discussion that explain how to shut up this log with log4j but I don't use it. Thanks in advance

EDIT: I tried to add this line to logging.properties into the CATALINA_HOME/conf: org.apache.http.wire.level = ERROR

but nothing changed.

0wn3r
  • 846
  • 1
  • 8
  • 21
  • Do you have to enable the wire logging? This is what happens, it's something to use only when debugging. – Schrute Jun 16 '13 at 01:57

2 Answers2

0

Create a logback.xml with below contents:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <logger name="org.apache" level="ERROR" />
    <logger name="httpclient" level="ERROR" />
</configuration>

Then put this logback.xml in your java source dir so it will be included in jar file. Otherwise create a jar from logback.xml and put this jar to your lib where you fetch all your jars.

A simple way to create logback.jar from logback.xml is using ant. Create build.xml with below code:

<?xml version='1.0'?>
<project name="test" default="compile" basedir=".">
<target name = "build-jar">
   <jar destfile = "op/logback.jar"
      basedir = "in">
      <manifest>
        <attribute name = "Main-Class" value = "com.tutorialspoint.util.FaxUtil"/>
      </manifest>
   </jar>
</target>
</project>

Create a directory structure like:

|-- build.xml

|-- in --> logback.xml

|-- op --> logback.jar //This will be generated after execution of ant command

Now compile using ant build-jar You will have logback.jar. Put this jar with all other jars and it will remove org.apache.http.wire DEBUG log

0

java.util.logging has a strange logging level scale. There is no ERROR level, the equivalent is SEVERE.

Also HttpClient 3.x used httpclient as logger name.

So use:

httpclient.wire.level = SEVERE
org.apache.http.wire.level = SEVERE

and check if you don't start Tomcat with -Dhttpclient.wire=debug or similar.

Since juli is configured during Tomcat startup, you might need to restart the server.

Piotr P. Karwasz
  • 5,292
  • 2
  • 9
  • 20