Hi,

I am trying to run the MyLoggerTest.java file under
examples dir which shows the extension of log4j to
support other levels and am getting the following
error.

>>>
log4j:ERROR Did you forget to set the factory in the
config file?
java.lang.ClassCastException: org.apache.log4j.Logger
        at
examples.subclass.MyLoggerTest.main(MyLoggerTest.java:63)

>>>

Here is my xml config file
---------

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

<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">
  
  <categoryFactory
class="examples.subclass.MyLoggerFactory"/>

  <appender name="dest1"
class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.TTCCLayout"/>
  </appender>

  <appender name="dest2"
class="org.apache.log4j.RollingFileAppender">
     <param name="MaxFileSize" value="10MB"/> 
     <param name="MaxBackupIndex" value="2"/>
     <param name="File"
value="C:/java/log/test/xml_testsamp.log"/> 
     <param name="Threshold" value="DEBUG"/>
     <param name="File" value="xml_testsamp.log"/> 
     <layout class="org.apache.log4j.TTCCLayout"/>
  </appender>

  <category name="some.cat" additivity="false">
    <appender-ref ref="dest2"/>
  </category>

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

  </root>

</log4j:configuration>
     

Note: I did include the categoryFactory tag and don't
know why it is still throwing the classcast exception.

Can somebody please let me if I am doing anything
wrong.

Thanks.



__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

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

Reply via email to