Hi,

We have recently started to use log4j.  I would like to 
use the xml file configuration as opposed to the properties.

I would like to someone to give me some hints as to why my
xml configuration does not work.  Below is the file I have
currently.  What I would like to do is to log everything to
the CONSOLE (stderr) as well as to one of two files.  One
is a normal file for the root category and the other would
be to a rolling file for categories which are created under
our package hierarchy (net.itouchnet.au.*)  All category
instances are created with the fully qualified  Java class
name.  Could someone please suggest as to why this is not
working.  The ROLLINGFILE.out never gets written to, only the
console and the FILE.out are used.

Thanks,
Aron.


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

        <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%d %-5p [%t]
%C{2} (%F:%L) - %m%n"/>
            </layout>
        </appender>

        <appender name="FILE" class="org.apache.log4j.FileAppender">
           <param name="File" value="FILE.out" />
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5p [%t] %C{2}
(%F:%L) - %m%n"/>
           </layout>
        </appender>

        <appender name="ROLLINGFILE"
class="org.apache.log4j.RollingFileAppender">
                <param name="File" value="ROLLINGFILE.out" />
                <param name="Append" value="true" />
                <param name="MaxFileSize" value="250" />
                <param name="MaxBackupIndex" value="0" />
                <layout class="org.apache.log4j.PatternLayout">
                  <param name="ConversionPattern"
                         value="%r [%t] %p %C{2} - TEST3 %m\n" />
                </layout>
        </appender>

        <category name="net.itouchnet.au">
          <priority value="debug" />
          <appender-ref ref="CONSOLE" />
          <appender-ref ref="ROLLINGFILE" />
        </category>

        <root>
           <priority value ="debug" />
           <appender-ref ref="CONSOLE" />
           <appender-ref ref="FILE" />
        </root>

</log4j:configuration>


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

Reply via email to