That looks correct except that I think <level> should be the first
child of <logger>

On 5/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi all,
I'm using Jakarta Commons HttpClient for simulating test requests to
my web application. There I have configured log4j for logging at debug
level. But now the output from HttpClient wastes my logfile. How can I
configure log4j so that the output from a different package is logged
to an other file? I'm using XML configuration. Here is my log4j.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>

    <appender name="appender" class="org.apache.log4j.FileAppender">
      <param name="File" value="myApp-debug.log"/>
      <param name="Append" value="true"/>
      <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} [%X
{SessID}] %m%n"/>
      </layout>
    </appender>
    <appender name="errappender" class="org.apache.log4j.FileAppender"
>
      <param name="File" value="error.log"/>
      <param name="Append" value="true"/>
      <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} [%X
{SessID}] %m%n"/>
      </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="error" />
            <param name="LevelMax" value="fatal" />
        </filter>
    </appender>
<appender name="testappender" class="org.apache.log4j.FileAppender">
<param name="File" value="test.log"/>
<param name="Append" value="true"/>
      <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p [%t] %c - %m: %d{DATE}%n"
/>
      </layout>
    </appender>

    <root>
      <priority value="debug"/>
      <appender-ref ref="appender"/>
      <appender-ref ref="errappender"/>
    </root>
<logger name="org.apache.commons.httpclient"  additivity="false">
<appender-ref ref="lasttestappender"/>
  <level value="error"/>
</logger>
</log4j:configuration>

Thanks in advance,
Ralf H.


Jetzt neu: Der Routenplaner von Tiscali
http://www.tiscali.de/trav/routenplaner.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to